diff --git a/plugin-modernizer-cli/src/main/java/io/jenkins/tools/pluginmodernizer/cli/Main.java b/plugin-modernizer-cli/src/main/java/io/jenkins/tools/pluginmodernizer/cli/Main.java index c2805435..c07c42d7 100644 --- a/plugin-modernizer-cli/src/main/java/io/jenkins/tools/pluginmodernizer/cli/Main.java +++ b/plugin-modernizer-cli/src/main/java/io/jenkins/tools/pluginmodernizer/cli/Main.java @@ -4,9 +4,8 @@ import java.net.URL; import java.nio.file.Path; import java.util.ArrayList; -import java.util.LinkedHashSet; import java.util.List; -import java.util.Set; +import java.util.stream.Collectors; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.dataformat.yaml.YAMLMapper; @@ -124,8 +123,9 @@ private List loadPlugins() { loadedPlugins.addAll(plugins); } - Set uniquePlugins = new LinkedHashSet<>(loadedPlugins); - return new ArrayList<>(uniquePlugins); + return loadedPlugins.stream() + .distinct() + .collect(Collectors.toCollection(ArrayList::new)); } @Override