[jboss-jira] [JBoss JIRA] (DROOLS-858) NoSuchMethodError on JIT Compilation of non-primitive comparison

RH Bugzilla Integration (JIRA) issues at jboss.org
Tue Aug 11 02:38:04 EDT 2015


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

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

Mario Fusco <mfusco at redhat.com> changed the Status of [bug 1251826|https://bugzilla.redhat.com/show_bug.cgi?id=1251826] from NEW to MODIFIED

> NoSuchMethodError on JIT Compilation of non-primitive comparison
> ----------------------------------------------------------------
>
>                 Key: DROOLS-858
>                 URL: https://issues.jboss.org/browse/DROOLS-858
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 6.3.0.Beta2
>            Reporter: Sascha Dirbach
>            Assignee: Mario Fusco
>             Fix For: 6.3.0.CR1
>
>         Attachments: ConditionEvaluator898a83b4ea6745eaa1b63420a059d717.class
>
>
> A LHS like this:
> {code}
> $map : Map()
> $simpleTestObject : NonStringConstructorClass (something=="simpleTestObject")
> Entry (
>   getKey() == $simpleTestObject
> ) from $map.entrySet()
> {code}
> fails at runtime with a NoSuchMethodError, when incompatible objects are compared (Map with object vs. custom Object) and the execution is jitted.
> The generated evaluation method looks like this:
> {code}
>   public boolean evaluate(InternalFactHandle paramInternalFactHandle, InternalWorkingMemory paramInternalWorkingMemory, LeftTuple paramLeftTuple)
>   {
>     LeftTuple localLeftTuple = paramLeftTuple;
>     NonStringConstructorClass localNonStringConstructorClass2 = (NonStringConstructorClass)this.declarations[0].getValue(paramInternalWorkingMemory, localLeftTuple.getHandle().getObject());
>     Object localObject = ((Map.Entry)paramInternalFactHandle.getObject()).getKey();
>     NonStringConstructorClass localNonStringConstructorClass1 = localNonStringConstructorClass2;
>     if (localObject != null)
>     {
>       if ((localObject instanceof NonStringConstructorClass)) {
>         localObject = (NonStringConstructorClass)localObject;
>       } else {
>         localObject = new NonStringConstructorClass(localObject.toString());
>       }
>     }
>     else
>     {
>       tmpTernaryOp = (localNonStringConstructorClass1 != null ? 0 : true;
>       break label123;
>     }
>     label123:
>     return localNonStringConstructorClass1 == null ? false : ((NonStringConstructorClass)localObject).equals(localNonStringConstructorClass1);
>   }
> }
> {code}
> It seem that, a fallback for primitive types was included, by calling the constructor of an object with the object's toString() output:
> {code}
> localObject = new NonStringConstructorClass(localObject.toString());
> {code}
> At runtime this fails, if no such constructor exists.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the jboss-jira mailing list