Browse Source

Test: Suppress unchecked cast warnings

modulesv2
weisj 3 years ago
parent
commit
1e83634ea3
No known key found for this signature in database
GPG Key ID: 31124CB75461DA2A
  1. 3
      core/src/test/java/com/github/weisj/darklaf/core/test/util/ClassFinder.java

3
core/src/test/java/com/github/weisj/darklaf/core/test/util/ClassFinder.java

@ -30,6 +30,7 @@ import com.github.weisj.darklaf.util.Lambdas;
public final class ClassFinder {
@SuppressWarnings("unchecked")
public static <T> List<Instantiable<T>> getInstancesOfType(final Class<T> type, final String... packages) {
try (ResourceWalker walker = ResourceWalker.walkResources(packages)) {
return walker.stream()
@ -41,7 +42,7 @@ public final class ClassFinder {
.filter(type::isAssignableFrom)
.filter(cls -> !cls.isInterface())
.filter(cls -> !Modifier.isAbstract(cls.getModifiers()))
.map(c -> new Instantiable<T>((Class<T>) c))
.map(c -> new Instantiable<>((Class<T>) c))
.collect(Collectors.toList());
}
}

Loading…
Cancel
Save