Re: Ternary op + autoboxing + null value = NPE?
Re: Ternary op + autoboxing + null value = NPE?
- Subject: Re: Ternary op + autoboxing + null value = NPE?
- From: Chuck Hill <email@hidden>
- Date: Mon, 19 Oct 2009 21:17:11 -0700
On Oct 19, 2009, at 8:59 PM, Lachlan Deck wrote:
On 20/10/2009, at 3:52 AM, Chuck Hill wrote:
On Oct 19, 2009, at 8:37 AM, Mike Schrag wrote:
I personally don't like boxing -- I think it's very misleading and
leads to weird bugs like this.
+1
Keep it consistent...
new Integer(1);
Integer.valueOf(1) is better for memory usage:
Returns a Integer instance representing the specified int value. If a
new Integer instance is not required, this method should generally be
used in preference to the constructor Integer(int), as this method is
likely to yield significantly better space and time performance by
caching frequently requested values.
Chuck
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden