From fc79424a1995fecb64c98aff184a9e8394526ca6 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 7 Apr 2018 13:19:07 +0300 Subject: [PATCH] IntelliJ code inspection clean up --- .../database/DBNoDataException.java | 16 ------------- .../manage/ManageConDebugCommand.java | 4 +--- .../databases/sql/tables/TransferTable.java | 11 --------- .../databases/sql/tables/UserIDTable.java | 5 +--- .../databases/sql/tables/WorldTimesTable.java | 4 ---- .../system/info/connection/ConnectionLog.java | 4 ++-- .../system/info/connection/ConnectionOut.java | 1 - .../request/CacheAnalysisPageRequest.java | 5 ---- .../info/request/CacheInspectPageRequest.java | 5 ---- .../CacheInspectPluginsTabRequest.java | 5 ---- .../CacheNetworkPageContentRequest.java | 7 +----- .../info/request/CheckConnectionRequest.java | 5 ---- .../request/GenerateAnalysisPageRequest.java | 5 ---- .../request/GenerateInspectPageRequest.java | 5 ---- .../GenerateInspectPluginsTabRequest.java | 5 ---- .../GenerateNetworkPageContentRequest.java | 5 ---- .../plan/system/info/request/InfoRequest.java | 2 -- .../info/request/SaveDBSettingsRequest.java | 5 ---- .../info/request/SendDBSettingsRequest.java | 5 ---- .../listeners/BungeeListenerSystem.java | 2 +- .../bungee/PlayerOnlineListener.java | 7 ------ .../PlayerProfileNameComparator.java | 23 ------------------- 22 files changed, 6 insertions(+), 130 deletions(-) delete mode 100644 Plan/src/main/java/com/djrapitops/plan/api/exceptions/database/DBNoDataException.java delete mode 100644 Plan/src/main/java/com/djrapitops/plan/utilities/comparators/PlayerProfileNameComparator.java diff --git a/Plan/src/main/java/com/djrapitops/plan/api/exceptions/database/DBNoDataException.java b/Plan/src/main/java/com/djrapitops/plan/api/exceptions/database/DBNoDataException.java deleted file mode 100644 index 71effcbe45..0000000000 --- a/Plan/src/main/java/com/djrapitops/plan/api/exceptions/database/DBNoDataException.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.djrapitops.plan.api.exceptions.database; - -public class DBNoDataException extends DBException { - - public DBNoDataException(String message, Throwable cause) { - super(message, cause); - } - - public DBNoDataException(Throwable cause) { - super(cause); - } - - public DBNoDataException(String message) { - super(message); - } -} diff --git a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageConDebugCommand.java b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageConDebugCommand.java index 82d81b8602..fe403ad9d9 100644 --- a/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageConDebugCommand.java +++ b/Plan/src/main/java/com/djrapitops/plan/command/commands/manage/ManageConDebugCommand.java @@ -54,9 +54,7 @@ public boolean onCommand(ISender sender, String commandLabel, String[] args) { return true; } - Processing.submitNonCritical(() -> { - testServers(sender); - }); + Processing.submitNonCritical(() -> testServers(sender)); return true; } diff --git a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/TransferTable.java b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/TransferTable.java index aa9ca928c2..8562488104 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/TransferTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/TransferTable.java @@ -35,23 +35,12 @@ public class TransferTable extends Table { private final String insertStatementNoParts; private final ServerTable serverTable; - private final String insertStatementParts; private final String selectStatement; public TransferTable(SQLDB db) { super("plan_transfer", db); serverTable = db.getServerTable(); - insertStatementParts = "REPLACE INTO " + tableName + " (" + - Col.SENDER_ID + ", " + - Col.EXPIRY + ", " + - Col.INFO_TYPE + ", " + - Col.EXTRA_VARIABLES + ", " + - Col.CONTENT + ", " + - Col.PART + - ") VALUES (" + - serverTable.statementSelectServerID + ", " + - "?, ?, ?, ?, ?)"; insertStatementNoParts = "REPLACE INTO " + tableName + " (" + Col.SENDER_ID + ", " + Col.EXPIRY + ", " + diff --git a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/UserIDTable.java b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/UserIDTable.java index 38ca270d63..1c1e4b5119 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/UserIDTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/UserIDTable.java @@ -16,9 +16,6 @@ */ public abstract class UserIDTable extends Table { - @Deprecated - protected final String columnUserID = "user_id"; - public enum Col implements Column { USER_ID("user_id"); @@ -46,7 +43,7 @@ public UserIDTable(String name, SQLDB db) { } public void removeUser(UUID uuid) throws SQLException { - String sql = "DELETE FROM " + tableName + " WHERE (" + columnUserID + "=" + usersTable.statementSelectID + ")"; + String sql = "DELETE FROM " + tableName + " WHERE (" + Col.USER_ID + "=" + usersTable.statementSelectID + ")"; execute(new ExecStatement(sql) { @Override diff --git a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/WorldTimesTable.java b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/WorldTimesTable.java index 7367c34a65..16a8ae5088 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/WorldTimesTable.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/database/databases/sql/tables/WorldTimesTable.java @@ -204,10 +204,6 @@ public WorldTimes processResults(ResultSet set) throws SQLException { }); } - public WorldTimes getWorldTimesOfServer() throws SQLException { - return getWorldTimesOfServer(ServerInfo.getServerUUID()); - } - public WorldTimes getWorldTimesOfUser(UUID uuid) throws SQLException { String worldIDColumn = worldTable + "." + WorldTable.Col.ID; String worldNameColumn = worldTable + "." + WorldTable.Col.NAME + " as world_name"; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionLog.java b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionLog.java index 1bb5ccdb6b..4ede5cfa99 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionLog.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionLog.java @@ -82,8 +82,8 @@ public long getTimeSent() { /** * Most recent first. * - * @param o - * @return + * @param o object + * @return -1 or 1 */ @Override public int compareTo(Entry o) { diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionOut.java b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionOut.java index 18d51f64c3..09d6b7843c 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionOut.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/connection/ConnectionOut.java @@ -106,7 +106,6 @@ public void sendRequest() throws WebException { connection.setRequestProperty("charset", "UTF-8"); String parameters = parseVariables(); - infoRequest.placeDataToDatabase(); connection.setRequestProperty("Content-Length", Integer.toString(parameters.length())); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheAnalysisPageRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheAnalysisPageRequest.java index 5bcdbb057f..8e67c5613e 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheAnalysisPageRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheAnalysisPageRequest.java @@ -46,11 +46,6 @@ public static CacheAnalysisPageRequest createHandler() { return new CacheAnalysisPageRequest(); } - @Override - public void placeDataToDatabase() { - /* Transferred over HTTP */ - } - @Override public Response handleRequest(Map variables) throws WebException { // Available variables: sender, html (Base64) diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPageRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPageRequest.java index 2bb9c93730..e1855733fd 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPageRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPageRequest.java @@ -50,11 +50,6 @@ public static CacheInspectPageRequest createHandler() { return new CacheInspectPageRequest(); } - @Override - public void placeDataToDatabase() { - /* Transferred over HTTP */ - } - @Override public Response handleRequest(Map variables) throws WebException { // Available variables: sender, player, html (Base64) diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPluginsTabRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPluginsTabRequest.java index 45d9c43a83..99b2225d83 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPluginsTabRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheInspectPluginsTabRequest.java @@ -46,11 +46,6 @@ public static CacheInspectPluginsTabRequest createHandler() { return new CacheInspectPluginsTabRequest(); } - @Override - public void placeDataToDatabase() { - /* Transferred over HTTP */ - } - @Override public Response handleRequest(Map variables) throws WebException { // Available variables: sender, player, nav, html diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheNetworkPageContentRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheNetworkPageContentRequest.java index d855996f2f..c8728e3825 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheNetworkPageContentRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CacheNetworkPageContentRequest.java @@ -41,11 +41,6 @@ private CacheNetworkPageContentRequest() { html = null; } - @Override - public void placeDataToDatabase() { - /* Transferred over HTTP */ - } - @Override public Response handleRequest(Map variables) throws WebException { // Available variables: sender, serverName, html (Base64) @@ -69,7 +64,7 @@ private NetworkPageContent getNetworkPageContent() { @Override public void runLocally() { - getNetworkPageContent().addElement(ServerInfo.getServerName(), variables.get("html")); + getNetworkPageContent().addElement(ServerInfo.getServerName(), html); } public static CacheNetworkPageContentRequest createHandler() { diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CheckConnectionRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CheckConnectionRequest.java index d7806842f5..0842ca3704 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/CheckConnectionRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/CheckConnectionRequest.java @@ -39,11 +39,6 @@ public static CheckConnectionRequest createHandler() { return new CheckConnectionRequest(); } - @Override - public void placeDataToDatabase() { - /* Not necessary */ - } - @Override public void runLocally() { /* Won't be run */ diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateAnalysisPageRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateAnalysisPageRequest.java index 37cf23ca05..3116a8e8a9 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateAnalysisPageRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateAnalysisPageRequest.java @@ -44,11 +44,6 @@ private GenerateAnalysisPageRequest() { serverUUID = null; } - @Override - public void placeDataToDatabase() { - // No data required in a Generate request - } - @Override public Response handleRequest(Map variables) throws WebException { // Variables available: sender, server diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateInspectPageRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateInspectPageRequest.java index 786b1bea03..6284d68c03 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateInspectPageRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateInspectPageRequest.java @@ -40,11 +40,6 @@ public static GenerateInspectPageRequest createHandler() { return new GenerateInspectPageRequest(); } - @Override - public void placeDataToDatabase() { - // No data required in a Generate request - } - @Override public Response handleRequest(Map variables) throws WebException { // Available variables: sender, player diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateInspectPluginsTabRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateInspectPluginsTabRequest.java index cc0533389c..dfcf1dae29 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateInspectPluginsTabRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateInspectPluginsTabRequest.java @@ -38,11 +38,6 @@ public static GenerateInspectPluginsTabRequest createHandler() { return new GenerateInspectPluginsTabRequest(); } - @Override - public void placeDataToDatabase() { - // No data required in a Generate request - } - @Override public Response handleRequest(Map variables) throws WebException { // Available variables: sender, player diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateNetworkPageContentRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateNetworkPageContentRequest.java index 33d83d8650..b15796d784 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateNetworkPageContentRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/GenerateNetworkPageContentRequest.java @@ -22,11 +22,6 @@ public static GenerateNetworkPageContentRequest createHandler() { return new GenerateNetworkPageContentRequest(); } - @Override - public void placeDataToDatabase() { - /* No Data needed on a GenerateRequest.*/ - } - @Override public Response handleRequest(Map variables) throws WebException { InfoSystem.getInstance().updateNetworkPage(); diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/InfoRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/InfoRequest.java index 6484c70004..eb4abcdea6 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/InfoRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/InfoRequest.java @@ -16,8 +16,6 @@ */ public interface InfoRequest { - void placeDataToDatabase() throws WebException; - Response handleRequest(Map variables) throws WebException; void runLocally() throws WebException; diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/SaveDBSettingsRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/SaveDBSettingsRequest.java index ef3b2a254b..63a64136c5 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/SaveDBSettingsRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/SaveDBSettingsRequest.java @@ -43,11 +43,6 @@ public static SaveDBSettingsRequest createHandler() { return new SaveDBSettingsRequest(true); } - @Override - public void placeDataToDatabase() { - /* Not necessary */ - } - @Override public void runLocally() { /* Won't be run */ diff --git a/Plan/src/main/java/com/djrapitops/plan/system/info/request/SendDBSettingsRequest.java b/Plan/src/main/java/com/djrapitops/plan/system/info/request/SendDBSettingsRequest.java index 8d33b5c7b9..cf766a6538 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/info/request/SendDBSettingsRequest.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/info/request/SendDBSettingsRequest.java @@ -45,11 +45,6 @@ public static SendDBSettingsRequest createHandler() { return new SendDBSettingsRequest(); } - @Override - public void placeDataToDatabase() { - /* Not necessary */ - } - @Override public void runLocally() { /* Won't be run */ diff --git a/Plan/src/main/java/com/djrapitops/plan/system/listeners/BungeeListenerSystem.java b/Plan/src/main/java/com/djrapitops/plan/system/listeners/BungeeListenerSystem.java index 99e4f6abcf..0b48be7337 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/listeners/BungeeListenerSystem.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/listeners/BungeeListenerSystem.java @@ -13,7 +13,7 @@ public BungeeListenerSystem(PlanBungee plugin) { @Override protected void registerListeners() { - plugin.registerListener(new PlayerOnlineListener(plugin)); + plugin.registerListener(new PlayerOnlineListener()); } @Override diff --git a/Plan/src/main/java/com/djrapitops/plan/system/listeners/bungee/PlayerOnlineListener.java b/Plan/src/main/java/com/djrapitops/plan/system/listeners/bungee/PlayerOnlineListener.java index e2efaeb674..0ddc357093 100644 --- a/Plan/src/main/java/com/djrapitops/plan/system/listeners/bungee/PlayerOnlineListener.java +++ b/Plan/src/main/java/com/djrapitops/plan/system/listeners/bungee/PlayerOnlineListener.java @@ -4,7 +4,6 @@ */ package com.djrapitops.plan.system.listeners.bungee; -import com.djrapitops.plan.PlanBungee; import com.djrapitops.plan.system.processing.Processing; import com.djrapitops.plan.system.processing.processors.player.BungeePlayerRegisterProcessor; import com.djrapitops.plan.utilities.MiscUtils; @@ -23,12 +22,6 @@ */ public class PlayerOnlineListener implements Listener { - private final PlanBungee plugin; - - public PlayerOnlineListener(PlanBungee plugin) { - this.plugin = plugin; - } - @EventHandler public void onPostLogin(PostLoginEvent event) { try { diff --git a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/PlayerProfileNameComparator.java b/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/PlayerProfileNameComparator.java deleted file mode 100644 index 19cae5512d..0000000000 --- a/Plan/src/main/java/com/djrapitops/plan/utilities/comparators/PlayerProfileNameComparator.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package com.djrapitops.plan.utilities.comparators; - -import com.djrapitops.plan.data.PlayerProfile; - -import java.util.Comparator; - -/** - * Comparator for PlayerProfile for Alphabetical Name order. - * - * @author Rsl1122 - */ -public class PlayerProfileNameComparator implements Comparator { - - @Override - public int compare(PlayerProfile u1, PlayerProfile u2) { - return u1.getName().compareTo(u2.getName()); - } -}