Fix duplicate plugins in the plugin tree after update

This commit is contained in:
Sebastian Sdorra
2020-08-11 09:46:00 +02:00
parent 86e13db492
commit 65da3cc710
7 changed files with 247 additions and 19 deletions

View File

@@ -31,6 +31,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.file.Path;
import java.util.Objects;
//~--- JDK imports ------------------------------------------------------------
@@ -105,6 +106,25 @@ public final class ExplodedSmp
return plugin;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ExplodedSmp that = (ExplodedSmp) o;
return path.equals(that.path);
}
@Override
public int hashCode() {
return Objects.hash(path);
}
@Override
public String toString() {
PluginInformation information = plugin.getInformation();
return information.getName() + "@" + information.getVersion() + " (" + path + ")";
}
//~--- inner classes --------------------------------------------------------
/**