apache / incubator-kie-drools

Drools is a rule engine, DMN engine and complex event processing (CEP) engine for Java.
http://www.drools.org
Apache License 2.0
5.88k stars 2.5k forks source link

[new-parser] `PackageDescr.resource` not set #5933

Closed yurloc closed 5 months ago

yurloc commented 6 months ago

Parent issue

Failing tests

Notes

DRLVisitorImpl should simply set the Resource that was parsed to each Descr in the resulting AST.

Rule code snippet

N/A.

Error output

### parse : ANTLR4_PARSER_ENABLED = true

java.lang.AssertionError: [PackageDescr.resource is null!] 
Expecting actual not to be null

    at org.drools.mvel.compiler.compiler.PackageDescrResourceVisitor.checkResource(PackageDescrResourceVisitor.java:76)
    at org.drools.mvel.compiler.compiler.PackageDescrResourceVisitor.visit(PackageDescrResourceVisitor.java:315)
    at org.drools.mvel.compiler.compiler.DescrResourceSetTest.drlFilesTest(DescrResourceSetTest.java:63)
yurloc commented 6 months ago

good-first-issue

tkobayas commented 6 months ago

/take This seems to be a little more complex than the first look.

tkobayas commented 6 months ago

DescrResourceSetTest goes through all drl files in test-compiler-integration. If there is a parser error, the resource assertion is skipped. So it's better to hold on this fix until some other test failures will be fixed.

tkobayas commented 5 months ago

Fixed by https://github.com/apache/incubator-kie-drools/pull/5984