Re: Does WebObjects use Java 1.5?
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