There is a ClassCastException in
org.drools.compiler.integrationtests.incrementalcompilation.IncrementalCompilationTest#testUnusedDeclaredTypeUpdate
when the constraint is jitted:
log
[ERROR] testUnusedDeclaredTypeUpdate[KieBase type=CLOUD_IDENTITY](org.drools.compiler.integrationtests.incrementalcompilation.IncrementalCompilationTest) Time elapsed: 0.091 s <<< ERROR! java.lang.RuntimeException: Error evaluating constraint 'str == "bar"' in [Rule "rule updating ReferencedType" in rules1.drl] at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277) at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225) at org.drools.core.reteoo.AlphaNode$ObjectSinkUpdateAdapter.assertObject(AlphaNode.java:258) at org.drools.core.reteoo.ObjectTypeNode.updateSink(ObjectTypeNode.java:453) at org.drools.core.reteoo.AlphaNode.updateSink(AlphaNode.java:172) at org.drools.core.phreak.AddRemoveRule.insertLiaFacts(AddRemoveRule.java:759) at org.drools.core.phreak.AddRemoveRule.addRule(AddRemoveRule.java:111) at org.drools.core.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:195) at org.drools.core.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:139) at org.drools.core.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:110) at org.drools.core.impl.KnowledgeBaseImpl.internalAddRule(KnowledgeBaseImpl.java:1522) at org.drools.core.impl.KnowledgeBaseImpl.lambda$addRules$5(KnowledgeBaseImpl.java:1515) at org.drools.core.impl.KnowledgeBaseImpl.enqueueModification(KnowledgeBaseImpl.java:744) at org.drools.core.impl.KnowledgeBaseImpl.addRules(KnowledgeBaseImpl.java:1513) at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.compileRete(KnowledgeBuilderImpl.java:954) at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.buildRules(KnowledgeBuilderImpl.java:2475) at org.drools.compiler.builder.impl.KnowledgeBuilderImpl.buildPackages(KnowledgeBuilderImpl.java:2394) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:105) at org.drools.compiler.builder.impl.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:97) at org.drools.compiler.kie.builder.impl.KieBaseUpdater.rebuildAll(KieBaseUpdater.java:145) at org.drools.compiler.kie.builder.impl.KieBaseUpdater.run(KieBaseUpdater.java:86) at org.drools.core.impl.KnowledgeBaseImpl.enqueueModification(KnowledgeBaseImpl.java:744) at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:267) at org.drools.compiler.kie.builder.impl.KieContainerImpl.update(KieContainerImpl.java:237) at org.drools.compiler.kie.builder.impl.KieContainerImpl.updateToVersion(KieContainerImpl.java:195) at org.drools.compiler.integrationtests.incrementalcompilation.IncrementalCompilationTest.testUnusedDeclaredTypeUpdate(IncrementalCompilationTest.java:4658) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeLazy(JUnitCoreWrapper.java:119) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:87) at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75) at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:158) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345) at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418) Caused by: java.lang.ClassCastException: class org.example.facts.ReferencedType cannot be cast to class org.example.facts.ReferencedType (org.example.facts.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @41bbb219; org.example.facts.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @7eebb316) at ConditionEvaluatorb33976dd7bbd47978bee1412baf11e39.evaluate(Unknown Source) at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275) ... 68 more