Skip to content

Commit

Permalink
Declare empty default postProcessBeanFactory method
Browse files Browse the repository at this point in the history
Closes gh-31476
  • Loading branch information
jhoeller committed Oct 23, 2023
1 parent cb4d44b commit 6dc79b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2002-2023 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.
Expand All @@ -18,6 +18,7 @@

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanFactoryPostProcessor;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;

/**
* Extension to the standard {@link BeanFactoryPostProcessor} SPI, allowing for
Expand All @@ -42,4 +43,14 @@ public interface BeanDefinitionRegistryPostProcessor extends BeanFactoryPostProc
*/
void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException;

/**
* Empty implementation of {@link BeanFactoryPostProcessor#postProcessBeanFactory}
* since custom {@code BeanDefinitionRegistryPostProcessor} implementations will
* typically only provide a {@link #postProcessBeanDefinitionRegistry} method.
* @since 6.1
*/
@Override
default void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.
Expand Down Expand Up @@ -193,10 +193,6 @@ public int getOrder() {
public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException {
registry.registerBeanDefinition("bfpp1", new RootBeanDefinition(TestBeanFactoryPostProcessor.class));
}

@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
}
}


Expand Down Expand Up @@ -224,10 +220,6 @@ public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) t
registry.registerBeanDefinition("anotherpp", new RootBeanDefinition(TestBeanDefinitionRegistryPostProcessor.class));
registry.registerBeanDefinition("ppp", new RootBeanDefinition(PrioritizedBeanDefinitionRegistryPostProcessor.class));
}

@Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
}
}


Expand Down

0 comments on commit 6dc79b5

Please sign in to comment.