@@ -236,8 +236,8 @@ public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, Strin
236
236
Constructor <?> requiredConstructor = null ;
237
237
Constructor <?> defaultConstructor = null ;
238
238
for (Constructor <?> candidate : rawCandidates ) {
239
- AnnotationAttributes annotation = findAutowiredAnnotation (candidate );
240
- if (annotation != null ) {
239
+ AnnotationAttributes ann = findAutowiredAnnotation (candidate );
240
+ if (ann != null ) {
241
241
if (requiredConstructor != null ) {
242
242
throw new BeanCreationException (beanName ,
243
243
"Invalid autowire-marked constructor: " + candidate +
@@ -248,7 +248,7 @@ public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, Strin
248
248
throw new IllegalStateException (
249
249
"Autowired annotation requires at least one argument: " + candidate );
250
250
}
251
- boolean required = determineRequiredStatus (annotation );
251
+ boolean required = determineRequiredStatus (ann );
252
252
if (required ) {
253
253
if (!candidates .isEmpty ()) {
254
254
throw new BeanCreationException (beanName ,
@@ -322,9 +322,9 @@ public void processInjection(Object bean) throws BeansException {
322
322
323
323
324
324
private InjectionMetadata findAutowiringMetadata (String beanName , Class <?> clazz ) {
325
- // Quick check on the concurrent map first, with minimal locking.
326
325
// Fall back to class name as cache key, for backwards compatibility with custom callers.
327
326
String cacheKey = (StringUtils .hasLength (beanName ) ? beanName : clazz .getName ());
327
+ // Quick check on the concurrent map first, with minimal locking.
328
328
InjectionMetadata metadata = this .injectionMetadataCache .get (cacheKey );
329
329
if (InjectionMetadata .needsRefresh (metadata , clazz )) {
330
330
synchronized (this .injectionMetadataCache ) {
@@ -345,15 +345,15 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
345
345
do {
346
346
LinkedList <InjectionMetadata .InjectedElement > currElements = new LinkedList <InjectionMetadata .InjectedElement >();
347
347
for (Field field : targetClass .getDeclaredFields ()) {
348
- AnnotationAttributes annotation = findAutowiredAnnotation (field );
349
- if (annotation != null ) {
348
+ AnnotationAttributes ann = findAutowiredAnnotation (field );
349
+ if (ann != null ) {
350
350
if (Modifier .isStatic (field .getModifiers ())) {
351
351
if (logger .isWarnEnabled ()) {
352
352
logger .warn ("Autowired annotation is not supported on static fields: " + field );
353
353
}
354
354
continue ;
355
355
}
356
- boolean required = determineRequiredStatus (annotation );
356
+ boolean required = determineRequiredStatus (ann );
357
357
currElements .add (new AutowiredFieldElement (field , required ));
358
358
}
359
359
}
@@ -390,9 +390,9 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
390
390
391
391
private AnnotationAttributes findAutowiredAnnotation (AccessibleObject ao ) {
392
392
for (Class <? extends Annotation > type : this .autowiredAnnotationTypes ) {
393
- AnnotationAttributes annotation = AnnotatedElementUtils .getAnnotationAttributes (ao , type .getName ());
394
- if (annotation != null ) {
395
- return annotation ;
393
+ AnnotationAttributes ann = AnnotatedElementUtils .getAnnotationAttributes (ao , type .getName ());
394
+ if (ann != null ) {
395
+ return ann ;
396
396
}
397
397
}
398
398
return null ;
@@ -403,12 +403,12 @@ private AnnotationAttributes findAutowiredAnnotation(AccessibleObject ao) {
403
403
* <p>A 'required' dependency means that autowiring should fail when no beans
404
404
* are found. Otherwise, the autowiring process will simply bypass the field
405
405
* or method when no beans are found.
406
- * @param annotation the Autowired annotation
406
+ * @param ann the Autowired annotation
407
407
* @return whether the annotation indicates that a dependency is required
408
408
*/
409
- protected boolean determineRequiredStatus (AnnotationAttributes annotation ) {
410
- return (!annotation .containsKey (this .requiredParameterName ) ||
411
- this .requiredParameterValue == annotation .getBoolean (this .requiredParameterName ));
409
+ protected boolean determineRequiredStatus (AnnotationAttributes ann ) {
410
+ return (!ann .containsKey (this .requiredParameterName ) ||
411
+ this .requiredParameterValue == ann .getBoolean (this .requiredParameterName ));
412
412
}
413
413
414
414
/**
0 commit comments