JDK-5088429 : varargs overloading problem
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0
  • Priority: P5
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-08-18
  • Updated: 2010-12-21
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b123Fixed
Related Reports
Relates :  
Relates :  
Description
This program should compile.

// Tim Hanson <###@###.###>
class Test implements IClass{

    Test(IClass c, Test t, IType... args) {}
    Test(IClass c, IType... args) {}

    public static void main(String args[]) {
        IClass c = null;
        Test t = null;

        Test t2 = new Test(c, t);
    }

}

interface IType{}
interface IClass extends IType{}

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/build/langtools/rev/536ee9f126b1
25-12-2010

SUGGESTED FIX A webrev of this fix is available at the following URL: http://hg.openjdk.java.net/jdk7/tl/langtools/rev/536ee9f126b1
06-12-2010

EVALUATION Interesting corner case: class Test { interface A {} interface B extends A {} Test(A... args) {} Test(A a, A... args) {} void test(B b) { new Test(b); } } What should we do with it? JLS seem to be for giving ambiguity here, but I think there's evidence that the second signature is most specific as it requires at least one mandatory argument.
23-11-2010

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
19-08-2004

EVALUATION Not for Tiger. ###@###.### 2004-08-17
17-08-2004