8004699: Add type annotation storage to Constructor, Field and Method
authordarcy
Tue, 18 Dec 2012 14:49:39 -0800
changeset 14905 ca1bf7f03ffb
parent 14904 6d9721836463
child 14906 41967e1d81c7
8004699: Add type annotation storage to Constructor, Field and Method Reviewed-by: darcy, dholmes Contributed-by: joel.franck@oracle.com
jdk/src/share/classes/java/lang/reflect/Constructor.java
jdk/src/share/classes/java/lang/reflect/Field.java
jdk/src/share/classes/java/lang/reflect/Method.java
--- a/jdk/src/share/classes/java/lang/reflect/Constructor.java	Tue Dec 18 14:44:13 2012 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Constructor.java	Tue Dec 18 14:49:39 2012 -0800
@@ -66,6 +66,8 @@
     private transient ConstructorRepository genericInfo;
     private byte[]              annotations;
     private byte[]              parameterAnnotations;
+    // This is set by the vm at Constructor creation
+    private byte[]              typeAnnotations;
 
     // Generics infrastructure
     // Accessor for factory
@@ -138,6 +140,8 @@
         res.root = this;
         // Might as well eagerly propagate this if already present
         res.constructorAccessor = constructorAccessor;
+
+        res.typeAnnotations = typeAnnotations;
         return res;
     }
 
--- a/jdk/src/share/classes/java/lang/reflect/Field.java	Tue Dec 18 14:44:13 2012 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Field.java	Tue Dec 18 14:49:39 2012 -0800
@@ -80,6 +80,8 @@
     // currently only two levels deep (i.e., one root Field and
     // potentially many Field objects pointing to it.)
     private Field               root;
+    // This is set by the vm at Field creation
+    private byte[]              typeAnnotations;
 
     // Generics infrastructure
 
@@ -144,6 +146,8 @@
         // Might as well eagerly propagate this if already present
         res.fieldAccessor = fieldAccessor;
         res.overrideFieldAccessor = overrideFieldAccessor;
+
+        res.typeAnnotations = typeAnnotations;
         return res;
     }
 
--- a/jdk/src/share/classes/java/lang/reflect/Method.java	Tue Dec 18 14:44:13 2012 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Method.java	Tue Dec 18 14:49:39 2012 -0800
@@ -79,7 +79,8 @@
     // currently only two levels deep (i.e., one root Method and
     // potentially many Method objects pointing to it.)
     private Method              root;
-
+    // This is set by the vm at Method creation
+    private byte[]              typeAnnotations;
 
     // Generics infrastructure
     private String getGenericSignature() {return signature;}
@@ -150,6 +151,8 @@
         res.root = this;
         // Might as well eagerly propagate this if already present
         res.methodAccessor = methodAccessor;
+
+        res.typeAnnotations = typeAnnotations;
         return res;
     }