Process all non-private methods, not just public methods
Previously, the configuration processor would ignore any @ConfigurationProperties-annotated methods that were not public. This prevented metadata generation for package-private @Bean methods such as those in DataSourceConfiguration's inner-classes for DBCP2, Hikari, and Tomcat JDBC. This commit updates the annotation processor so that it will process any non-private method annotated with @ConfigurationProperties. Fixes gh-18124
This commit is contained in:
@@ -216,7 +216,8 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor
|
||||
}
|
||||
|
||||
private void processExecutableElement(String prefix, ExecutableElement element) {
|
||||
if (element.getModifiers().contains(Modifier.PUBLIC) && (TypeKind.VOID != element.getReturnType().getKind())) {
|
||||
if ((!element.getModifiers().contains(Modifier.PRIVATE))
|
||||
&& (TypeKind.VOID != element.getReturnType().getKind())) {
|
||||
Element returns = this.processingEnv.getTypeUtils().asElement(element.getReturnType());
|
||||
if (returns instanceof TypeElement) {
|
||||
ItemMetadata group = ItemMetadata.newGroup(prefix,
|
||||
|
||||
Reference in New Issue
Block a user