Polishing
This commit is contained in:
@@ -121,12 +121,12 @@ public abstract class AnnotationUtils {
|
||||
private static final Map<AnnotationCacheKey, Annotation> findAnnotationCache =
|
||||
new ConcurrentReferenceHashMap<AnnotationCacheKey, Annotation>(256);
|
||||
|
||||
private static final Map<Class<?>, Boolean> annotatedInterfaceCache =
|
||||
new ConcurrentReferenceHashMap<Class<?>, Boolean>(256);
|
||||
|
||||
private static final Map<AnnotationCacheKey, Boolean> metaPresentCache =
|
||||
new ConcurrentReferenceHashMap<AnnotationCacheKey, Boolean>(256);
|
||||
|
||||
private static final Map<Class<?>, Boolean> annotatedInterfaceCache =
|
||||
new ConcurrentReferenceHashMap<Class<?>, Boolean>(256);
|
||||
|
||||
private static final Map<Class<? extends Annotation>, Boolean> synthesizableCache =
|
||||
new ConcurrentReferenceHashMap<Class<? extends Annotation>, Boolean>(256);
|
||||
|
||||
@@ -787,7 +787,7 @@ public abstract class AnnotationUtils {
|
||||
* @see #isAnnotationDeclaredLocally(Class, Class)
|
||||
*/
|
||||
public static Class<?> findAnnotationDeclaringClassForTypes(List<Class<? extends Annotation>> annotationTypes, Class<?> clazz) {
|
||||
Assert.notEmpty(annotationTypes, "The list of annotation types must not be empty");
|
||||
Assert.notEmpty(annotationTypes, "List of annotation types must not be empty");
|
||||
if (clazz == null || Object.class == clazz) {
|
||||
return null;
|
||||
}
|
||||
@@ -1055,7 +1055,7 @@ public abstract class AnnotationUtils {
|
||||
try {
|
||||
Object value = method.invoke(annotation);
|
||||
Object defaultValue = method.getDefaultValue();
|
||||
if (mergeMode && (defaultValue != null)) {
|
||||
if (mergeMode && defaultValue != null) {
|
||||
if (ObjectUtils.nullSafeEquals(value, defaultValue)) {
|
||||
value = DEFAULT_VALUE_PLACEHOLDER;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ public class AnnotatedElementUtilsTests {
|
||||
@Rule
|
||||
public final ExpectedException exception = ExpectedException.none();
|
||||
|
||||
|
||||
@Test
|
||||
public void getMetaAnnotationTypesOnNonAnnotatedClass() {
|
||||
assertNull(getMetaAnnotationTypes(NonAnnotatedClass.class, TransactionalComponent.class));
|
||||
@@ -69,8 +70,7 @@ public class AnnotatedElementUtilsTests {
|
||||
|
||||
@Test
|
||||
public void getMetaAnnotationTypesOnClassWithMetaDepth2() {
|
||||
Set<String> names = getMetaAnnotationTypes(ComposedTransactionalComponentClass.class,
|
||||
ComposedTransactionalComponent.class);
|
||||
Set<String> names = getMetaAnnotationTypes(ComposedTransactionalComponentClass.class, ComposedTransactionalComponent.class);
|
||||
assertEquals(names(TransactionalComponent.class, Transactional.class, Component.class), names);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user