Two points to consider:<br><br>(1) If a programmer writes<br>   a.getB().getC() == &lt;something&gt;<br>and a NPE happens due to a.getB() == null we may distinguish (a) and (b) - see below.<br><br>(a) The setup is so that this is to be expected but the programmer forgot to take this possibility into account. Then we have:<br>
<br>(a1) The consequence of a.getB() == null should be the same as a.getB().getC() == null.<br><br>(a2) If a.getB() == null, something else needs to be done, e.g., a.setB(x). If this is silently covered by the system, the absence of handling will not be detected so easily.<br>
<br>(b) The assumption is that a.getB() should never be == null in the first place, but some other error (in data or code) caused this. If this is silently covered by the system, this error will not be detected so easily.<br>
<br><br>(2) If a.getB().getC() == &lt;something&gt; returns false if a.getB() is null, is this also the desired result if &lt;something&gt; is &quot;null&quot;, i.e., do you want<br>   a.getB().getC() == null<br>to be false if a.getB() == null ?<br>
<br>&quot;Null safe navigation&quot; is a nice try and *may* be tolerable, but it should never be the default.<br><br>-W<br> <br><br><div class="gmail_quote">On 28 July 2011 14:06, bolsover <span dir="ltr">&lt;<a href="mailto:david@bolsover.com">david@bolsover.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks for the pointer to the MVEL documents - I can forsee null-safe<br>
operator user.?<a href="http://manager.name" target="_blank">manager.name</a> syntax being most useful.<br>
<br>
As for making the null test the default action - I&#39;m not sure - I can&#39;t say<br>
I have ever actually &#39;wanted&#39; a nullpointer - but there may be some special<br>
case.<br>
<br>
David<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Condition-syntax-to-access-Map-tp3204429p3206467.html" target="_blank">http://drools.46999.n3.nabble.com/Condition-syntax-to-access-Map-tp3204429p3206467.html</a><br>

</font><div><div></div><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>