# HG changeset patch # User Christian Wimmer # Date 1410917819 25200 # Node ID ce1b6453c544ebce6044ae15c4985a53515d8c9e # Parent 7b3ece80080671e9d3533e94845a21be5c595efa Add ResolvedJavaMethod.getAnnotations diff -r 7b3ece800806 -r ce1b6453c544 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java Tue Sep 16 18:36:19 2014 -0700 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java Tue Sep 16 18:36:59 2014 -0700 @@ -141,6 +141,12 @@ ConstantPool getConstantPool(); /** + * Returns all annotations of this method. If no annotations are present, an array of length 0 + * is returned. + */ + Annotation[] getAnnotations(); + + /** * Returns the annotation for the specified type of this method, if such an annotation is * present. * diff -r 7b3ece800806 -r ce1b6453c544 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Tue Sep 16 18:36:19 2014 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Tue Sep 16 18:36:59 2014 -0700 @@ -461,6 +461,16 @@ } @Override + public Annotation[] getAnnotations() { + if (isConstructor()) { + Constructor javaConstructor = toJavaConstructor(); + return javaConstructor == null ? new Annotation[0] : javaConstructor.getAnnotations(); + } + Method javaMethod = toJava(); + return javaMethod == null ? new Annotation[0] : javaMethod.getAnnotations(); + } + + @Override public T getAnnotation(Class annotationClass) { if (isConstructor()) { Constructor javaConstructor = toJavaConstructor();