Browse Source

Remove dead code

* removed registerStandardBeanFactoryPostProcessors() methods
* removed commented-out test from PropertyResourceConfigurerTests
pull/7/head
Chris Beams 14 years ago
parent
commit
7f8ede1407
  1. 33
      org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java
  2. 9
      org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
  3. 1
      org.springframework.context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java
  4. 1
      org.springframework.context/src/main/java/org/springframework/context/support/GenericApplicationContext.java

33
org.springframework.beans/src/test/java/org/springframework/beans/factory/config/PropertyResourceConfigurerTests.java

@ -800,39 +800,6 @@ public final class PropertyResourceConfigurerTests { @@ -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 {

9
org.springframework.context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java

@ -667,15 +667,6 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader @@ -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.

1
org.springframework.context/src/main/java/org/springframework/context/support/AbstractRefreshableApplicationContext.java

@ -218,7 +218,6 @@ public abstract class AbstractRefreshableApplicationContext extends AbstractAppl @@ -218,7 +218,6 @@ public abstract class AbstractRefreshableApplicationContext extends AbstractAppl
}
beanFactory.setParameterNameDiscoverer(new LocalVariableTableParameterNameDiscoverer());
beanFactory.setAutowireCandidateResolver(new QualifierAnnotationAutowireCandidateResolver());
registerStandardBeanFactoryPostProcessors(beanFactory);
}
/**

1
org.springframework.context/src/main/java/org/springframework/context/support/GenericApplicationContext.java

@ -103,7 +103,6 @@ public class GenericApplicationContext extends AbstractApplicationContext implem @@ -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);
}
/**

Loading…
Cancel
Save