@@ -236,8 +236,8 @@ public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, Strin
236236 Constructor <?> requiredConstructor = null ;
237237 Constructor <?> defaultConstructor = null ;
238238 for (Constructor <?> candidate : rawCandidates ) {
239- AnnotationAttributes annotation = findAutowiredAnnotation (candidate );
240- if (annotation != null ) {
239+ AnnotationAttributes ann = findAutowiredAnnotation (candidate );
240+ if (ann != null ) {
241241 if (requiredConstructor != null ) {
242242 throw new BeanCreationException (beanName ,
243243 "Invalid autowire-marked constructor: " + candidate +
@@ -248,7 +248,7 @@ public Constructor<?>[] determineCandidateConstructors(Class<?> beanClass, Strin
248248 throw new IllegalStateException (
249249 "Autowired annotation requires at least one argument: " + candidate );
250250 }
251- boolean required = determineRequiredStatus (annotation );
251+ boolean required = determineRequiredStatus (ann );
252252 if (required ) {
253253 if (!candidates .isEmpty ()) {
254254 throw new BeanCreationException (beanName ,
@@ -322,9 +322,9 @@ public void processInjection(Object bean) throws BeansException {
322322
323323
324324 private InjectionMetadata findAutowiringMetadata (String beanName , Class <?> clazz ) {
325- // Quick check on the concurrent map first, with minimal locking.
326325 // Fall back to class name as cache key, for backwards compatibility with custom callers.
327326 String cacheKey = (StringUtils .hasLength (beanName ) ? beanName : clazz .getName ());
327+ // Quick check on the concurrent map first, with minimal locking.
328328 InjectionMetadata metadata = this .injectionMetadataCache .get (cacheKey );
329329 if (InjectionMetadata .needsRefresh (metadata , clazz )) {
330330 synchronized (this .injectionMetadataCache ) {
@@ -345,15 +345,15 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
345345 do {
346346 LinkedList <InjectionMetadata .InjectedElement > currElements = new LinkedList <InjectionMetadata .InjectedElement >();
347347 for (Field field : targetClass .getDeclaredFields ()) {
348- AnnotationAttributes annotation = findAutowiredAnnotation (field );
349- if (annotation != null ) {
348+ AnnotationAttributes ann = findAutowiredAnnotation (field );
349+ if (ann != null ) {
350350 if (Modifier .isStatic (field .getModifiers ())) {
351351 if (logger .isWarnEnabled ()) {
352352 logger .warn ("Autowired annotation is not supported on static fields: " + field );
353353 }
354354 continue ;
355355 }
356- boolean required = determineRequiredStatus (annotation );
356+ boolean required = determineRequiredStatus (ann );
357357 currElements .add (new AutowiredFieldElement (field , required ));
358358 }
359359 }
@@ -390,9 +390,9 @@ private InjectionMetadata buildAutowiringMetadata(Class<?> clazz) {
390390
391391 private AnnotationAttributes findAutowiredAnnotation (AccessibleObject ao ) {
392392 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 ;
396396 }
397397 }
398398 return null ;
@@ -403,12 +403,12 @@ private AnnotationAttributes findAutowiredAnnotation(AccessibleObject ao) {
403403 * <p>A 'required' dependency means that autowiring should fail when no beans
404404 * are found. Otherwise, the autowiring process will simply bypass the field
405405 * or method when no beans are found.
406- * @param annotation the Autowired annotation
406+ * @param ann the Autowired annotation
407407 * @return whether the annotation indicates that a dependency is required
408408 */
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 ));
412412 }
413413
414414 /**
0 commit comments