Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Joel Klein
Steve Loughran wrote: 1. I dont like all the extra typing you need everywhere; it makes things more verbose. What is wrong with polymorphic type inference? I'd like to know the story on type inference for Java too, though it is probably more a question for the Types mailing list (http://lists.s

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Steve Loughran
Chavdar Botev wrote: Peter Reilly wrote: The original code may be slightly incorrect (my understanding of java generics is not high). Ha-ha. I think the original code cannot be slightly incorrect. It is either correct or incorrect. ;) It certainly possible that my understanding of Java generics

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Chavdar Botev
TWIMC, I know I am a bit into the gray cross-posting area but here is the thread I started on the Java Forums: http://forum.java.sun.com/thread.jspa?threadID=778203. Chavdar - To unsubscribe, e-mail: [EMAIL PROTECTED] For addi

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Scot P. Floess
Ha-ha. I think the original code cannot be slightly incorrect. It is either correct or incorrect. ;) It certainly possible that my understanding of Java generics is wrong. I come from a C++ templates background and although syntactically similar, Java generics and C++ templates seem to be very d

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread James Abley
Chavdar Botev wrote: Peter Reilly wrote: The original code may be slightly incorrect (my understanding of java generics is not high). Ha-ha. I think the original code cannot be slightly incorrect. It is either correct or incorrect. ;) It certainly possible that my understanding of Java generics

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Chavdar Botev
Peter Reilly wrote: The original code may be slightly incorrect (my understanding of java generics is not high). Ha-ha. I think the original code cannot be slightly incorrect. It is either correct or incorrect. ;) It certainly possible that my understanding of Java generics is wrong. I come from

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Scot P. Floess
And, regarding generics...as for value - wow...how many heterogenous collections did we ever really use in pre 1.5 code? Most of my collections always contained homogeneous data. So, having generics now certainly improves readability (yes I know, under the covers it does the casts for me)...

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Scot P. Floess
Sorry let me clarify... The comment was "The original code may be slightly incorrect (my understanding of java generics is not high)." And the response was "Me too. I don't like STL!" I do realize STL is built using generics.The Standard Template Library defines templates...but STL in and

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread James Abley
Scot P. Floess wrote: What do generics have to do with STL? You're joking, right? Have you used the STL much? Generics are very very handy :) Maybe. I live in a world where the majority of my code has to work on pre-Java 5, and for code where I can use Java 5 features, generics don't seem

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Scot P. Floess
What do generics have to do with STL? Generics are very very handy :) James Abley wrote: Peter Reilly wrote: The original code may be slightly incorrect (my understanding of java generics is not high). Me too. I don't like STL! James

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Scot P. Floess
Peter: Point well taken. The problem here, I think, is that the inner class has access to everything defined in the outer class (this includes the declaration of the generic). Of course, javac comes in and does some creative compiling to make that possible. Personally, I strive very hard t

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread James Abley
Peter Reilly wrote: The original code may be slightly incorrect (my understanding of java generics is not high). Me too. I don't like STL! James - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Peter Reilly
The original code may be slightly incorrect (my understanding of java generics is not high). Test1.java is defined as: public class Test1 { public class Inner1 { protected T v; public Inner1(T v) {this.v = v;} public T getV() {return this.v;}

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Scot P. Floess
Actually, I think the real problem isn't generics but an inner class that using a generic specified by the outer class. I bet this problem goes away if all the classes were defined as outer classes. Steve Loughran wrote: Scot P. Floess wrote: Steve: My apologies...my mouth is now stretched

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Steve Loughran
Scot P. Floess wrote: Steve: My apologies...my mouth is now stretched from the placement of my foot in my mouth ;) When I tried this, I didn't specify -classpath to command line javac. I see now by doing so it does, in fact, break as mentioned. Yeah, I agree (now) that it is a bug :) Or

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Scot P. Floess
Steve: My apologies...my mouth is now stretched from the placement of my foot in my mouth ;) When I tried this, I didn't specify -classpath to command line javac. I see now by doing so it does, in fact, break as mentioned. Yeah, I agree (now) that it is a bug :) Scot Steve Loughran wrote

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Steve Loughran
Scot P. Floess wrote: How is this a java generics bug? I specifically was able to compile just Test3.java using command line javac... So its not javac nor is it a generics problem. we can replicate it on the command line, just by adding the .class file to the classpath. That's why its a co

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Scot P. Floess
How is this a java generics bug? I specifically was able to compile just Test3.java using command line javac... So its not javac nor is it a generics problem. It is probably needed for incremental builds in which all source files are not in the source tree you specify, such as when you have

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Peter Reilly
On 10/18/06, Steve Loughran <[EMAIL PROTECTED]> wrote: Peter Reilly wrote: > On 10/17/06, Chavdar Botev <[EMAIL PROTECTED]> wrote: >> Peter, >> >> I repeated the steps you described and I can confirm that with the >> -classpath argument the compilation fails and without it the >> compilation succ

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Antoine Levy-Lambert
Steve Loughran wrote: > Peter Reilly wrote: >> On 10/17/06, Chavdar Botev <[EMAIL PROTECTED]> wrote: >>> Peter, >>> >>> I repeated the steps you described and I can confirm that with the >>> -classpath argument the compilation fails and without it the >>> compilation succeeds. I also tried running

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Steve Loughran
Peter Reilly wrote: On 10/17/06, Chavdar Botev <[EMAIL PROTECTED]> wrote: Peter, I repeated the steps you described and I can confirm that with the -classpath argument the compilation fails and without it the compilation succeeds. I also tried running javac on "src/test/*.java" instead of "src/

Re: AW: a problem compiling a Java 5 project with generics

2006-10-18 Thread Steve Loughran
Matt Benson wrote: --- Peter Reilly <[EMAIL PROTECTED]> wrote: [SNIP] I have just checked the revision history, since the initial checkin (6 years, 9 months), has always added the destination path to the classpath for the javac command. It does not seem to be necessary? but I do not know if w

Re: AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread Matt Benson
Cygwin) > > > > > >> > > > > > >>> ant -v > > > > > >> Project base dir set to: > C:\tmp\ant-generics > > > > > >> [javac] build.xml skipped - don't > know how to handle it > > > > > &

Re: AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread Peter Reilly
don't know how to > > > >> handle it > > > >> [javac] test\Test3.class skipped - don't know how to handle it > > > >> [javac] test\Test3.java added as test/Test3.class is outdated. > > > >> [javac] Compiling 1 source file

Re: AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread Chavdar Botev
mitted as test/Test1.class is up to date. > > >> [javac] test\Test2$Inner2.class skipped - don't know how to > > >> handle it > > >> [javac] test\Test2.class skipped - don't know how to handle it > > >> [javac] test\Test2.java om

Re: AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread Chavdar Botev
lass skipped - don't know how to > >> handle it > >> [javac] test\Test3.class skipped - don't know how to handle it > >> [javac] test\Test3.java added as test/Test3.class is outdated. > >> [javac] Compiling 1 source file to C:\tmp\ant-generics

Re: AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread Peter Reilly
ation arguments: >> [javac] '-d' >> [javac] 'C:\tmp\ant-generics' >> [javac] '-classpath' >> [javac] ' LOT-OF-LIBS-FROM-ANT ' >> [javac] '-sourcepath' >> [javac] 'C:\tmp\ant-generics

Re: AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread Scot P. Floess
command. [javac] File to be compiled: [javac] C:\tmp\ant-generics\test\Test3.java BUILD SUCCESSFUL build.xml: Jan -Ursprüngliche Nachricht- Von: Peter Reilly [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 17. Oktober 2006 16:44 An: Ant Users List

Re: AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread James Abley
generics' [javac] '-g:none' [javac] [javac] The ' characters around the executable and arguments are [javac] not part of the command. [javac] File to be compiled: [javac] C:\tmp\ant-generics\test\Test3.java BUILD SUCCESSFUL build.xml:

Re: a problem compiling a Java 5 project with generics

2006-10-17 Thread Scot P. Floess
mented line). This works by itself, but touch Test3.java and run again. Peter Jan >-Ursprüngliche Nachricht- >Von: Peter Reilly [mailto:[EMAIL PROTECTED] >Gesendet: Dienstag, 17. Oktober 2006 11:39 >An: Ant Users List >Betreff: Re: a problem compiling a Ja

AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread Jan.Materne
piled: [javac] C:\tmp\ant-generics\test\Test3.java BUILD SUCCESSFUL build.xml: Jan >-Ursprüngliche Nachricht- >Von: Peter Reilly [mailto:[EMAIL PROTECTED] >Gesendet: Dienstag, 17. Oktober 2006 16:44 >An: Ant Users List >Betreff: Re: a problem compilin

Re: a problem compiling a Java 5 project with generics

2006-10-17 Thread Peter Reilly
>Von: Peter Reilly [mailto:[EMAIL PROTECTED] >Gesendet: Dienstag, 17. Oktober 2006 11:39 >An: Ant Users List >Betreff: Re: a problem compiling a Java 5 project with generics > >Can you enter a bugzilla report about this. >It is very strange. > >I tried on the commandl

AW: a problem compiling a Java 5 project with generics

2006-10-17 Thread Jan.Materne
: Re: a problem compiling a Java 5 project with generics > >Can you enter a bugzilla report about this. >It is very strange. > >I tried on the commandline: > >javac -target 1.5 -g -source 1.5 -sourcepath src -d >build\classes src\org\test\Test3.java > >which works f

Re: a problem compiling a Java 5 project with generics

2006-10-17 Thread Peter Reilly
Can you enter a bugzilla report about this. It is very strange. I tried on the commandline: javac -target 1.5 -g -source 1.5 -sourcepath src -d build\classes src\org\test\Test3.java which works fine - and looks very like the command used by ant. Peter On 10/17/06, Chavdar Botev <[EMAIL PROT

Re: a problem compiling a Java 5 project with generics

2006-10-17 Thread Chavdar Botev
Hi For some reason, the mailing server included only the first attachment. Since this is the fourth or the fifth time I am trying to send the java files, I give up. I'll inline them in the message. // src/test/Base.java package test; public class Base {} // src/test/Sub.java package test; publ

Re: a problem compiling a Java 5 project with generics

2006-10-16 Thread Petar Tahchiev
On 17/10/06, Chavdar Botev <[EMAIL PROTECTED]> wrote: Hi! I've come accross the following problem trying to compile Java 5 classes with generics using Ant 1.6.5. I've attached project with sample Java classes and a build.xml file. NOTE: Please create a src/test subdirectory and save the attach

a problem compiling a Java 5 project with generics

2006-10-16 Thread Chavdar Botev
Hi! I've come accross the following problem trying to compile Java 5 classes with generics using Ant 1.6.5. I've attached project with sample Java classes and a build.xml file. NOTE: Please create a src/test subdirectory and save the attached .java files into it. The mailing list server gave me