Type: New Feature
Affects Version/s: None
Fix Version/s: None
Number of attachments :
Currently in order to make a null safe property navigation, the syntax is ?nullSafeProperty.property
For example, foo.?bar.p
means foo.bar == null ? null : foo.bar.p
There are many scripting language adopting a different syntax: ?.
The above example becomes: foo.bar?.p
which is more intuitive because
1) the null-checking is put together with the corresponding navigation (.) . Existing syntax of MVEL is a bit misleading because .? seems to come together, but in fact the latter ? affects the next navigation.
2) The syntax (?.) can be easily understand by "reading" as : is not null then navigate (.)
It seems to me both syntax can coexists in order to maintain backward compatibility.