mirror of
https://github.com/apache/struts.git
synced 2026-08-11 01:27:14 +00:00
allow duplicate in AnnotationUtils.findAnnotations result
See also WW-4912
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user