-
Bug
-
Resolution: Fixed
-
P2
-
6
-
b87
-
generic
-
generic
java.lang.reflect.{Constructor,Field,Method} objects are created with
annotations data embedded in the object instead of using a JVM entry
point to fetch the current annotations like java.lang.Class. This is
effectively a cache of the annotations data since RedefineClasses()
does not change the annotations data in place. RedefineClasses() attaches
new annotations data to the class when it is redefined.
New JVM entry points similar to JVM_GetClassAnnotations() need to be
added to the VM, then java.lang.reflect.{Constructor,Field,Method} will
need to be modified to use those entry points (see 6422536). The counter
field added by 6407335 (java.lang.Class.classRedefinedCount) should be used
to determine when the Constructor,Field,Method} annotations data needs to
be refetched.
Constructor - needs JVM_GetMethodAnnotations() and
JVM_GetMethodParameterAnnotations();
does not need JVM_GetMethodDefaultAnnotations()
Field - needs JVM_GetFieldAnnotations()
Method - needs JVM_GetMethodAnnotations(),
JVM_GetMethodDefaultAnnotations, and
JVM_GetMethodParameterAnnotations()
From the VM's point of view, constructors are methods so we should be able
to use the same entry points.
JVM_GetMethodDefaultAnnotations isn't a good choice of method name.
It doesn't return annotations at all, but rather a single annotation element value.
How about JVM_GetMethodDefaultAnnotationValue ?
annotations data embedded in the object instead of using a JVM entry
point to fetch the current annotations like java.lang.Class. This is
effectively a cache of the annotations data since RedefineClasses()
does not change the annotations data in place. RedefineClasses() attaches
new annotations data to the class when it is redefined.
New JVM entry points similar to JVM_GetClassAnnotations() need to be
added to the VM, then java.lang.reflect.{Constructor,Field,Method} will
need to be modified to use those entry points (see 6422536). The counter
field added by 6407335 (java.lang.Class.classRedefinedCount) should be used
to determine when the Constructor,Field,Method} annotations data needs to
be refetched.
Constructor - needs JVM_GetMethodAnnotations() and
JVM_GetMethodParameterAnnotations();
does not need JVM_GetMethodDefaultAnnotations()
Field - needs JVM_GetFieldAnnotations()
Method - needs JVM_GetMethodAnnotations(),
JVM_GetMethodDefaultAnnotations, and
JVM_GetMethodParameterAnnotations()
From the VM's point of view, constructors are methods so we should be able
to use the same entry points.
JVM_GetMethodDefaultAnnotations isn't a good choice of method name.
It doesn't return annotations at all, but rather a single annotation element value.
How about JVM_GetMethodDefaultAnnotationValue ?
- relates to
-
JDK-8009382 Add JVM_Get{Field|Method}TypeAnnotations
- Resolved
-
JDK-5002251 potential bug with annotations and class file evolution
- Resolved
-
JDK-6422536 (ann) {Constructor,Field,Method}.getAnnotation() cache conflicts with RedefineClasses()
- Open
-
JDK-6412391 fix for annotation cache and RedefineClasses() conflict needs HotSpot changes
- Resolved
-
JDK-6407335 (ann) java.lang.Class.getAnnotation() cache conflicts with RedefineClasses()
- Resolved
-
JDK-8057043 Type annotations not retained during class redefine / retransform
- Resolved
(1 relates to)