-
Bug
-
Resolution: Won't Fix
-
P4
-
None
-
1.2.1
-
generic
-
generic
Name: et89391 Date: 08/04/99
If you write could that has one class invoking a private
constructor in another class, and this access should be legal
because one class is declared in the other or they are both
enclosed by another, javac generates a synthetic inner class
to make this work.
For example, when compiling the following code:
public class PrivateConstructor {
private PrivateConstructor() {}
static class A {
PrivateConstructor f() {
return new PrivateConstructor();
}
}
}
javac generates the class PrivateConstructor$1. However, the
generated innerclass attribute for PrivateConstructor$1 is:
static PrivateConstructor$1( [index = 0], "1")
My understanding of the Java Inner class specification is that
the inner_name_index for this attribute should be 0, both
because PrivateConstructor$1 is a (synthetic) anonymous class
and because "1" is not a valid Java identifier.
(Review ID: 56521)
======================================================================