javac emits duplicate entries in the constant pool and PermittedSubclasses attribute for the following example.
I don't think the JVMS disallows this, but the duplication is surprising to me and looks accidental.
This only reproduces with -Xdoclint:html,syntax
public class T {
private enum E {
INSTANCE {
/** foo {@link E} */
void f() {}
};
void f() {}
}
}
javac -fullversion
javac full version "25-ea+8-843"
javac -Xdoclint:html,syntax T.java && javap -v -p 'T$E'
...
PermittedSubclasses:
T$E$1
T$E$1
InnerClasses:
private static #52= #1 of #47; // E=class T$E of class T
final #26; // class T$E$1
final #50; // class T$E$1
I don't think the JVMS disallows this, but the duplication is surprising to me and looks accidental.
This only reproduces with -Xdoclint:html,syntax
public class T {
private enum E {
INSTANCE {
/** foo {@link E} */
void f() {}
};
void f() {}
}
}
javac -fullversion
javac full version "25-ea+8-843"
javac -Xdoclint:html,syntax T.java && javap -v -p 'T$E'
...
PermittedSubclasses:
T$E$1
T$E$1
InnerClasses:
private static #52= #1 of #47; // E=class T$E of class T
final #26; // class T$E$1
final #50; // class T$E$1
- links to
-
Commit(master) openjdk/jdk/bd9b24c0
-
Review(master) openjdk/jdk/23507