• 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: NSDictionary.isEmpty
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary.isEmpty


  • Subject: Re: NSDictionary.isEmpty
  • From: Mike Schrag <email@hidden>
  • Date: Thu, 16 Sep 2010 13:14:00 -0400

The fix is to change NSDictionary.java's isEmpty() method to be:
public boolean isEmpty() {
return count() <= 0;
}

For the record, size() should be changed as well! 
And perhaps others, but I don't have unit tests for NSDictionary so I'm not changing anything! ;-)
yeah, the current impl is a violation of the contract of NSDictionary, which says you should only have to override count, objectForKey, keysNoCopy, and objectsNoCopy (removeAllObjects, removeObjectForKey, setObjectForKey) in a subclass. i'll commit this fix. crap .. now i have to decide which branch i'm going to make my trunk.

ms
 _______________________________________________
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: 
 >NSDictionary.isEmpty (From: ISHIMOTO Ken <email@hidden>)
 >Re: NSDictionary.isEmpty (From: Mark Ritchie <email@hidden>)

  • Prev by Date: Re: NSDictionary.isEmpty
  • Next by Date: Re: NSDictionary.isEmpty
  • Previous by thread: Re: NSDictionary.isEmpty
  • Next by thread: Re: NSDictionary.isEmpty
  • Index(es):
    • Date
    • Thread