[jboss-jira] [JBoss JIRA] (DROOLS-37) Operators on java.lang.Comparable object doesn't work if JIT is enable
stevearoonie (JIRA)
jira-events at lists.jboss.org
Thu Dec 5 02:00:06 EST 2013
[ https://issues.jboss.org/browse/DROOLS-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928781#comment-12928781 ]
stevearoonie commented on DROOLS-37:
------------------------------------
I just got this error using the 5.5.1 snapshot. Looking at the source for the fix it seems as though it was around parameterized types, however joda LocalDates are not parameterized.
> Operators on java.lang.Comparable object doesn't work if JIT is enable
> ----------------------------------------------------------------------
>
> Key: DROOLS-37
> URL: https://issues.jboss.org/browse/DROOLS-37
> Project: Drools
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Affects Versions: 5.5.0.Final
> Environment: Windows XP
> Java 1.5
> joda-time 1.6.2
> Reporter: Jérémy SOULA
> Assignee: Mario Fusco
> Labels: 5.5, comparable, localDate
> Fix For: 5.5.1.Final, 6.0.0.Alpha9
>
> Attachments: drools-bugs.zip
>
>
> In my application, i have rules that used org.joda.time.LocalDate to compare date like
> {noformat}
> rule "toto"
> when
> LocalDateForDroolsTestBean(
> infDate>=supDate
> )
> then
> //Anything
> end
> {noformat}
> With Drools 5.3, all works fine.
> With Drools 5.5, an exception occured because JIT optimizer automaticaly enabled:
> {noformat}
> Exception in thread "main" java.lang.NoSuchMethodError: org.joda.time.LocalDate.compareTo(Lorg/joda/time/LocalDate;)I
> at ConditionEvaluatorf8ba8fa3003345adbf3979e901488f23.evaluate(Unknown Source)
> at org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:200)
> at org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:157)
> 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.impl.StatelessKnowledgeSessionImpl.execute(StatelessKnowledgeSessionImpl.java:304)
> at fr.jsoula.jboss.drools.bugs.comparable.ComparableBug.main(ComparableBug.java:39)
> {noformat}
> After search, it seems that the bytecode generated by org.drools.rule.builder.dialect.asm.ClassGenerator can't call the method public int compareTo(Object partial) of org.joda.time.LocalDate. The parameter of the method must be the same class of the current object.
--
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