diff src/share/vm/runtime/fieldDescriptor.cpp @ 7457:35431a769282

8004823: Add VM support for type annotation reflection Reviewed-by: dholmes, coleenp Contributed-by: joel.franck@oracle.com
author stefank
date Thu, 20 Dec 2012 10:22:19 +0100
parents 18fb7da42534
children 927a311d00f9
line wrap: on
line diff
--- a/src/share/vm/runtime/fieldDescriptor.cpp	Wed Dec 19 10:35:08 2012 -0800
+++ b/src/share/vm/runtime/fieldDescriptor.cpp	Thu Dec 20 10:22:19 2012 +0100
@@ -65,6 +65,17 @@
   return md->at(index());
 }
 
+AnnotationArray* fieldDescriptor::type_annotations() const {
+  InstanceKlass* ik = field_holder();
+  Annotations* type_annos = ik->type_annotations();
+  if (type_annos == NULL)
+    return NULL;
+  Array<AnnotationArray*>* md = type_annos->fields_annotations();
+  if (md == NULL)
+    return NULL;
+  return md->at(index());
+}
+
 constantTag fieldDescriptor::initial_value_tag() const {
   return constants()->tag_at(initial_value_index());
 }