From 7f8ede14077189114c5040da9192b31ff01475db Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Wed, 5 Jan 2011 22:24:55 +0000 Subject: [PATCH] Remove dead code * removed registerStandardBeanFactoryPostProcessors() methods * removed commented-out test from PropertyResourceConfigurerTests --- .../PropertyResourceConfigurerTests.java | 33 ------------------- .../support/AbstractApplicationContext.java | 9 ----- ...AbstractRefreshableApplicationContext.java | 1 - .../support/GenericApplicationContext.java | 1 - 4 files changed, 44 deletions(-) diff --git a/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java b/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java index fa790bdd99c..87b99b6afec 100644 --- a/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java +++ b/org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java @@ -800,39 +800,6 @@ public final class PropertyResourceConfigurerTests { Preferences.systemRoot().node("mySystemPath/mypath").remove("myName"); } - /* TODO SPR-7508: uncomment after PropertySourcesPlaceholderConfigurer implementation - @Test - public void testPreferencesPlaceholderConfigurerWithCustomPropertiesInEnvironment() { - factory.registerBeanDefinition("tb", - genericBeanDefinition(TestBean.class) - .addPropertyValue("name", "${mypath/myName}") - .addPropertyValue("age", "${myAge}") - .addPropertyValue("touchy", "${myotherpath/myTouchy}") - .getBeanDefinition()); - - Properties props = new Properties(); - props.put("myAge", "99"); - factory.getEnvironment().getPropertySources().add(new PropertiesPropertySource("localProps", props)); - - PreferencesPlaceholderConfigurer ppc = new PreferencesPlaceholderConfigurer(); - ppc.setSystemTreePath("mySystemPath"); - ppc.setUserTreePath("myUserPath"); - Preferences.systemRoot().node("mySystemPath").node("mypath").put("myName", "myNameValue"); - Preferences.systemRoot().node("mySystemPath/myotherpath").put("myTouchy", "myTouchyValue"); - Preferences.userRoot().node("myUserPath/myotherpath").put("myTouchy", "myOtherTouchyValue"); - ppc.afterPropertiesSet(); - ppc.postProcessBeanFactory(factory); - - TestBean tb = (TestBean) factory.getBean("tb"); - assertEquals("myNameValue", tb.getName()); - assertEquals(99, tb.getAge()); - assertEquals("myOtherTouchyValue", tb.getTouchy()); - Preferences.userRoot().node("myUserPath/myotherpath").remove("myTouchy"); - Preferences.systemRoot().node("mySystemPath/myotherpath").remove("myTouchy"); - Preferences.systemRoot().node("mySystemPath/mypath").remove("myName"); - } - */ - private static class ConvertingOverrideConfigurer extends PropertyOverrideConfigurer { diff --git a/org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java b/org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java index a09bec7fa2b..890772ec89b 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java +++ b/org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java @@ -667,15 +667,6 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader } } - /** - * Common location for subclasses to call and receive registration of standard - * {@link BeanFactoryPostProcessor} bean definitions. - * - * @param registry subclass BeanDefinitionRegistry - */ - protected void registerStandardBeanFactoryPostProcessors(BeanDefinitionRegistry registry) { - } - /** * Instantiate and invoke all registered BeanPostProcessor beans, * respecting explicit order if given. diff --git a/org.springframework.context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java b/org.springframework.context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java index b868db75aa4..5264b81f0d1 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java +++ b/org.springframework.context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java @@ -218,7 +218,6 @@ public abstract class AbstractRefreshableApplicationContext extends AbstractAppl } beanFactory.setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer()); beanFactory.setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver()); - registerStandardBeanFactoryPostProcessors(beanFactory); } /** diff --git a/org.springframework.context/src/main/java/org/springframework/context/support/GenericApplicationContext.java b/org.springframework.context/src/main/java/org/springframework/context/support/GenericApplicationContext.java index 470af7f8260..3dc7d1cf8d1 100644 --- a/org.springframework.context/src/main/java/org/springframework/context/support/GenericApplicationContext.java +++ b/org.springframework.context/src/main/java/org/springframework/context/support/GenericApplicationContext.java @@ -103,7 +103,6 @@ public class GenericApplicationContext extends AbstractApplicationContext implem this.beanFactory = new DefaultListableBeanFactory(); this.beanFactory.setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer()); this.beanFactory.setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver()); - registerStandardBeanFactoryPostProcessors(this.beanFactory); } /**