-
Bug
-
Resolution: Fixed
-
P4
-
repo-valhalla
-
generic
-
generic
Follow up to JDK-8255856
(1) There is no need to persist the RestrictedType annotation in the class files or have them loaded at run time. Source file level retention is good enough.
(2) @RestrictedType annotating a field which was declared to be a
reference projection, results in a compilation error:
@RestrictedType("QPoint;")
public Point.ref p368;
$ javac PointBox.java
PointBox.java:12: error: scoping construct cannot be annotated with type-use annotation: @java.lang.invoke.RestrictedType("QPoint;")
public Point.ref p368;
(3) Frederic reports that independent compiles trigger an assertion error in:
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader$28.read(ClassReader.java:1273)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readAttrs(ClassReader.java:1408)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readMemberAttrs(ClassReader.java:1398)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readField(ClassReader.java:2242)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2595)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2674)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFileInternal(ClassReader.java:2714)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2678)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:362)
(4) The tests are better written avoiding javacp output since this makes them fragile to constant pool index changes.
(1) There is no need to persist the RestrictedType annotation in the class files or have them loaded at run time. Source file level retention is good enough.
(2) @RestrictedType annotating a field which was declared to be a
reference projection, results in a compilation error:
@RestrictedType("QPoint;")
public Point.ref p368;
$ javac PointBox.java
PointBox.java:12: error: scoping construct cannot be annotated with type-use annotation: @java.lang.invoke.RestrictedType("QPoint;")
public Point.ref p368;
(3) Frederic reports that independent compiles trigger an assertion error in:
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader$28.read(ClassReader.java:1273)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readAttrs(ClassReader.java:1408)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readMemberAttrs(ClassReader.java:1398)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readField(ClassReader.java:2242)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClass(ClassReader.java:2595)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassBuffer(ClassReader.java:2674)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFileInternal(ClassReader.java:2714)
at jdk.compiler/com.sun.tools.javac.jvm.ClassReader.readClassFile(ClassReader.java:2678)
at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:362)
(4) The tests are better written avoiding javacp output since this makes them fragile to constant pool index changes.
- relates to
-
JDK-8255856 [type-restrictions] Generate RestrictedField attributes from annotations
-
- Resolved
-