Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DROOLS-7428] ErrorUtil should not throw NPE #327

Merged
merged 1 commit into from May 6, 2023

Conversation

tkobayas
Copy link
Collaborator

@tkobayas tkobayas commented Apr 28, 2023

https://kie.zulipchat.com/#narrow/stream/232678-jbpm/topic/WorkItemHandler

https://issues.redhat.com/browse/DROOLS-7428

The problem is that ErrorUtil throws NPE when caught.getExpr() is null, so the call cannot get the root cause of the CompileException.

It is reported for business-central, but this should be fixed for general use cases.

@tkobayas
Copy link
Collaborator Author

tkobayas commented Apr 28, 2023

The test failure seems to be caused by the use of OptimizerFactory.setDefaultOptimizer("ASM"). Not related to this PR. We will need to address it in a separated JIRA/PR (e.g write common setUp to enable OptimizerFactory.DYNAMIC). -> filed https://issues.redhat.com/browse/DROOLS-7429

2023-04-28T09:15:38.8694781Z Tests run: 318, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.158 sec <<< FAILURE! - in org.mvel2.tests.core.CoreConfidenceTests
2023-04-28T09:15:38.8712458Z testMapAccessProperty(org.mvel2.tests.core.CoreConfidenceTests)  Time elapsed: 0.001 sec  <<< ERROR!
2023-04-28T09:15:38.8716465Z org.mvel2.CompileException: [Error: [Error: could not access: key; in class: java.util.HashMap]
2023-04-28T09:15:38.8717135Z [Near : {... map.key ....}]
2023-04-28T09:15:38.8717593Z              ^
2023-04-28T09:15:38.8718074Z [Line: 1, Column: 1]]
2023-04-28T09:15:38.8718375Z [Near : {... map.key ....}]
2023-04-28T09:15:38.8718660Z              ^
2023-04-28T09:15:38.8718935Z [Line: 1, Column: 1]
2023-04-28T09:15:38.8719437Z    at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.getBeanProperty(ASMAccessorOptimizer.java:1332)
2023-04-28T09:15:38.8720270Z    at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.compileAccessor(ASMAccessorOptimizer.java:856)
2023-04-28T09:15:38.8720996Z    at org.mvel2.optimizers.impl.asm.ASMAccessorOptimizer.optimizeAccessor(ASMAccessorOptimizer.java:345)
2023-04-28T09:15:38.8721583Z    at org.mvel2.ast.ASTNode.optimize(ASTNode.java:159)
2023-04-28T09:15:38.8722083Z    at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:115)
2023-04-28T09:15:38.8722897Z    at org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:42)
2023-04-28T09:15:38.8723444Z    at org.mvel2.MVEL.executeExpression(MVEL.java:970)
2023-04-28T09:15:38.8724331Z    at org.mvel2.tests.core.CoreConfidenceTests.testMapAccessProperty(CoreConfidenceTests.java:3502)

@tkobayas tkobayas changed the title ErrorUtil should not throw NPE [DROOLS-7428] ErrorUtil should not throw NPE Apr 28, 2023
@mariofusco mariofusco merged commit fc6024a into mvel:master May 6, 2023
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants