Community
Participate
Working Groups
Build Identifier: I20110127-2034 The following code compiles but should not: public class Foo { public static void main(String[] args) { method("str"); method("str", 1); method("str", 1, "data"); } public static void method(String str, int num, Object... data) { // do nothing } public static void method(String str, Object... data) { // do nothing } } see http://mail.openjdk.java.net/pipermail/compiler-dev/2011-June/003320.html for a discussion on the javac compiler list. Note that javac 6 exhibits the same bug but it was fixed in javac 7. Reproducible: Always Steps to Reproduce: 1. type the Foo.class in Eclipse editor it should report two errors.
Reproduced using latest. Srikanth, please investigate. Tagging as 3.7.1. Will reassess based on the fix.
Tagging as 1.7 since this is a change brought about by javac 7, and all javac 7 fixes have been fixed in BETA_JAVA7.
See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7042566 and http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7044388. Apparently, this fix is causing some non trivial amount of code to not compile anymore, since this seems to have bubbled up very quickly from more than one source.
Targetting 3.8, since this is not a regression in 3.7, eclipse and javac behavior has always matched up until 7b143.
The code in comment#0 compiles on 3.8 stream as of 21 Nov 2011. I'll check on the regressions referred to in comment#3 and close this defect as appropriate.
The regressions mentioned in comment#3 are javac specific. Eclipse 3.8 stream top of branch behavior as of today matches JDK7b147. Closing as WORKSFORME. (This issue most likely got fixed along with either of bug 346038 or bug 346039).
Verified for 3.8M4 with build I20111204-2000.