@@ -118,7 +118,7 @@ public abstract class AnnotationUtils {
118
118
private static final Map <Class <? extends Annotation >, Boolean > synthesizableCache =
119
119
new ConcurrentReferenceHashMap <Class <? extends Annotation >, Boolean >(256 );
120
120
121
- private static final Map <Class <? extends Annotation >, Map <String , String >> attributeAliasCache =
121
+ private static final Map <Class <? extends Annotation >, Map <String , String >> attributeAliasesCache =
122
122
new ConcurrentReferenceHashMap <Class <? extends Annotation >, Map <String , String >>(256 );
123
123
124
124
private static transient Log logger ;
@@ -437,11 +437,11 @@ private static <A extends Annotation> A searchOnInterfaces(Method method, Class<
437
437
}
438
438
439
439
static boolean isInterfaceWithAnnotatedMethods (Class <?> iface ) {
440
- Boolean flag = annotatedInterfaceCache .get (iface );
441
- if (flag != null ) {
442
- return flag .booleanValue ();
440
+ Boolean found = annotatedInterfaceCache .get (iface );
441
+ if (found != null ) {
442
+ return found .booleanValue ();
443
443
}
444
- Boolean found = Boolean .FALSE ;
444
+ found = Boolean .FALSE ;
445
445
for (Method ifcMethod : iface .getMethods ()) {
446
446
try {
447
447
if (ifcMethod .getAnnotations ().length > 0 ) {
@@ -831,14 +831,12 @@ static AnnotationAttributes getAnnotationAttributes(AnnotatedElement annotatedEl
831
831
for (Method method : getAttributeMethods (annotationType )) {
832
832
try {
833
833
Object value = method .invoke (annotation );
834
-
835
834
Object defaultValue = method .getDefaultValue ();
836
835
if (defaultValuesAsPlaceholder && (defaultValue != null )) {
837
836
if (ObjectUtils .nullSafeEquals (value , defaultValue )) {
838
837
value = DEFAULT_VALUE_PLACEHOLDER ;
839
838
}
840
839
}
841
-
842
840
attrs .put (method .getName (),
843
841
adaptValue (annotatedElement , value , classValuesAsString , nestedAnnotationsAsMap ));
844
842
}
@@ -1090,12 +1088,12 @@ private static Map<String, String> getAttributeAliasMap(Class<? extends Annotati
1090
1088
return Collections .emptyMap ();
1091
1089
}
1092
1090
1093
- Map <String , String > cachedMap = attributeAliasCache .get (annotationType );
1094
- if (cachedMap != null ) {
1095
- return cachedMap ;
1091
+ Map <String , String > map = attributeAliasesCache .get (annotationType );
1092
+ if (map != null ) {
1093
+ return map ;
1096
1094
}
1097
1095
1098
- Map < String , String > map = new HashMap <String , String >();
1096
+ map = new HashMap <String , String >();
1099
1097
for (Method attribute : getAttributeMethods (annotationType )) {
1100
1098
String attributeName = attribute .getName ();
1101
1099
String aliasedAttributeName = getAliasedAttributeName (attribute );
@@ -1104,7 +1102,7 @@ private static Map<String, String> getAttributeAliasMap(Class<? extends Annotati
1104
1102
}
1105
1103
}
1106
1104
1107
- attributeAliasCache .put (annotationType , map );
1105
+ attributeAliasesCache .put (annotationType , map );
1108
1106
1109
1107
return map ;
1110
1108
}
@@ -1127,12 +1125,12 @@ private static Map<String, String> getAttributeAliasMap(Class<? extends Annotati
1127
1125
@ SuppressWarnings ("unchecked" )
1128
1126
private static boolean isSynthesizable (Class <? extends Annotation > annotationType ) {
1129
1127
1130
- Boolean flag = synthesizableCache .get (annotationType );
1131
- if (flag != null ) {
1132
- return flag .booleanValue ();
1128
+ Boolean synthesizable = synthesizableCache .get (annotationType );
1129
+ if (synthesizable != null ) {
1130
+ return synthesizable .booleanValue ();
1133
1131
}
1134
1132
1135
- Boolean synthesizable = Boolean .FALSE ;
1133
+ synthesizable = Boolean .FALSE ;
1136
1134
1137
1135
for (Method attribute : getAttributeMethods (annotationType )) {
1138
1136
if (getAliasedAttributeName (attribute ) != null ) {
@@ -1306,7 +1304,8 @@ static String getAliasedAttributeName(Method attribute, Class<? extends Annotati
1306
1304
* <p>All methods in the returned list will be
1307
1305
* {@linkplain ReflectionUtils#makeAccessible(Method) made accessible}.
1308
1306
*
1309
- * @param annotationType the type in which to search for attribute methods
1307
+ * @param annotationType the type in which to search for attribute methods;
1308
+ * never {@code null}
1310
1309
* @return all annotation attribute methods in the specified annotation
1311
1310
* type; never {@code null}, though potentially <em>empty</em>
1312
1311
* @since 4.2
0 commit comments