28
28
import org .springframework .beans .factory .config .ConfigurableListableBeanFactory ;
29
29
import org .springframework .beans .factory .support .DefaultListableBeanFactory ;
30
30
import org .springframework .beans .factory .support .RootBeanDefinition ;
31
+ import org .springframework .data .util .TypeScanner ;
31
32
import org .springframework .lang .NonNull ;
32
33
import org .springframework .lang .Nullable ;
33
34
import org .springframework .util .Assert ;
@@ -118,7 +119,7 @@ default boolean isTypePresent(@NonNull String typeName) {
118
119
*/
119
120
@ NonNull
120
121
default TypeScanner getTypeScanner () {
121
- return new TypeScanner (getClassLoader ());
122
+ return TypeScanner . typeScanner (getClassLoader ());
122
123
}
123
124
124
125
/**
@@ -129,14 +130,12 @@ default TypeScanner getTypeScanner() {
129
130
* model {@link Class types}; must not be {@literal null}.
130
131
* @param packageNames {@link Collection} of {@link String package names} to scan.
131
132
* @return a {@link Set} of {@link Class types} found during the scan.
132
- * @see TypeScanner#scanForTypesAnnotatedWith(Class[])
133
- * @see TypeScanner.Scanner#inPackages(Collection)
134
133
* @see #getTypeScanner()
135
134
*/
136
135
default Set <Class <?>> scanPackageForTypes (@ NonNull Collection <Class <? extends Annotation >> identifyingAnnotations ,
137
136
Collection <String > packageNames ) {
138
137
139
- return getTypeScanner ().scanForTypesAnnotatedWith ( identifyingAnnotations ).inPackages ( packageNames );
138
+ return getTypeScanner ().scanPackages ( packageNames ). forTypesAnnotatedWith ( identifyingAnnotations ).collectAsSet ( );
140
139
}
141
140
142
141
/**
0 commit comments