[jboss-jira] [JBoss JIRA] (JBRULES-3628) Exception jitting a constaint invoking a constructor

Mario Fusco (JIRA) jira-events at lists.jboss.org
Tue Sep 18 05:19:34 EDT 2012


Mario Fusco created JBRULES-3628:
------------------------------------

             Summary: Exception jitting a constaint invoking a constructor
                 Key: JBRULES-3628
                 URL: https://issues.jboss.org/browse/JBRULES-3628
             Project: Drools
          Issue Type: Feature Request
      Security Level: Public (Everyone can see)
            Reporter: Mario Fusco
            Assignee: Mario Fusco


If the constraint invokes a constructor with a primitive type as argument but passing the corresponding class type to it as in the following example:

class Person {
    public Integer getAgeAsInteger() { return age; }
}

rule R1 when
   Person( new Integer( ageAsInteger ) < 40 )
then
end

when the constraint is jitted the following Exception is thrown:

java.lang.RuntimeException: Exception jitting: new Integer( ageAsInteger ) < 40
	at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:274)
	at org.drools.rule.constraint.MvelConstraint.jitEvaluator(MvelConstraint.java:229)
	at org.drools.rule.constraint.MvelConstraint.forceJitEvaluator(MvelConstraint.java:222)
	at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:191)
	at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:156)
	at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
	at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
	at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
	at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
	at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
	at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
	at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
	at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
	at org.drools.integrationtests.MiscTest.testJit(MiscTest.java:11520)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.VerifyError: (class: ConditionEvaluatord12c0fbaca644b0eaff422a71b8812cc, method: evaluate signature: (Ljava/lang/Object;Lorg/drools/common/InternalWorkingMemory;Lorg/drools/reteoo/LeftTuple;)Z) Expecting to find integer on stack
	at java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
	at java.lang.Class.getConstructor0(Class.java:2699)
	at java.lang.Class.getConstructor(Class.java:1657)
	at org.drools.rule.builder.dialect.asm.ClassGenerator.newInstance(ClassGenerator.java:198)
	at org.drools.rule.constraint.ASMConditionEvaluatorJitter.jitEvaluator(ASMConditionEvaluatorJitter.java:53)
	at org.drools.rule.constraint.MvelConstraint.executeJitting(MvelConstraint.java:272)
	... 40 more

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list