Skip to content

Commit 4e23153

Browse files
Move runtime hints into another package
Original Pull Request: #2624
1 parent 51cda99 commit 4e23153

29 files changed

+659
-618
lines changed

src/main/java/org/springframework/data/ManagedTypes.java

-152
This file was deleted.

src/main/java/org/springframework/data/aot/AotContext.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
2929
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
3030
import org.springframework.beans.factory.support.RootBeanDefinition;
31+
import org.springframework.data.util.TypeScanner;
3132
import org.springframework.lang.NonNull;
3233
import org.springframework.lang.Nullable;
3334
import org.springframework.util.Assert;
@@ -118,7 +119,7 @@ default boolean isTypePresent(@NonNull String typeName) {
118119
*/
119120
@NonNull
120121
default TypeScanner getTypeScanner() {
121-
return new TypeScanner(getClassLoader());
122+
return TypeScanner.typeScanner(getClassLoader());
122123
}
123124

124125
/**
@@ -129,14 +130,12 @@ default TypeScanner getTypeScanner() {
129130
* model {@link Class types}; must not be {@literal null}.
130131
* @param packageNames {@link Collection} of {@link String package names} to scan.
131132
* @return a {@link Set} of {@link Class types} found during the scan.
132-
* @see TypeScanner#scanForTypesAnnotatedWith(Class[])
133-
* @see TypeScanner.Scanner#inPackages(Collection)
134133
* @see #getTypeScanner()
135134
*/
136135
default Set<Class<?>> scanPackageForTypes(@NonNull Collection<Class<? extends Annotation>> identifyingAnnotations,
137136
Collection<String> packageNames) {
138137

139-
return getTypeScanner().scanForTypesAnnotatedWith(identifyingAnnotations).inPackages(packageNames);
138+
return getTypeScanner().scanPackages(packageNames).forTypesAnnotatedWith(identifyingAnnotations).collectAsSet();
140139
}
141140

142141
/**

src/main/java/org/springframework/data/aot/DataRuntimeHints.java

-105
This file was deleted.

src/main/java/org/springframework/data/aot/DefaultAotRepositoryContext.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
2424
import org.springframework.core.annotation.MergedAnnotation;
25-
import org.springframework.data.aot.TypeScanner.Scanner;
2625
import org.springframework.data.repository.core.RepositoryInformation;
2726
import org.springframework.data.util.Lazy;
2827

@@ -128,12 +127,10 @@ protected Set<Class<?>> discoverTypes() {
128127

129128
if (!getIdentifyingAnnotations().isEmpty()) {
130129

131-
Scanner typeScanner = aotContext.getTypeScanner().scanForTypesAnnotatedWith(getIdentifyingAnnotations());
132-
Set<Class<?>> classes = typeScanner.inPackages(getBasePackages());
130+
Set<Class<?>> classes = aotContext.getTypeScanner().scanPackages(getBasePackages()).forTypesAnnotatedWith(getIdentifyingAnnotations()).collectAsSet();
133131
types.addAll(TypeCollector.inspect(classes).list());
134132
}
135133

136-
// context.get
137134
return types;
138135
}
139136
}

0 commit comments

Comments
 (0)