commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@gmail.com>
Subject Re: commons lang3: NullArgumentException missing?
Date Fri, 23 Dec 2011 03:34:21 GMT
On Wed, Dec 21, 2011 at 3:41 PM, Karsten Wutzke <kwutzke@web.de> wrote:
> Wow, the Java/JDK is getting dirtier and dirtier with every release. The code
>
>  public Foo(Bar bar) {
>     this.bar = Objects.requireNonNull(bar);
>  }
> looks really really awful to me.

As opposed to this.bar = Validate.notNull(bar) from commons-lang3? ;)

Matt

>
> IMO it's time to reimplement the JDK and throw away backward compatibility than introduce
patch after patch. At least a second clean API of the JDK should be provided.
>
> I wonder what others are thinking about this.
>
> Karsten
>
>
> -----Ursprüngliche Nachricht-----
> Von: "Paul Benedict" <pbenedict@apache.org>
> Gesendet: 21.12.2011 19:04:48
> An: "Commons Users List" <user@commons.apache.org>
> Betreff: Re: commons lang3: NullArgumentException missing?
>
>>The official standard in the JDK is to throw NPE for null arguments. Since
>>JDK 7, they have made API available for this in
>>java.util.Objects#requireNonNull(). Commons is following the official
>>direction.
>>On Dec 21, 2011 10:16 AM, <kwutzke@web.de> wrote:
>
>
> ___________________________________________________________
> SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
> kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message