Changeset 14782 in josm for trunk/test/unit/org/openstreetmap
- Timestamp:
- 2019-02-11T22:52:05+01:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/unit/org/openstreetmap/josm/TestUtils.java
r14528 r14782 30 30 import java.util.concurrent.ExecutionException; 31 31 import java.util.concurrent.ThreadPoolExecutor; 32 import java.util.function.Function; 32 33 import java.util.stream.Collectors; 33 34 import java.util.stream.Stream; … … 55 56 import org.openstreetmap.josm.tools.Utils; 56 57 import org.openstreetmap.josm.tools.WikiReader; 57 import org.reflections.Reflections;58 58 59 59 import com.github.tomakehurst.wiremock.WireMockServer; … … 62 62 63 63 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 64 import io.github.classgraph.ClassGraph; 65 import io.github.classgraph.ClassInfoList; 66 import io.github.classgraph.ScanResult; 64 67 import mockit.integration.TestRunnerDecorator; 65 68 … … 571 574 */ 572 575 public static <T> Set<Class<? extends T>> getJosmSubtypes(Class<T> superClass) { 573 return new Reflections("org.openstreetmap.josm").getSubTypesOf(superClass); 576 try (ScanResult scan = new ClassGraph().whitelistPackages("org.openstreetmap.josm").ignoreClassVisibility().scan()) { 577 Function<String, ClassInfoList> lambda = superClass.isInterface() ? scan::getClassesImplementing : scan::getSubclasses; 578 return lambda.apply(superClass.getName()) 579 .asMap().values().stream().map(x -> x.loadClass(superClass)).collect(Collectors.toSet()); 580 } 574 581 } 575 582
Note:
See TracChangeset
for help on using the changeset viewer.