Community
Participate
Working Groups
Build Identifier: 20120216-1857 The Eclipse IDE fails to compile the following test class, which compiles correctly from the command line with javac. I am using a recent Oracle Java version for both the IDE and command line: java version "1.7.0_01" Java(TM) SE Runtime Environment (build 1.7.0_01-b08) Java HotSpot(TM) 64-Bit Server VM (build 21.1-b02, mixed mode) The IDE gives me the following error message: "The method insert(String, long[]) is ambiguous for the type X" Here is the test class. By substituting the various types for foo in the method call you will get similar errors. None of these errors occur when compiling from the command line in a shell. I have had to resort to poor workarounds to circumvent this error in my real codes (e.g., using "new long[] {foo_l}" in place of foo_l in the method call). Thanks for any help you can provide. Test class: public class X { public void insert(String name, long... values) {} public void insert(String name, int... values) {} public void insert(String name, double... values) {} public void insert(String name, float... values) {} static void main() { X x = new X(); long foo_l = 0; int foo_i = 0; double foo_d = 0d; float foo_f = 0f; x.insert("foo", foo_l); } } Reproducible: Always Steps to Reproduce: 1.Create a Java project 2.Create a new class X in the project using the code included in the error description. 3. IDE will show an error.
Same as bug 346038 *** This bug has been marked as a duplicate of bug 346038 ***
Verified for 3.8 RC2 with build I20120524-2100.