[jboss-jira] [JBoss JIRA] (DROOLS-37) Operators on java.lang.Comparable object doesn't work if JIT is enable

RH Bugzilla Integration (JIRA) issues at jboss.org
Mon Aug 31 12:47:05 EDT 2015


    [ https://issues.jboss.org/browse/DROOLS-37?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13103766#comment-13103766 ] 

RH Bugzilla Integration commented on DROOLS-37:
-----------------------------------------------

Marek Winkler <mwinkler at redhat.com> changed the Status of [bug 1233978|https://bugzilla.redhat.com/show_bug.cgi?id=1233978] from ON_QA to VERIFIED

> 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
>    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 was sent by Atlassian JIRA
(v6.3.15#6346)



More information about the jboss-jira mailing list