From ab99ed1976d3a7dbaf60dc7f1725f870b0b5feb5 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Tue, 8 Jan 2019 11:10:50 +0200 Subject: [PATCH] Fixed compile warning in PluginPlayersTable --- .../html/tables/PluginPlayersTable.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/utilities/html/tables/PluginPlayersTable.java b/Plan/common/src/main/java/com/djrapitops/plan/utilities/html/tables/PluginPlayersTable.java index 4fdcd0630..c68499443 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/utilities/html/tables/PluginPlayersTable.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/utilities/html/tables/PluginPlayersTable.java @@ -24,7 +24,6 @@ import com.djrapitops.plan.data.store.containers.PlayerContainer; import com.djrapitops.plan.data.store.keys.PlayerKeys; import com.djrapitops.plan.utilities.html.Html; import com.djrapitops.plugin.utilities.ArrayUtil; -import org.apache.commons.lang3.ArrayUtils; import java.io.Serializable; import java.util.*; @@ -67,7 +66,7 @@ class PluginPlayersTable extends TableContainer { if (players.isEmpty()) { addRow("No Players"); } else { - Map rows = getRows(pluginDataSet); + Map rows = getRows(pluginDataSet); addValues(rows); } } @@ -89,7 +88,7 @@ class PluginPlayersTable extends TableContainer { return data; } - private void addValues(Map rows) { + private void addValues(Map rows) { int i = 0; for (PlayerContainer profile : players) { if (i >= maxPlayers) { @@ -101,30 +100,28 @@ class PluginPlayersTable extends TableContainer { Html link = openPlayerPageInNewTab ? Html.LINK_EXTERNAL : Html.LINK; String linkHtml = link.parse(PlanAPI.getInstance().getPlayerInspectPageLink(name), name); - String[] playerData = ArrayUtil.merge(new String[]{linkHtml}, rows.getOrDefault(uuid, new String[]{})); - addRow(ArrayUtils.addAll(playerData)); + Serializable[] playerData = ArrayUtil.merge(new Serializable[]{linkHtml}, rows.getOrDefault(uuid, new Serializable[]{})); + addRow(playerData); i++; } } - private Map getRows(TreeMap> data) { - Map rows = new HashMap<>(); + private Map getRows(TreeMap> data) { + Map rows = new HashMap<>(); int size = header.length - 1; for (PlayerContainer profile : players) { UUID uuid = profile.getUnsafe(PlayerKeys.UUID); - String[] row = new String[size]; + Serializable[] row = new Serializable[size]; for (int i = 0; i < size; i++) { String label = header[i + 1]; Map playerSpecificData = data.getOrDefault(label, new HashMap<>()); Serializable value = playerSpecificData.get(uuid); if (value != null) { - row[i] = value.toString(); - } else { - row[i] = "-"; + row[i] = value; } } rows.put(uuid, row);