Skip to content

Commit

Permalink
a little better AnnotationUtils
Browse files Browse the repository at this point in the history
  • Loading branch information
P3ridot committed Jul 18, 2023
1 parent 0ad197b commit 8fed063
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ public static <A extends Annotation> A instanceAnnotation(Class<A> annotationCla
}

if (method.getName().equals("hashCode")) {
return 0;
return annotationClass.hashCode() * 127;
}

if (method.getName().equals("equals")) {
return proxy == args[0];
return args[0] instanceof Annotation && annotationClass.equals(((Annotation) args[0]).annotationType());
}

throw new UnsupportedOperationException("Unsupported method: " + method);
Expand Down

0 comments on commit 8fed063

Please sign in to comment.