@@ -269,8 +269,8 @@ public void doWith(Method method) throws IllegalArgumentException, IllegalAccess
269
269
Constructor <?> requiredConstructor = null ;
270
270
Constructor <?> defaultConstructor = null ;
271
271
for (Constructor <?> candidate : rawCandidates ) {
272
- AnnotationAttributes annotation = findAutowiredAnnotation (candidate );
273
- if (annotation != null ) {
272
+ AnnotationAttributes ann = findAutowiredAnnotation (candidate );
273
+ if (ann != null ) {
274
274
if (requiredConstructor != null ) {
275
275
throw new BeanCreationException (beanName ,
276
276
"Invalid autowire-marked constructor: " + candidate +
@@ -281,7 +281,7 @@ public void doWith(Method method) throws IllegalArgumentException, IllegalAccess
281
281
throw new IllegalStateException (
282
282
"Autowired annotation requires at least one argument: " + candidate );
283
283
}
284
- boolean required = determineRequiredStatus (annotation );
284
+ boolean required = determineRequiredStatus (ann );
285
285
if (required ) {
286
286
if (!candidates .isEmpty ()) {
287
287
throw new BeanCreationException (beanName ,
@@ -384,15 +384,15 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
384
384
do {
385
385
LinkedList <InjectionMetadata .InjectedElement > currElements = new LinkedList <InjectionMetadata .InjectedElement >();
386
386
for (Field field : targetClass .getDeclaredFields ()) {
387
- AnnotationAttributes annotation = findAutowiredAnnotation (field );
388
- if (annotation != null ) {
387
+ AnnotationAttributes ann = findAutowiredAnnotation (field );
388
+ if (ann != null ) {
389
389
if (Modifier .isStatic (field .getModifiers ())) {
390
390
if (logger .isWarnEnabled ()) {
391
391
logger .warn ("Autowired annotation is not supported on static fields: " + field );
392
392
}
393
393
continue ;
394
394
}
395
- boolean required = determineRequiredStatus (annotation );
395
+ boolean required = determineRequiredStatus (ann );
396
396
currElements .add (new AutowiredFieldElement (field , required ));
397
397
}
398
398
}
@@ -429,9 +429,9 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
429
429
430
430
private AnnotationAttributes findAutowiredAnnotation (AccessibleObject ao ) {
431
431
for (Class <? extends Annotation > type : this .autowiredAnnotationTypes ) {
432
- AnnotationAttributes annotation = AnnotatedElementUtils .getAnnotationAttributes (ao , type .getName ());
433
- if (annotation != null ) {
434
- return annotation ;
432
+ AnnotationAttributes ann = AnnotatedElementUtils .getAnnotationAttributes (ao , type .getName ());
433
+ if (ann != null ) {
434
+ return ann ;
435
435
}
436
436
}
437
437
return null ;
@@ -442,12 +442,12 @@ private AnnotationAttributes findAutowiredAnnotation(AccessibleObject ao) {
442
442
* <p>A 'required' dependency means that autowiring should fail when no beans
443
443
* are found. Otherwise, the autowiring process will simply bypass the field
444
444
* or method when no beans are found.
445
- * @param annotation the Autowired annotation
445
+ * @param ann the Autowired annotation
446
446
* @return whether the annotation indicates that a dependency is required
447
447
*/
448
- protected boolean determineRequiredStatus (AnnotationAttributes annotation ) {
449
- return (!annotation .containsKey (this .requiredParameterName ) ||
450
- this .requiredParameterValue == annotation .getBoolean (this .requiredParameterName ));
448
+ protected boolean determineRequiredStatus (AnnotationAttributes ann ) {
449
+ return (!ann .containsKey (this .requiredParameterName ) ||
450
+ this .requiredParameterValue == ann .getBoolean (this .requiredParameterName ));
451
451
}
452
452
453
453
/**
0 commit comments