Seems like a bug, yes. Wanna try to fix and provide patch?

drools-core/src/main/java/org/drools/base/extractors/BaseObjectClassFieldExtractor.java

   []s
   Edson


2008/12/2 techy <techluver007@gmail.com>

Hello Mark,
Is this a bug?



techy wrote:
>
> I use 4.0.7.
>
>
> Mark Proctor wrote:
>>
>> techy wrote:
>>> I have rule that logical comparison with two Float fields(like price <
>>> bidPrice || price >= bidPrice ). I get following exception if one of
>>> field
>>> is null. Is this expected behaviour? Please clarify. Thanks
>>>
>> what version of drools are you using? Nullpointers on direct fields
>> should not happen on drools 4.0.5, or 5.0M3.
>>
>> Mark
>>>
>>> Caused by: java.lang.NullPointerException
>>>     at
>>> org.drools.base.extractors.BaseObjectClassFieldExtractor.getFloatValue(BaseObjectClassFieldExtractor.java:84)
>>>     at
>>> org.drools.base.ClassFieldExtractor.getFloatValue(ClassFieldExtractor.java:191)
>>>     at
>>> org.drools.base.evaluators.FloatFactory$FloatLessEvaluator.evaluate(FloatFactory.java:250)
>>>     at
>>> org.drools.rule.VariableRestriction.isAllowed(VariableRestriction.java:73)
>>>     at
>>> org.drools.rule.VariableConstraint.isAllowed(VariableConstraint.java:67)
>>>     at org.drools.rule.AndConstraint.isAllowed(AndConstraint.java:47)
>>>     at org.drools.rule.OrConstraint.isAllowed(OrConstraint.java:50)
>>>     at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:137)
>>>     at
>>> org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
>>>     at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
>>>     at
>>> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
>>>     at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
>>>     at
>>> org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
>>>     at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:145)
>>>     at
>>> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:318)
>>>     at
>>> org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
>>>     at org.drools.reteoo.Rete.assertObject(Rete.java:175)
>>>     at
>>> org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
>>>     at
>>> org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
>>>     at
>>> org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1287)
>>>     at
>>> org.drools.base.DefaultKnowledgeHelper.update(DefaultKnowledgeHelper.java:103)
>>>
>>
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users@lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/rules-users
>>
>>
>
>

--
View this message in context: http://www.nabble.com/NullPointerException-with-float-field-tp20740799p20798617.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com