diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java index 921745cda3..dea7da17b7 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationBeanNameGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -140,7 +140,7 @@ public class AnnotationBeanNameGenerator implements BeanNameGenerator { *

The default implementation simply builds a decapitalized version * of the short class name: e.g. "mypackage.MyJdbcDao" -> "myJdbcDao". *

Note that inner classes will thus have names of the form - * "outerClassName.innerClassName", which because of the period in the + * "outerClassName.InnerClassName", which because of the period in the * name may be an issue if you are autowiring by name. * @param definition the bean definition to build a bean name for * @return the default bean name (never {@code null}) diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java index 672134135b..b7fbce7c41 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java @@ -214,7 +214,7 @@ public class AnnotationConfigUtils { if (metadata.isAnnotated(Lazy.class.getName())) { abd.setLazyInit(attributesFor(metadata, Lazy.class).getBoolean("value")); } - else if (abd.getMetadata().isAnnotated(Lazy.class.getName())) { + else if (abd.getMetadata() != metadata && abd.getMetadata().isAnnotated(Lazy.class.getName())) { abd.setLazyInit(attributesFor(abd.getMetadata(), Lazy.class).getBoolean("value")); } diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java index 5574a05ea6..031037cab8 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassEnhancer.java @@ -257,9 +257,8 @@ class ConfigurationClassEnhancer { /** * Enhance a {@link Bean @Bean} method to check the supplied BeanFactory for the * existence of this bean object. - * @throws Throwable as a catch-all for any exception that may be thrown when - * invoking the super implementation of the proxied method i.e., the actual - * {@code @Bean} method. + * @throws Throwable as a catch-all for any exception that may be thrown when invoking the + * super implementation of the proxied method i.e., the actual {@code @Bean} method */ @Override public Object intercept(Object enhancedConfigInstance, Method beanMethod, Object[] beanMethodArgs, diff --git a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java index 91a32b7305..a25d6c3091 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassPostProcessor.java @@ -228,11 +228,11 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo int registryId = System.identityHashCode(registry); if (this.registriesPostProcessed.contains(registryId)) { throw new IllegalStateException( - "postProcessBeanDefinitionRegistry already called for this post-processor against " + registry); + "postProcessBeanDefinitionRegistry already called on this post-processor against " + registry); } if (this.factoriesPostProcessed.contains(registryId)) { throw new IllegalStateException( - "postProcessBeanFactory already called for this post-processor against " + registry); + "postProcessBeanFactory already called on this post-processor against " + registry); } this.registriesPostProcessed.add(registryId); @@ -248,7 +248,7 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo int factoryId = System.identityHashCode(beanFactory); if (this.factoriesPostProcessed.contains(factoryId)) { throw new IllegalStateException( - "postProcessBeanFactory already called for this post-processor against " + beanFactory); + "postProcessBeanFactory already called on this post-processor against " + beanFactory); } this.factoriesPostProcessed.add(factoryId); if (!this.registriesPostProcessed.contains(factoryId)) { @@ -329,8 +329,8 @@ public class ConfigurationClassPostProcessor implements BeanDefinitionRegistryPo for (String candidateName : newCandidateNames) { if (!oldCandidateNames.contains(candidateName)) { BeanDefinition beanDef = registry.getBeanDefinition(candidateName); - if (ConfigurationClassUtils.checkConfigurationClassCandidate(beanDef, this.metadataReaderFactory) - && !alreadyParsedClasses.contains(beanDef.getBeanClassName())) { + if (ConfigurationClassUtils.checkConfigurationClassCandidate(beanDef, this.metadataReaderFactory) && + !alreadyParsedClasses.contains(beanDef.getBeanClassName())) { configCandidates.add(new BeanDefinitionHolder(beanDef, candidateName)); } }