diff --git a/Plan/dependency-reduced-pom.xml b/Plan/dependency-reduced-pom.xml index 49e4a1d31..05449f65a 100644 --- a/Plan/dependency-reduced-pom.xml +++ b/Plan/dependency-reduced-pom.xml @@ -59,6 +59,7 @@ + true org.powermock:* @@ -68,7 +69,8 @@ xpp3:* org.objenesis:* cglib:* - org.*:* + org.bukkit:* + org.mockito:* org.easymock:* junit:* @@ -118,6 +120,10 @@ plan-snapshot-repo http://repo.fuzzlemann.de/artifactory/libs-snapshot/ + + bungeecord-repo + https://oss.sonatype.org/content/repositories/snapshots + @@ -126,6 +132,34 @@ 1.12-R0.1-20170725.202533-1 provided + + net.md-5 + bungeecord-api + 1.12-SNAPSHOT + provided + + + bungeecord-chat + net.md-5 + + + bungeecord-config + net.md-5 + + + bungeecord-event + net.md-5 + + + bungeecord-protocol + net.md-5 + + + guava + com.google.guava + + + org.powermock powermock diff --git a/Plan/pom.xml b/Plan/pom.xml index 9f2042a2b..b271b5cdb 100644 --- a/Plan/pom.xml +++ b/Plan/pom.xml @@ -36,6 +36,12 @@ jar provided + + org.apache.commons + commons-lang3 + 3.6 + compile + com.djrapitops @@ -48,16 +54,19 @@ org.apache.commons commons-dbcp2 2.1.1 + compile org.apache.commons commons-pool2 2.4.2 + compile commons-logging commons-logging 1.2 + compile @@ -180,6 +189,7 @@ + true org.powermock:* @@ -189,7 +199,8 @@ xpp3:* org.objenesis:* cglib:* - org.*:* + org.bukkit:* + org.mockito:* org.easymock:* junit:* diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/info/ImporterManager.java b/Plan/src/main/java/com/djrapitops/plan/systems/info/ImporterManager.java index 5d359f9dd..980e84d61 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/info/ImporterManager.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/info/ImporterManager.java @@ -24,8 +24,16 @@ public class ImporterManager { } public static void registerImporter(Importer importer) { + if (importer == null) { + throw new NullPointerException("Importer cannot be null"); + } + String firstName = importer.getNames().get(0); + if (firstName == null) { + throw new IllegalArgumentException("No Importer name given"); + } + if (getImporter(firstName) != null) { removeImporter(firstName); } diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/ServerImportData.java b/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/ServerImportData.java index 3a98e6baa..e06b5d7c8 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/ServerImportData.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/ServerImportData.java @@ -10,6 +10,7 @@ import java.util.*; /** * @author Fuzzlemann + * @since 4.0.0 */ public class ServerImportData { diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/UserImportRefiner.java b/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/UserImportRefiner.java index 2c013c784..8afa969c5 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/UserImportRefiner.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/UserImportRefiner.java @@ -27,7 +27,7 @@ public class UserImportRefiner { private final Plan plugin; private final boolean onlineMode; - private final Vector importers = new Vector<>(); + private final List importers = new Vector<>(); private final Map worlds = new Hashtable<>(); @@ -92,7 +92,7 @@ public class UserImportRefiner { Benchmark.start(benchmarkName); - Vector invalidData = new Vector<>(); + List invalidData = new Vector<>(); importers.parallelStream().forEach(importer -> { String name = importer.getName(); @@ -173,7 +173,7 @@ public class UserImportRefiner { } private void addFoundUUIDs(Map foundUUIDs) { - Vector found = new Vector<>(); + List found = new Vector<>(); uuidsMissing.entrySet().parallelStream().forEach((entry) -> { UserImportData importer = entry.getKey(); @@ -226,7 +226,7 @@ public class UserImportRefiner { } private void addFoundNames(Map foundNames) { - Vector found = new Vector<>(); + List found = new Vector<>(); namesMissing.entrySet().parallelStream().forEach(entry -> { UserImportData importer = entry.getKey(); diff --git a/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/importers/OfflinePlayerImporter.java b/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/importers/OfflinePlayerImporter.java index 07e07b02c..92029d4a0 100644 --- a/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/importers/OfflinePlayerImporter.java +++ b/Plan/src/main/java/com/djrapitops/plan/systems/processing/importing/importers/OfflinePlayerImporter.java @@ -30,7 +30,7 @@ public class OfflinePlayerImporter extends Importer { @Override public List getUserImportData() { - Vector dataList = new Vector<>(); + List dataList = new Vector<>(); Arrays.stream(Bukkit.getOfflinePlayers()).parallel().forEach(player -> { UserImportData.UserImportDataBuilder builder = UserImportData.builder(); diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlUtils.java b/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlUtils.java index 575e186ba..296c66207 100644 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlUtils.java +++ b/Plan/src/main/java/com/djrapitops/plan/utilities/html/HtmlUtils.java @@ -4,7 +4,7 @@ import main.java.com.djrapitops.plan.Plan; import main.java.com.djrapitops.plan.Settings; import main.java.com.djrapitops.plan.systems.webserver.WebServer; import main.java.com.djrapitops.plan.utilities.file.FileUtil; -import org.apache.commons.lang.text.StrSubstitutor; +import org.apache.commons.lang3.text.StrSubstitutor; import java.io.FileNotFoundException; import java.io.Serializable; diff --git a/Plan/test/test/java/main/java/com/djrapitops/plan/ui/graphs/GraphTest.java b/Plan/test/test/java/main/java/com/djrapitops/plan/ui/graphs/GraphTest.java index 523859148..4f5591d8a 100644 --- a/Plan/test/test/java/main/java/com/djrapitops/plan/ui/graphs/GraphTest.java +++ b/Plan/test/test/java/main/java/com/djrapitops/plan/ui/graphs/GraphTest.java @@ -55,15 +55,13 @@ public class GraphTest { @Test public void testSeriesCreator() { - String result = SeriesCreator.seriesGraph(points, false, false); + String result = SeriesCreator.seriesGraph(points, false, false).replaceAll("[\\[\\]]", ""); String[] splittedResult = result.split(","); Map expected = new LinkedHashMap<>(); String key = null; for (String resultString : splittedResult) { - resultString = resultString.replaceAll("[\\[\\]]", ""); - if (key == null) { key = resultString; } else {