Summary: | [1.5][compiler] javac reports error messages where Eclipse compiles fine -- cannot be applied to | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Hendrik Maryns <hendrik> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | RESOLVED DUPLICATE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | daniel_megert, michael.f.obrien |
Version: | 3.2 | ||
Target Milestone: | 3.3 M3 | ||
Hardware: | PC | ||
OS: | Linux | ||
Whiteboard: |
Description
Hendrik Maryns
2006-09-25 04:43:11 EDT
Forgot to add: javac -version javac 1.5.0_07 I just noticed a very strange thing: in the original, more complex source, I got a ‘symbol not found’ error: /home/hendrik/workspace/Jakarta/org/apache/commons/collections/ClosureUtils.java:196: cannot find symbol symbol : method getInstance(org.apache.commons.collections.Closure<capture of ? super I>,org.apache.commons.collections.Closure<capture of ? super I>) location: class org.apache.commons.collections.functors.ChainedClosure return ChainedClosure.getInstance(closure1, closure2); ^ After trimming down all unnecessary methods and classes, the error changed to the ‘cannot be applied to’ error above. I believe this is a javac bug. Observe that inference performs correclty with javac 1.6 if eliminating type parameters from invocation site, e.g. class ClosureUtils { public static Closure<String> chainedClosure(Closure<? super String> closure1, Closure<? super String> closure2) { return ChainedClosure.getInstance(closure1, closure2); } } Though in essence inferring using type variable I or type String should behave in a similar way (either all right or all wrong). In this case, Eclipse does the right thing. I think it is also related to the known javac bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954 Thus this is a dup of bug 98379 (different scenario, but same cause: inference based on type parameter arguments). Added GenericTypeTest#test1034 *** This bug has been marked as a duplicate of 98379 *** >Verified reproduced in JDK 1.6.0_21 >Verified fixed in JDK 1.6.0_22 (and 1.6.0_27) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6302954 > A more systematic test on each release reveals
1.6.0_22 = broken (bug with same exception says fixed)
1.6.0_23 = broken
1.6.0_24 = broken
1.6.0_25 = OK
1.6.0_26 = OK
1.6.0_27 = OK
|