Skip to content

Commit

Permalink
Use annotationType instead of getClass. Allows for Native image gener…
Browse files Browse the repository at this point in the history
…ation. (#134)
  • Loading branch information
cyrus13 authored Feb 23, 2021
1 parent 55a6096 commit aeb9469
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/si/mazi/rescu/AnnotationUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static <T extends Annotation> String getValueOrNull(Class<T> annotationClass, An
return null;
}
try {
return (String) ann.getClass().getMethod("value").invoke(ann);
return (String) ann.annotationType().getMethod("value").invoke(ann);
} catch (Exception e) {
throw new RuntimeException("Can't access element 'value' in " + annotationClass + ". This is probably a bug in rescu.", e);
}
Expand Down

0 comments on commit aeb9469

Please sign in to comment.