diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java index 0447597e967..0aa5c35d45b 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/config/ConfigurableBeanFactory.java @@ -154,7 +154,7 @@ public interface ConfigurableBeanFactory extends HierarchicalBeanFactory, Single * @param requiredType type of the property * @param propertyEditorClass the {@link PropertyEditor} class to register */ - void registerCustomEditor(Class requiredType, Class propertyEditorClass); + void registerCustomEditor(Class requiredType, Class propertyEditorClass); /** * Initialize the given PropertyEditorRegistry with the custom editors diff --git a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java index 77205adce01..78719ea041c 100644 --- a/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java +++ b/org.springframework.beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java @@ -122,8 +122,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp private TypeConverter typeConverter; /** Custom PropertyEditors to apply to the beans of this factory */ - private final Map> customEditors = - new HashMap>(4); + private final Map> customEditors = + new HashMap>(4); /** String resolvers to apply e.g. to annotation attribute values */ private final List embeddedValueResolvers = new LinkedList(); @@ -213,7 +213,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp throws BeansException { final String beanName = transformedBeanName(name); - Object bean = null; + Object bean; // Eagerly check singleton cache for manually registered singletons. Object sharedInstance = getSingleton(beanName); @@ -613,7 +613,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp return this.propertyEditorRegistrars; } - public void registerCustomEditor(Class requiredType, Class propertyEditorClass) { + public void registerCustomEditor(Class requiredType, Class propertyEditorClass) { Assert.notNull(requiredType, "Required type must not be null"); Assert.isAssignable(PropertyEditor.class, propertyEditorClass); this.customEditors.put(requiredType, propertyEditorClass); @@ -626,7 +626,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp /** * Return the map of custom editors, with Classes as keys and PropertyEditor classes as values. */ - public Map> getCustomEditors() { + public Map> getCustomEditors() { return this.customEditors; } @@ -795,6 +795,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp * @param beanName the name of the prototype about to be created * @see #isPrototypeCurrentlyInCreation */ + @SuppressWarnings("unchecked") protected void beforePrototypeCreation(String beanName) { Object curVal = this.prototypesCurrentlyInCreation.get(); if (curVal == null) { @@ -818,6 +819,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp * @param beanName the name of the prototype that has been created * @see #isPrototypeCurrentlyInCreation */ + @SuppressWarnings("unchecked") protected void afterPrototypeCreation(String beanName) { Object curVal = this.prototypesCurrentlyInCreation.get(); if (curVal instanceof String) { @@ -957,7 +959,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp } } if (!this.customEditors.isEmpty()) { - for (Map.Entry> entry : this.customEditors.entrySet()) { + for (Map.Entry> entry : this.customEditors.entrySet()) { Class requiredType = entry.getKey(); Class editorClass = entry.getValue(); registry.registerCustomEditor(requiredType, @@ -1027,7 +1029,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp } else { // Child bean definition: needs to be merged with parent. - BeanDefinition pbd = null; + BeanDefinition pbd; try { String parentBeanName = transformedBeanName(bd.getParentName()); if (!beanName.equals(parentBeanName)) {