From 95bd33e3c48cb92180480e5f2d8f13c849ad4b48 Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sun, 11 Nov 2018 21:38:27 +0200 Subject: [PATCH] Commented on empty blocks --- .../com/djrapitops/plan/system/cache/DataCache.java | 1 + .../plan/system/database/databases/sql/H2DB.java | 13 ++++++------- .../system/database/databases/sql/SQLiteDB.java | 13 ++++++------- .../djrapitops/plan/system/export/ExportSystem.java | 2 +- .../plan/system/importing/EmptyImportSystem.java | 1 + .../plan/system/settings/theme/Theme.java | 2 +- .../plan/system/tasks/PlayersPageRefreshTask.java | 1 + .../djrapitops/plan/system/webserver/WebServer.java | 2 +- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/cache/DataCache.java b/Plan/common/src/main/java/com/djrapitops/plan/system/cache/DataCache.java index fdca8ef14..07601aaab 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/cache/DataCache.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/cache/DataCache.java @@ -64,6 +64,7 @@ public class DataCache extends SessionCache implements SubSystem { @Override public void enable() { + // Nothing to enable } @Override diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/H2DB.java b/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/H2DB.java index e155d0f32..0461de6cc 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/H2DB.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/H2DB.java @@ -111,13 +111,10 @@ public class H2DB extends SQLDB { private void startConnectionPingTask() { stopConnectionPingTask(); - try { - // Maintains Connection. - connectionPingTask = runnableFactory.create("DBConnectionPingTask " + getType().getName(), - new KeepAliveTask(connection, () -> getNewConnection(databaseFile), logger, errorHandler) - ).runTaskTimerAsynchronously(60L * 20L, 60L * 20L); - } catch (Exception ignored) { - } + // Maintains Connection. + connectionPingTask = runnableFactory.create("DBConnectionPingTask " + getType().getName(), + new KeepAliveTask(connection, () -> getNewConnection(databaseFile), logger, errorHandler) + ).runTaskTimerAsynchronously(60L * 20L, 60L * 20L); } private void stopConnectionPingTask() { @@ -125,6 +122,8 @@ public class H2DB extends SQLDB { try { connectionPingTask.cancel(); } catch (Exception ignored) { + // Sometimes task systems fail to cancel a task, + // usually this is called on disable, so no need for users to report this. } } } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/SQLiteDB.java b/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/SQLiteDB.java index 0e5930e3d..10869df52 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/SQLiteDB.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/database/databases/sql/SQLiteDB.java @@ -104,13 +104,10 @@ public class SQLiteDB extends SQLDB { private void startConnectionPingTask() { stopConnectionPingTask(); - try { - // Maintains Connection. - connectionPingTask = runnableFactory.create("DBConnectionPingTask " + getType().getName(), - new KeepAliveTask(connection, () -> getNewConnection(databaseFile), logger, errorHandler) - ).runTaskTimerAsynchronously(60L * 20L, 60L * 20L); - } catch (Exception ignored) { - } + // Maintains Connection. + connectionPingTask = runnableFactory.create("DBConnectionPingTask " + getType().getName(), + new KeepAliveTask(connection, () -> getNewConnection(databaseFile), logger, errorHandler) + ).runTaskTimerAsynchronously(60L * 20L, 60L * 20L); } private void stopConnectionPingTask() { @@ -118,6 +115,8 @@ public class SQLiteDB extends SQLDB { try { connectionPingTask.cancel(); } catch (Exception ignored) { + // Sometimes task systems fail to cancel a task, + // usually this is called on disable, so no need for users to report this. } } } diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/export/ExportSystem.java b/Plan/common/src/main/java/com/djrapitops/plan/system/export/ExportSystem.java index cbcf11655..6084ceab7 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/export/ExportSystem.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/export/ExportSystem.java @@ -57,6 +57,6 @@ public class ExportSystem implements SubSystem { @Override public void disable() { - + // Nothing to disable } } \ No newline at end of file diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/importing/EmptyImportSystem.java b/Plan/common/src/main/java/com/djrapitops/plan/system/importing/EmptyImportSystem.java index 89feab12e..f2f4e76f6 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/importing/EmptyImportSystem.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/importing/EmptyImportSystem.java @@ -29,6 +29,7 @@ public class EmptyImportSystem extends ImportSystem { @Inject public EmptyImportSystem() { + // Inject constructor required for dagger } @Override diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java index e8a3d8b1b..46426f7c3 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/settings/theme/Theme.java @@ -65,7 +65,7 @@ public class Theme implements SubSystem { @Override public void disable() { - + // No need to save theme on disable } private String getColor(ThemeVal variable) { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/tasks/PlayersPageRefreshTask.java b/Plan/common/src/main/java/com/djrapitops/plan/system/tasks/PlayersPageRefreshTask.java index 33f42ffa1..852b77fd6 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/tasks/PlayersPageRefreshTask.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/tasks/PlayersPageRefreshTask.java @@ -28,6 +28,7 @@ public class PlayersPageRefreshTask extends AbsRunnable { @Inject public PlayersPageRefreshTask() { + // Inject constructor required for dagger } @Override diff --git a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/WebServer.java b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/WebServer.java index a030ec142..1141ebdf3 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/WebServer.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/system/webserver/WebServer.java @@ -277,7 +277,7 @@ public class WebServer implements SubSystem { } public boolean isAuthRequired() { - return usingHttps; + return isUsingHTTPS(); } public String getAccessAddress() {