allow duplicate in AnnotationUtils.findAnnotations result

See also WW-4912
This commit is contained in:
Yasser Zamani
2018-01-30 12:21:33 +03:30
parent cf71e0f34f
commit 8d4194bbf7
2 changed files with 3 additions and 3 deletions
@@ -177,12 +177,12 @@ public class AnnotationUtils {
classes.addAll(ClassUtils.getAllInterfaces(clazz));
for (Class<?> aClass : classes) {
T ann = aClass.getAnnotation(annotationClass);
if (ann != null && !anns.contains(ann)) {
if (ann != null) {
anns.add(ann);
}
ann = aClass.getPackage().getAnnotation(annotationClass);
if (ann != null && !anns.contains(ann)) {
if (ann != null) {
anns.add(ann);
}
}
@@ -58,7 +58,7 @@ public class AnnotationUtilsTest extends TestCase {
assertThat(annotations)
.isNotNull()
.isNotEmpty()
.hasSize(4);
.hasSize(5);
Set<String> values = new HashSet<>();
for (MyAnnotation annotation : annotations) {