Skip to content

Commit

Permalink
Replace ClassLoader Java 11 methods
Browse files Browse the repository at this point in the history
  • Loading branch information
APickledWalrus committed Jun 14, 2024
1 parent a886b25 commit 8998a2e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/skriptlang/skript/util/ClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private ClassLoader(String basePackage, Collection<String> subPackages, boolean
this.basePackage = basePackage.replace('.', '/') + "/";
this.subPackages = subPackages.stream()
.map(subPackage -> subPackage.replace('.', '/') + "/")
.collect(Collectors.toUnmodifiableSet());
.collect(Collectors.toSet());
this.initialize = initialize;
this.deep = deep;
this.forEachClass = forEachClass;
Expand Down Expand Up @@ -90,11 +90,11 @@ public void loadClasses(Class<?> source, @Nullable JarFile jar) {
if (jar != null) { // load from jar if available
classPaths = jar.stream()
.map(JarEntry::getName)
.collect(Collectors.toUnmodifiableSet());
.collect(Collectors.toSet());
} else {
classPaths = ClassPath.from(source.getClassLoader()).getResources().stream()
.map(ResourceInfo::getResourceName)
.collect(Collectors.toUnmodifiableSet());
.collect(Collectors.toSet());
}
} catch (IOException e) {
throw new RuntimeException("Failed to load classes: " + e);
Expand Down

0 comments on commit 8998a2e

Please sign in to comment.