Annotations - Fix class annotation detection
findClosest/FarthestClass didn't support inherited annotations correctly.
This commit is contained in:
parent
722f071674
commit
4366b4198d
1 changed files with 2 additions and 2 deletions
|
@ -162,7 +162,7 @@ public final class Annotations
|
|||
{
|
||||
Class< ? super T > current = klass;
|
||||
while ( current != null ) {
|
||||
if ( current.isAnnotationPresent( annotation ) ) {
|
||||
if ( current.getDeclaredAnnotation( annotation ) != null ) {
|
||||
return current;
|
||||
}
|
||||
current = current.getSuperclass( );
|
||||
|
@ -189,7 +189,7 @@ public final class Annotations
|
|||
{
|
||||
Class< ? super T > found = null , current = klass;
|
||||
while ( current != null ) {
|
||||
if ( current.isAnnotationPresent( annotation ) ) {
|
||||
if ( current.getDeclaredAnnotation( annotation ) != null ) {
|
||||
found = current;
|
||||
}
|
||||
current = current.getSuperclass( );
|
||||
|
|
Loading…
Reference in a new issue