[jboss-jira] [JBoss JIRA] Commented: (JBRULES-843) getter return type java.lang.Object seems to map to ARRAY_TYPE

Juergen none (JIRA) jira-events at lists.jboss.org
Mon May 7 18:58:52 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBRULES-843?page=comments#action_12361708 ] 
            
Juergen none commented on JBRULES-843:
--------------------------------------

patch suggestion:
org.drools.base.ClassObjectType::setTypeValue(),122:
current:
            this.valueType = Evaluator.DATE_TYPE;
        } else if ( clazz.isAssignableFrom( Object[].class ) ) {
            this.valueType = Evaluator.ARRAY_TYPE;

patched:
            this.valueType = Evaluator.DATE_TYPE;
        } else if (clazz.isArray()) {
            this.valueType = Evaluator.ARRAY_TYPE;


> getter return type java.lang.Object seems to map to ARRAY_TYPE
> --------------------------------------------------------------
>
>                 Key: JBRULES-843
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-843
>             Project: JBoss Rules
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.0.6
>            Reporter: Juergen none
>         Assigned To: Mark Proctor
>
> if a fact defines a getter with return value type java.lang.Object, the org.drools.base.ClassObjectType::setTypeValue() seems to set the object type to ARRAY_TYPE, because: java.lang.Object.class.isAssignableFrom(Object[].class) == true
> Caused by: java.lang.ClassCastException: test.A
>         at org.drools.base.evaluators.ArrayFactory$ArrayNotEqualEvaluator.evaluate(ArrayFactory.java:82)
>         at org.drools.rule.BoundVariableConstraint.isAllowed(BoundVariableConstraint.java:78)
>         at org.drools.common.BetaNodeBinder.isAllowed(BetaNodeBinder.java:63)
>         at org.drools.reteoo.TupleSource.attemptJoin(TupleSource.java:99)
>         at org.drools.reteoo.JoinNode.assertTuple(JoinNode.java:122)
>         at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(LeftInputAdapterNode.java:176)
>         at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:145)
> ...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list