mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
Merge pull request #2586 from querydsl/fix-classpathutils
Limit classpath scanning to the specified package
This commit is contained in:
commit
77a243d667
@ -21,6 +21,7 @@ import org.reflections.Reflections;
|
||||
import org.reflections.scanners.SubTypesScanner;
|
||||
import org.reflections.util.ClasspathHelper;
|
||||
import org.reflections.util.ConfigurationBuilder;
|
||||
import org.reflections.util.FilterBuilder;
|
||||
|
||||
/**
|
||||
* {@code ClassPathUtils} provides classpath scanning functionality
|
||||
@ -53,6 +54,7 @@ public final class ClassPathUtils {
|
||||
Reflections reflections = new Reflections(new ConfigurationBuilder()
|
||||
.addUrls(ClasspathHelper.forPackage(pkg, classLoader))
|
||||
.addClassLoader(classLoader)
|
||||
.filterInputsBy(new FilterBuilder().includePackage(pkg))
|
||||
.setScanners(new SubTypesScanner(false)));
|
||||
Set<Class<?>> classes = new HashSet<Class<?>>();
|
||||
for (String typeNames : reflections.getStore().get(SubTypesScanner.class.getSimpleName()).values()) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user