• 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: Does WebObjects use Java 1.5?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does WebObjects use Java 1.5?


  • Subject: Re: Does WebObjects use Java 1.5?
  • From: David Avendasora <email@hidden>
  • Date: Fri, 23 Mar 2007 07:52:54 -0500

I have been using this for-loop structure in an app I'm currently developing and it seems to work very well, and I haven't even needed the .toArray() call at the end. Now, I'm not a WO expert so I can't promise you that it will work in your specific circumstances.

This is an example of how I use it and cast the generic objects:

for (Object aRoutingObject : this.routings()) {
Routing aRouting = (Routing)aRoutingObject;
/* Stuff I want to do with each member (aRouting) of the routings() to-many relationship
...
...
*/
}



On Mar 22, 2007, at 11:34 AM, Francis Labrie wrote:

It seems faults are fired on toArray(), objects() and mutableClone () NSArray interface calls. So preliminary tests seems to allow Java 5 enhanced for loop usage like this:

for(Object object : object.toManyRelationship().toArray()) {
	...
}

Unfortunately, WebObjects classes dont use generics, so you still have to type cast objects. :-(

Can someone confirms that using Java 5 enhanced loop in that way is safe?

_______________________________________________ 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: Does WebObjects use Java 1.5?
      • From: Francis Labrie <email@hidden>
References: 
 >Does WebObjects use Java 1.5? (From: Christian Telepski <email@hidden>)
 >Re: Does WebObjects use Java 1.5? (From: Ian Joyner <email@hidden>)
 >Re: Does WebObjects use Java 1.5? (From: Francis Labrie <email@hidden>)

  • Prev by Date: Re: Database Context Locking
  • Next by Date: Re: Does WebObjects use Java 1.5?
  • Previous by thread: Re: Does WebObjects use Java 1.5?
  • Next by thread: Re: Does WebObjects use Java 1.5?
  • Index(es):
    • Date
    • Thread