Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
ignore annotations for <clinit> methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dougxc committed May 24, 2019
1 parent 510bff1 commit 2749403
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -510,31 +510,31 @@ 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);
}

@Override
public Annotation[] getAnnotations() {
if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0) {
if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0 || isClassInitializer()) {
return new Annotation[0];
}
return runtime().reflection.getMethodAnnotations(this);
}

@Override
public Annotation[] getDeclaredAnnotations() {
if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0) {
if ((getConstMethodFlags() & config().constMethodHasMethodAnnotations) == 0 || isClassInitializer()) {
return new Annotation[0];
}
return runtime().reflection.getMethodDeclaredAnnotations(this);
}

@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);
Expand Down

0 comments on commit 2749403

Please sign in to comment.