mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
Fixed flaky tests
This commit is contained in:
parent
20f0c720c4
commit
21f6554a05
@ -7,6 +7,7 @@ import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.AnnotatedElement;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.Map;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
@ -98,10 +99,12 @@ public class CombinationAnnotationElement implements AnnotatedElement, Serializa
|
||||
*/
|
||||
private void init(AnnotatedElement element) {
|
||||
final Annotation[] declaredAnnotations = element.getDeclaredAnnotations();
|
||||
Arrays.sort(declaredAnnotations, Comparator.comparing(Annotation::toString));
|
||||
this.declaredAnnotationMap = new TableMap<>();
|
||||
parseDeclared(declaredAnnotations);
|
||||
|
||||
final Annotation[] annotations = element.getAnnotations();
|
||||
Arrays.sort(annotations, Comparator.comparing(Annotation::toString));
|
||||
if (Arrays.equals(declaredAnnotations, annotations)) {
|
||||
this.annotationMap = this.declaredAnnotationMap;
|
||||
} else {
|
||||
|
@ -185,6 +185,7 @@ public abstract class AbstractTypeAnnotationScanner<T extends AbstractTypeAnnota
|
||||
scanInterfaceIfNecessary(nextClassQueue, targetClass);
|
||||
// 处理层级索引和注解
|
||||
final Annotation[] targetAnnotations = getAnnotationsFromTargetClass(annotatedEle, index, targetClass);
|
||||
Arrays.sort(targetAnnotations, Comparator.comparing(Annotation::toString).reversed());
|
||||
for (final Annotation annotation : targetAnnotations) {
|
||||
if (AnnotationUtil.isNotJdkMateAnnotation(annotation.annotationType()) && filter.test(annotation)) {
|
||||
consumer.accept(index, annotation);
|
||||
|
Loading…
Reference in New Issue
Block a user