From 274940343d45c77a722cbeaeda6529e9a254662a Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Fri, 24 May 2019 22:13:53 +0200 Subject: [PATCH] ignore annotations for methods --- .../jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 5c007fc892..f9bca2fb93 100644 --- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -510,7 +510,7 @@ public Parameter[] getParameters() { @Override public Annotation[][] getParameterAnnotations() { - if ((getConstMethodFlags() & config().constMethodHasParameterAnnotations) == 0) { + if ((getConstMethodFlags() & config().constMethodHasParameterAnnotations) == 0 || isClassInitializer()) { return new Annotation[signature.getParameterCount(false)][0]; } return runtime().reflection.getParameterAnnotations(this); @@ -518,7 +518,7 @@ public Annotation[][] getParameterAnnotations() { @Override public Annotation[] getAnnotations() { - if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0) { + if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0 || isClassInitializer()) { return new Annotation[0]; } return runtime().reflection.getMethodAnnotations(this); @@ -526,7 +526,7 @@ public Annotation[] getAnnotations() { @Override public Annotation[] getDeclaredAnnotations() { - if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0) { + if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0 || isClassInitializer()) { return new Annotation[0]; } return runtime().reflection.getMethodDeclaredAnnotations(this); @@ -534,7 +534,7 @@ public Annotation[] getDeclaredAnnotations() { @Override public T getAnnotation(Class annotationClass) { - if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0) { + if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0 || isClassInitializer()) { return null; } return runtime().reflection.getMethodAnnotation(this, annotationClass);