[rules-users] Check for null entry in collection before iterating

Davide Sottara dsotty at gmail.com
Mon Apr 29 14:30:08 EDT 2013


DROOLS-71 has already been fixed in master, it's another bug that will
be corrected
when 5.6 and 6.x are released.
I do agree with Wolfgang, I wonder if you can control the elements as
the list is populated
Davide



On 04/29/2013 09:48 AM, Wolfgang Laun wrote:
> I'd dearly love to hear some good argument why null in a List<Things>
> is good coding
> practice (note: I'm not asking for "best practice"). - Compare these
> two sentences:
>
>     He looked into her eyes....
>     He looked into her eyes.
>
> It's pretty obvious that the ellipsis indicates a planned absence of
> words, whereas the
> second sentence just shows a void, or no void, at its end. (Or: lover
> or typo or oculist.)
> What I'm trying to say is that a  null planned to show a special case
> is indistinguishable
> from the null that happens due to an error.
>
> Processing "from" while covering null is just postponing the detection
> of an error - if
> you are with me that null shouldn't be there in the first place.
>
> But, yes, you can test:
>    list contains null
> should tell you whether there is a fly in the ointment.
>
> -W
>
> On 29 April 2013 15:28, dcrissman <dcrissman at redhat.com
> <mailto:dcrissman at redhat.com>> wrote:
>
>     I ran into this situation for which there doesn't seem to be a
>     solution for:
>     https://issues.jboss.org/browse/DROOLS-71
>
>     I am using drools v. 5.5.0.Final
>
>     My preference would  be for Drools to simply skip the null value,
>     but if
>     that is not possible, is there a way to check for a null entry?
>
>     How have other people worked through this issue?
>
>     Thanks.
>
>
>
>     --
>     View this message in context:
>     http://drools.46999.n3.nabble.com/Check-for-null-entry-in-collection-before-iterating-tp4023583.html
>     Sent from the Drools: User forum mailing list archive at Nabble.com.
>     _______________________________________________
>     rules-users mailing list
>     rules-users at lists.jboss.org <mailto:rules-users at lists.jboss.org>
>     https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130429/f2c94f4b/attachment.html 


More information about the rules-users mailing list