Just as a curiosity, I remember 1 - 1.5 yrs ago when I was somewhat active 
on this list, it was a big deal when ant finally decided to drop support 
for running ant under java 1.1 and allow use of Collections & other 1.2 
stuff in the code base. Did you guys move to 1.4 when I wasn't watching 
(the last year or so)?

Gus

Patrick G. Heck
Cambridge Systematics, Inc.
100 CambridgePark Drive, Suite 400
Cambridge, MA 02140
tel  617 354 0167
fax  617 354 1542
e-mail  [EMAIL PROTECTED]
www.camsys.com



Steve Loughran <[EMAIL PROTECTED]> 
04/21/2005 08:01 AM
Please respond to
"Ant Developers List" <[EMAIL PROTECTED]>


To
Ant Developers List <[EMAIL PROTECTED]>
cc

Subject
java.lang.Iterable






Peter Reilly wrote:
> [EMAIL PROTECTED] wrote:
> 
>> I had a project where a code generator inserts one interface statement 
>> - and that
>> what missing. So I created just an empty interface to make the 
>> compiler happy. Couldnt
>> we "backport" the Iterable interface?
>>
>> I played a little with these...
>> - build.xml
>> - src\oata\Iterable.java
>> - src\oata\MyClass.java
>>
>>
> Nice, but not useful in ant core (kernel) until we move to using
> java 1.5+ as we would not be able to use java 1.5+ to create
> an ant distribution that can be used for java 1.4 and previous.
> 

How about (in a java15 package), we have a class that uses reflection to 
look for the iterator() operator


Class IterateOver implements Iterable {

Object instance;

IterateOver(instance) {this.instance=instance}

public Iterator iterator() {
                 Class clazz=instance.getClass();
                 Method method=clazz.getMethod("iterator");
                 return method.invoke(instance);
}

}

you could then do (for e:new IterateOver(something));

not ideal, I admit. Oh, there is all that generic typing stuff too. sigh.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to