• 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: Generics in WO - Writing accessors for to-many relationship?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Generics in WO - Writing accessors for to-many relationship?


  • Subject: Re: Generics in WO - Writing accessors for to-many relationship?
  • From: "Mr. Pierre Frisch" <email@hidden>
  • Date: Fri, 2 Nov 2007 09:38:05 -0700

Actually it is. NSArray has the right method in 5.4:

@SuppressWarnings( { "unchecked", "cast" })
public static final <T> NSArray<T> emptyArray() {
return (NSArray<T>) EmptyArray;
}

Pierre
--
Pierre Frisch
email@hidden


On Nov 1, 2007, at 14:20, Mike Schrag wrote:

4) I don't believe NSArray.EmptyArray is genericized properly (I'm not sure it is in Project Wonder, either).  The proper definition should be:

 @SuppressWarnings("unchecked")
 public static <T> NSArray<T> emptyArray() {
   return NSArray.EmptyArray;
 }

at which point you would use:

NSArray<String> emptyStringArray = NSArray.<String>emptyArray();

In the absence of that definition, you will need to cast (and add a warning ignore).

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Generics in WO - Writing accessors for to-many relationship?
      • From: Mike Schrag <email@hidden>
References: 
 >Generics in WO - Writing accessors for to-many relationship? (From: Ricardo Parada <email@hidden>)
 >Re: Generics in WO - Writing accessors for to-many relationship? (From: "John Huss" <email@hidden>)
 >Re: Generics in WO - Writing accessors for to-many relationship? (From: Ricardo Parada <email@hidden>)
 >Re: Generics in WO - Writing accessors for to-many relationship? (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: What a bunch of characters
  • Next by Date: Re: Generics in WO - Writing accessors for to-many relationship?
  • Previous by thread: Re: Generics in WO - Writing accessors for to-many relationship?
  • Next by thread: Re: Generics in WO - Writing accessors for to-many relationship?
  • Index(es):
    • Date
    • Thread