Java 1.5 and varargs - private access compilation problem
Hello,
I have been browsing web for a while but haven't found any solution of my problem (or any similar problem at all :( ).
Imagine following classes in "Experiment.java" file:
publicclass Experiment{
publicstaticvoid main(String[] args){
A a =new A();
}
}
class A{
public A(int... a){
}
private A(){
}
}
Having it in Eclipse, everything seems fine and Eclipse successfully runs this code. Javac is a different story. Trying to compile it using javac (also with arguments "-source 1.5 -target 1.5") ends in the following:
Experiment.java:4: A() has private access in A
A a = new A();
However, is this a problem in javac? Or is it just some Eclipse java compiler special feature? Regardless of the answer, I think that such code should not cause any 'signature competitions' and for me it is quite straightforward to safely call the public constructor in this case.
Thanks.

