+1 for Elvis operator, +1000 for [non-]nullability support in the
typesystem like Fan. Ideally, the latter featutre should be supported at
the bytecode level (not sugar) so a big number of variables would be
hard-tagged as never null, which I suppose would result in faster code
without dependen
Changeset: 16bce7ce4fc9
Author:thurka
Date: 2009-11-16 15:33 +0100
URL: http://hg.openjdk.java.net/jdk7/tl/jdk/rev/16bce7ce4fc9
6858708: HotspotDiagnosticMXBean.setVMOption() throws NullPointerException
Summary: Add a null check for the VM option string
Reviewed-by: mchung, ohair
!
2009/11/16 Stephen Colebourne :
> 2009/11/16 David Holmes - Sun Microsystems :
>>> In this specific case, the question was "why include it when you can
>>> use a?b:c". Well, I've seen resistance by developers to that language
>>> feature, and I know some places outright block it in coding standards
2009/11/16 David Holmes - Sun Microsystems :
>> In this specific case, the question was "why include it when you can
>> use a?b:c". Well, I've seen resistance by developers to that language
>> feature, and I know some places outright block it in coding standards.
>> For many, a method call is prefe
I agree with Stephen that the Elvis operator should have been included.
Regardless, I think the proposed method is still a common idiom worth
having. It might not "save any keystrokes", but it's a certain way of
not flubbing ternary logic or a verbose if-else statement.
By the way, this is a lot
Stephen Colebourne said the following on 11/16/09 18:44:
In this specific case, the question was "why include it when you can
use a?b:c". Well, I've seen resistance by developers to that language
feature, and I know some places outright block it in coding standards.
For many, a method call is pre
2009/11/16 Martin Buchholz :
> On Sun, Nov 15, 2009 at 16:47, Rémi Forax wrote:
>> Do you want to say something like "I need a closure here" :)
>>
>
> No. I need a macro here! (But not a C-style one)
No, what you need is the Elvis null-safe operator ?: But then that
was rejected wasn't it...