src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java Tue Jun 04 11:55:51 2019 -0700
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java Tue Jun 04 12:44:53 2019 -0700
@@ -507,7 +507,7 @@
@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);
@@ -515,7 +515,7 @@
@Override
public Annotation[] getAnnotations() {
- if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0) {
+ if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0 || isClassInitializer()) {
return new Annotation[0];
}
return runtime().reflection.getMethodAnnotations(this);
@@ -523,7 +523,7 @@
@Override
public Annotation[] getDeclaredAnnotations() {
- if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0) {
+ if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0 || isClassInitializer()) {
return new Annotation[0];
}
return runtime().reflection.getMethodDeclaredAnnotations(this);
@@ -531,7 +531,7 @@
@Override
public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
- if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0) {
+ if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0 || isClassInitializer()) {
return null;
}
return runtime().reflection.getMethodAnnotation(this, annotationClass);