@@ -66,6 +66,8 @@ public class AnnotationRepositoryConfigurationSource extends RepositoryConfigura
66
66
private static final String CONSIDER_NESTED_REPOSITORIES = "considerNestedRepositories" ;
67
67
private static final String BOOTSTRAP_MODE = "bootstrapMode" ;
68
68
private static final String BEAN_NAME_GENERATOR = "nameGenerator" ;
69
+ private static final String INCLUDE_FILTERS = "includeFilters" ;
70
+ private static final String EXCLUDE_FILTERS = "excludeFilters" ;
69
71
70
72
private final AnnotationMetadata configMetadata ;
71
73
private final AnnotationMetadata enableAnnotationMetadata ;
@@ -175,12 +177,12 @@ public Object getSource() {
175
177
176
178
@ Override
177
179
protected Iterable <TypeFilter > getIncludeFilters () {
178
- return parseFilters ("includeFilters" );
180
+ return parseFilters (INCLUDE_FILTERS );
179
181
}
180
182
181
183
@ Override
182
184
public Streamable <TypeFilter > getExcludeFilters () {
183
- return parseFilters ("excludeFilters" );
185
+ return parseFilters (EXCLUDE_FILTERS );
184
186
}
185
187
186
188
@ Override
@@ -304,7 +306,7 @@ private Optional<String> getNullDefaultedAttribute(String attributeName) {
304
306
*/
305
307
private static boolean hasExplicitFilters (AnnotationAttributes attributes ) {
306
308
307
- return Stream .of ("includeFilters" , "excludeFilters" ) //
309
+ return Stream .of (INCLUDE_FILTERS , EXCLUDE_FILTERS ) //
308
310
.anyMatch (it -> attributes .getAnnotationArray (it ).length > 0 );
309
311
}
310
312
@@ -333,13 +335,15 @@ private static BeanNameGenerator configuredOrDefaultBeanNameGenerator(Annotation
333
335
* customized.
334
336
*
335
337
* @param generator can be {@literal null}.
336
- * @return
338
+ * @return the configured {@link BeanNameGenerator} if it is not
339
+ * {@link ConfigurationClassPostProcessor#IMPORT_BEAN_NAME_GENERATOR} or {@link AnnotationBeanNameGenerator}
340
+ * otherwise.
337
341
* @since 2.2
338
342
*/
339
343
private static BeanNameGenerator defaultBeanNameGenerator (@ Nullable BeanNameGenerator generator ) {
340
344
341
345
return generator == null || ConfigurationClassPostProcessor .IMPORT_BEAN_NAME_GENERATOR .equals (generator ) //
342
- ? new AnnotationBeanNameGenerator () //
346
+ ? AnnotationBeanNameGenerator . INSTANCE //
343
347
: generator ;
344
348
}
345
349
0 commit comments