Skip to content
Permalink
Browse files
dropping reflection hacks in AnnotationFinder
  • Loading branch information
rmannibucau committed Nov 28, 2018
1 parent 924328a commit fbdc3a83f137376ded949288d36dd2404f23fc08
Showing 2 changed files with 2 additions and 5 deletions.
@@ -78,8 +78,7 @@ public <T extends Annotation> T findAnnotation(final Class<T> type, final Annota
}

private <T extends Annotation> T getFromDirectClass(final Class<T> type, final AnnotatedType<?> declaringClass) {
// TODO: align on CDI is the spec does - TCK rule
final T annotation = declaringClass.getJavaClass().getDeclaredAnnotation(type);
final T annotation = declaringClass.getAnnotation(type);
if (annotation != null) {
return annotation;
}
@@ -95,8 +94,7 @@ private Optional<AnnotatedMethod<?>> getParentMethod(final AnnotatedType<?> decl

private <T extends Annotation> T getMethodAnnotation(final Class<T> type, final Optional<AnnotatedMethod<?>> classMethod) {
if (classMethod.isPresent()) {
// TODO: align on CDI is the spec does - TCK rule
final T annotation = classMethod.orElseThrow(IllegalArgumentException::new).getJavaMember().getDeclaredAnnotation(type);
final T annotation = classMethod.orElseThrow(IllegalArgumentException::new).getAnnotation(type);
if (annotation != null) {
return annotation;
}
@@ -27,4 +27,3 @@
-->
</test>
</suite>

0 comments on commit fbdc3a8

Please sign in to comment.