mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
Use Java 11 methods where possible (#6700)
This commit is contained in:
1 parent
1a6d9f079d
commit
6d179998e1
148 files changed
+419
-527
No files matched your search
@@ -560,7 +560,7 @@ public abstract class ExtensionFinder implements ExtensionPoint {
|
||||
}
|
||||
|
||||
public List<IndexItem<?, Object>> getLoadedIndex() {
|
||||
return Collections.unmodifiableList(new ArrayList<>(loadedIndex));
|
||||
return List.copyOf(loadedIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -645,7 +645,7 @@ public abstract class ExtensionFinder implements ExtensionPoint {
|
||||
// 5. dead lock
|
||||
if (indices == null) {
|
||||
ClassLoader cl = Jenkins.get().getPluginManager().uberClassLoader;
|
||||
indices = Collections.unmodifiableList(StreamSupport.stream(Index.load(Extension.class, Object.class, cl).spliterator(), false).collect(Collectors.toList()));
|
||||
indices = StreamSupport.stream(Index.load(Extension.class, Object.class, cl).spliterator(), false).collect(Collectors.toUnmodifiableList());
|
||||
}
|
||||
return indices;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user