From 5d8492b6758ba8f55ee471354ee8a7fb3cd3ce1d Mon Sep 17 00:00:00 2001 From: Paulomart Date: Thu, 5 May 2016 19:13:55 +0200 Subject: [PATCH] Fixes cast exception --- .../com/intellectualcrafters/plot/commands/Database.java | 5 +++-- .../java/com/intellectualcrafters/plot/commands/Visit.java | 2 +- .../com/intellectualcrafters/plot/database/AbstractDB.java | 2 +- .../java/com/intellectualcrafters/plot/database/DBFunc.java | 2 +- .../com/intellectualcrafters/plot/database/SQLManager.java | 6 +++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Database.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Database.java index 3f5756854..e45b01a5d 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Database.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Database.java @@ -18,6 +18,7 @@ import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import java.util.Map.Entry; @CommandDeclaration( @@ -30,7 +31,7 @@ import java.util.Map.Entry; usage = "/plots database [area] ") public class Database extends SubCommand { - public static void insertPlots(final SQLManager manager, final ArrayList plots, final PlotPlayer player) { + public static void insertPlots(final SQLManager manager, final List plots, final PlotPlayer player) { TaskManager.runTaskAsync(new Runnable() { @Override public void run() { @@ -61,7 +62,7 @@ public class Database extends SubCommand { MainUtil.sendMessage(player, "/plot database [area] "); return false; } - ArrayList plots; + List plots; PlotArea area = PS.get().getPlotAreaByString(args[0]); if (area != null) { plots = PS.get().sortPlotsByTemp(area.getPlots()); diff --git a/Core/src/main/java/com/intellectualcrafters/plot/commands/Visit.java b/Core/src/main/java/com/intellectualcrafters/plot/commands/Visit.java index c00b20a34..b749580e6 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/commands/Visit.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/commands/Visit.java @@ -92,7 +92,7 @@ public class Visit extends SubCommand { sendMessage(player, C.NOT_VALID_NUMBER, "(1, " + unsorted.size() + ")"); return false; } - ArrayList plots = PS.get().sortPlotsByTemp(unsorted); + List plots = PS.get().sortPlotsByTemp(unsorted); Plot plot = plots.get(page - 1); if (!plot.hasOwner()) { if (!Permissions.hasPermission(player, "plots.visit.unowned")) { diff --git a/Core/src/main/java/com/intellectualcrafters/plot/database/AbstractDB.java b/Core/src/main/java/com/intellectualcrafters/plot/database/AbstractDB.java index bc27bf59e..428ae7d49 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/database/AbstractDB.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/database/AbstractDB.java @@ -36,7 +36,7 @@ public interface AbstractDB { * @param plots Plots for which the default table entries should be created * @param whenDone */ - void createPlotsAndData(ArrayList plots, Runnable whenDone); + void createPlotsAndData(List plots, Runnable whenDone); /** * Create a plot diff --git a/Core/src/main/java/com/intellectualcrafters/plot/database/DBFunc.java b/Core/src/main/java/com/intellectualcrafters/plot/database/DBFunc.java index 473cd6c46..fe57e3cc4 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/database/DBFunc.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/database/DBFunc.java @@ -81,7 +81,7 @@ public class DBFunc { * * @param plots List containing all plot objects */ - public static void createPlotsAndData(ArrayList plots, Runnable whenDone) { + public static void createPlotsAndData(List plots, Runnable whenDone) { DBFunc.dbManager.createPlotsAndData(plots, whenDone); } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java b/Core/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java index dbe9c2231..e0199104d 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/database/SQLManager.java @@ -436,7 +436,7 @@ public class SQLManager implements AbstractDB { } @Override - public void createPlotsAndData(final ArrayList myList, final Runnable whenDone) { + public void createPlotsAndData(final List myList, final Runnable whenDone) { addGlobalTask(new Runnable() { @Override public void run() { @@ -580,7 +580,7 @@ public class SQLManager implements AbstractDB { * * @param myList list of plots to be created */ - public void createPlots(ArrayList myList, Runnable whenDone) { + public void createPlots(List myList, Runnable whenDone) { StmtMod mod = new StmtMod() { @Override public String getCreateMySQL(int size) { @@ -638,7 +638,7 @@ public class SQLManager implements AbstractDB { setBulk(myList, mod, whenDone); } - public void setBulk(ArrayList objList, StmtMod mod, Runnable whenDone) { + public void setBulk(List objList, StmtMod mod, Runnable whenDone) { int size = objList.size(); if (size == 0) { if (whenDone != null) {