• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ternary op + autoboxing + null value = NPE?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Ternary op + autoboxing + null value = NPE?
      • From: Lachlan Deck <email@hidden>
References: 
 >Ternary op + autoboxing + null value = NPE? (From: Ramsey Gurley <email@hidden>)
 >Re: Ternary op + autoboxing + null value = NPE? (From: Mike Schrag <email@hidden>)
 >Re: Ternary op + autoboxing + null value = NPE? (From: Chuck Hill <email@hidden>)
 >Re: Ternary op + autoboxing + null value = NPE? (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Re: Ternary op + autoboxing + null value = NPE?
  • Next by Date: Re: ERIndexing (was: How to achieve a fuzzy match searcher)
  • Previous by thread: Re: Ternary op + autoboxing + null value = NPE?
  • Next by thread: Re: Ternary op + autoboxing + null value = NPE?
  • Index(es):
    • Date
    • Thread