[jboss-jira] [JBoss JIRA] Commented: (JBRULES-627) null pointer with number comparison..

Pierre Paysant-Le Roux (JIRA) jira-events at lists.jboss.org
Fri Mar 16 06:17:36 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBRULES-627?page=comments#action_12356331 ] 
            
Pierre Paysant-Le Roux commented on JBRULES-627:
------------------------------------------------

I experience a use case where this limitation with null objects is problematic :

rule "It could be null"
when
    MyFact( integerValue != null & > 10 )
    # or 
    # MyFact( integerValue == null | > 10 )
then
    ...
end

The behaviour is clear : if the Integer is null, there is no need to compare null with something else to evaluate the column.

> null pointer with number comparison..
> -------------------------------------
>
>                 Key: JBRULES-627
>                 URL: http://jira.jboss.com/jira/browse/JBRULES-627
>             Project: JBoss Rules
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 3.0.4
>         Environment: Windows XP or Solaris
> Sun JDK 1.4.2
> Drools 3.0.4 distribution
>            Reporter: Sachin Holla
>         Assigned To: Mark Proctor
>
> getting a null pointer while asserting fact:
> Caused by: java.lang.NullPointerException
> 	at org.drools.base.evaluators.IntegerFactory$IntegerGreaterEvaluator.evaluate(Unknown Source)
> 	at org.drools.rule.BoundVariableConstraint.isAllowed(Unknown Source)
> 	at org.drools.common.BetaNodeBinder.isAllowed(Unknown Source)
> 	at org.drools.reteoo.TupleSource.attemptJoin(Unknown Source)
> 	at org.drools.reteoo.JoinNode.assertTuple(Unknown Source)
> 	at org.drools.reteoo.LeftInputAdapterNode.createAndAssertTuple(Unknown Source)
> 	at org.drools.reteoo.LeftInputAdapterNode.assertObject(Unknown Source)
> 	at org.drools.reteoo.ObjectSource.propagateAssertObject(Unknown Source)
> 	at org.drools.reteoo.ObjectTypeNode.assertObject(Unknown Source)
> 	at org.drools.reteoo.Rete.assertObject(Unknown Source)
> 	at org.drools.reteoo.ReteooRuleBase.assertObject(Unknown Source)
> 	at org.drools.reteoo.ReteooWorkingMemory.doAssertObject(Unknown Source)
> 	at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
> 	at org.drools.common.AbstractWorkingMemory.assertObject(Unknown Source)
> Rule is something like this:
> rule "Greater Than with NULL number!!"
> when
>     MyFact ( integerAttribute > 10 )
> then
>    .....
> end
> the *intergerAttribute* is of type java.lang.Integer and value is *null*.
> no such problem if expression changed to *integerAttribute == 10* or !=

-- 
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