private static int resolveOrder(Method method) { Order ann = AnnotatedElementUtils.findMergedAnnotation(method, Order.class); return (ann != null ? ann.value() : 0); }
@Override protected Annotation[] adaptAnnotationArray(Annotation[] annotations) { return AnnotationUtils.synthesizeAnnotationArray(annotations, getAnnotatedElement()); }
@Override protected <A extends Annotation> A adaptAnnotation(A annotation) { return AnnotationUtils.synthesizeAnnotation(annotation, getAnnotatedElement()); }
@Test public void arrayNoFactoryMethod() { A a = new A(); C c = new C(-50); B b = new B(); Object[] items = new Object[] {a, c, b}; Arrays.sort(items, comparator.withSourceProvider(obj -> null)); assertOrder(items, c, a, b); }
@MyRepeatable("A") @MyRepeatableContainer({@MyRepeatable("B"), @MyRepeatable("C")}) @MyRepeatableMeta1 void foo(); }
@ForPetesSake("B") @ForTheLoveOfFoo("C") @PeteRepeat("A") static class ComposedRepeatableClass { }
@ForPetesSake("C") @PeteRepeats(@PeteRepeat("A")) @PeteRepeat("B") static class ComposedRepeatableMixedWithContainerClass { }
@MyRepeatable("X") @MyRepeatableContainer({@MyRepeatable("Y"), @MyRepeatable("Z")}) @MyRepeatableMeta2 static class SubMyRepeatableWithAdditionalLocalDeclarationsClass extends MyRepeatableClass { }
@ComposedNoninherited(name = "C") @Noninheriteds({ @Noninherited(value = "A"), @Noninherited(name = "B") }) static class NoninheritedRepeatableClass { }
@PeteRepeat("A") @PeteRepeats({ @PeteRepeat("B"), @PeteRepeat("C") }) static class RepeatableClass { }
@PeteRepeat("A") @ComposedContainer static class ComposedContainerClass { }
@NoninheritedCache1 @NoninheritedCache2 private static class MultipleNoninheritedComposedCachesClass { }
@TxInheritedComposed @TxComposed static class TxFromMultipleComposedAnnotations { }
@MyRepeatable("A") @MyRepeatableContainer({@MyRepeatable("B"), @MyRepeatable("C")}) @MyRepeatableMeta1 static class MyRepeatableClass { }