• 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: Lachlan Deck <email@hidden>
  • Date: Tue, 20 Oct 2009 21:03:06 +1100

On 20/10/2009, at 3:17 PM, Chuck Hill wrote:

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.

Touché :)

with regards,
--

Lachlan Deck



_______________________________________________
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


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>)
 >Re: Ternary op + autoboxing + null value = NPE? (From: Chuck Hill <email@hidden>)

  • Prev by Date: Re: ERDList - how to make editable
  • Next by Date: build.properties file eoAdaptorClassName= is empty
  • Previous by thread: Re: Ternary op + autoboxing + null value = NPE?
  • Next by thread: Re: Ternary op + autoboxing + null value = NPE?
  • Index(es):
    • Date
    • Thread