From 29ed30a52736bd32e84a0855654dcd59ab436671 Mon Sep 17 00:00:00 2001 From: Alexandre Fillatre Date: Sun, 3 Apr 2022 09:45:22 +0200 Subject: [PATCH] Some more cleanup --- .../src/main/java/se/kth/depclean/core/AbstractDebloater.java | 4 ++-- .../kth/depclean/core/wrapper/DependencyManagerWrapper.java | 3 +-- .../src/main/java/se/kth/depclean/util/MavenDebloater.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/depclean-core/src/main/java/se/kth/depclean/core/AbstractDebloater.java b/depclean-core/src/main/java/se/kth/depclean/core/AbstractDebloater.java index ea017a8d..fa2dd6af 100644 --- a/depclean-core/src/main/java/se/kth/depclean/core/AbstractDebloater.java +++ b/depclean-core/src/main/java/se/kth/depclean/core/AbstractDebloater.java @@ -24,7 +24,7 @@ public void write() throws IOException { log.info("Starting debloating file"); logChanges(); setDependencies(analysis.getDebloatedDependencies().stream() - .map(this::toMavenDependency) + .map(this::toProviderDependency) .collect(Collectors.toList())); if (log.isDebugEnabled()) { @@ -34,7 +34,7 @@ public void write() throws IOException { writeFile(); } - protected abstract T toMavenDependency(DebloatedDependency debloatedDependency); + protected abstract T toProviderDependency(DebloatedDependency debloatedDependency); protected abstract void setDependencies(List dependencies); diff --git a/depclean-core/src/main/java/se/kth/depclean/core/wrapper/DependencyManagerWrapper.java b/depclean-core/src/main/java/se/kth/depclean/core/wrapper/DependencyManagerWrapper.java index eb07ed61..498da31f 100644 --- a/depclean-core/src/main/java/se/kth/depclean/core/wrapper/DependencyManagerWrapper.java +++ b/depclean-core/src/main/java/se/kth/depclean/core/wrapper/DependencyManagerWrapper.java @@ -2,7 +2,6 @@ import java.io.File; import java.io.IOException; -import java.io.Serializable; import java.nio.file.Path; import java.util.Set; import se.kth.depclean.core.AbstractDebloater; @@ -70,7 +69,7 @@ public interface DependencyManagerWrapper { * @param analysis the depclean analysis * @return the debloater */ - AbstractDebloater getDebloater(ProjectDependencyAnalysis analysis); + AbstractDebloater getDebloater(ProjectDependencyAnalysis analysis); /** * The build directory path. diff --git a/depclean-maven-plugin/src/main/java/se/kth/depclean/util/MavenDebloater.java b/depclean-maven-plugin/src/main/java/se/kth/depclean/util/MavenDebloater.java index c9dc78f8..f5f80dfa 100644 --- a/depclean-maven-plugin/src/main/java/se/kth/depclean/util/MavenDebloater.java +++ b/depclean-maven-plugin/src/main/java/se/kth/depclean/util/MavenDebloater.java @@ -51,7 +51,7 @@ protected void logDependencies() { } @Override - protected Dependency toMavenDependency(DebloatedDependency debloatedDependency) { + protected Dependency toProviderDependency(DebloatedDependency debloatedDependency) { final Dependency dependency = createDependency(debloatedDependency); debloatedDependency.getExclusions().forEach(depToExclude -> exclude(dependency, depToExclude)); return dependency;