Polishing

This commit is contained in:
Juergen Hoeller
2018-06-11 17:00:51 +02:00
parent 6df7ba2447
commit 965f3c6434
4 changed files with 19 additions and 20 deletions

View File

@@ -18,7 +18,6 @@ package org.springframework.context.annotation.configuration;
import org.junit.Test;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;
import org.springframework.beans.factory.FactoryBean;
@@ -67,7 +66,7 @@ public class DuplicatePostProcessingTests {
private final ExampleBean exampleBean = new ExampleBean();
@Override
public ExampleBean getObject() throws Exception {
public ExampleBean getObject() {
return this.exampleBean;
}
@@ -87,14 +86,13 @@ public class DuplicatePostProcessingTests {
private ApplicationContext applicationContext;
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
public Object postProcessBeforeInitialization(Object bean, String beanName) {
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
public Object postProcessAfterInitialization(Object bean, String beanName) {
if (bean instanceof ExampleBean) {
this.applicationContext.publishEvent(new ExampleApplicationEvent(this));
}
@@ -102,12 +100,13 @@ public class DuplicatePostProcessingTests {
}
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
}
@SuppressWarnings("serial")
static class ExampleApplicationEvent extends ApplicationEvent {
public ExampleApplicationEvent(Object source) {
@@ -126,7 +125,7 @@ public class DuplicatePostProcessingTests {
}
@Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
}