Use Java 11 methods where possible (#6700)

This commit is contained in:
Basil Crow authored and GitHub committed 2022-06-30 09:31:36 -07:00
1 parent 1a6d9f079d
commit 6d179998e1
148 files changed
+419 -527

No files matched your search

+2 -2
View File
@@ -174,7 +174,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
private final List<Dependency> optionalDependencies;
public List<String> getDependencyErrors() {
return Collections.unmodifiableList(new ArrayList<>(dependencyErrors.keySet()));
return List.copyOf(dependencyErrors.keySet());
}
@Restricted(NoExternalUse.class) // Jelly use
@@ -222,7 +222,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
* The core can depend on a plugin if it is bundled. Sometimes it's the only thing that
* depends on the plugin e.g. UI support library bundle plugin.
*/
private static Set<String> CORE_ONLY_DEPENDANT = Collections.singleton("jenkins-core");
private static Set<String> CORE_ONLY_DEPENDANT = Set.of("jenkins-core");
/**
* Set the list of components that depend on this plugin.