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