Fixed some IntelliJ inspection things

This commit is contained in:
Rsl1122 2018-05-25 12:26:14 +03:00
parent f2cdd3804b
commit 2b19983055
15 changed files with 18 additions and 21 deletions

View File

@ -29,7 +29,7 @@ public class ManageCommand extends TreeCmdNode {
new ManageRestoreCommand(plugin),
new ManageRemoveCommand(),
new ManageHotSwapCommand(plugin),
new ManageClearCommand(plugin),
new ManageClearCommand(),
},
new CommandNode[]{
new ManageSetupCommand(),

View File

@ -33,7 +33,6 @@ public class RegisterCommand extends CommandNode {
private final String notEnoughArgsMsg;
private final String hashErrorMsg;
private final String permLvlErrorMsg;
public RegisterCommand() {
// No Permission Requirement
@ -47,7 +46,6 @@ public class RegisterCommand extends CommandNode {
notEnoughArgsMsg = Locale.get(Msg.CMD_FAIL_REQ_ARGS).parse("(3) " + Arrays.toString(getArguments()));
hashErrorMsg = "§cPassword hash error.";
permLvlErrorMsg = "§cIncorrect perm level, not a number: ";
}
@Override

View File

@ -1,6 +1,5 @@
package com.djrapitops.plan.command.commands.manage;
import com.djrapitops.plan.PlanPlugin;
import com.djrapitops.plan.api.exceptions.database.DBException;
import com.djrapitops.plan.api.exceptions.database.DBInitException;
import com.djrapitops.plan.api.exceptions.database.FatalDBException;
@ -25,14 +24,11 @@ import com.djrapitops.plugin.utilities.Verify;
*/
public class ManageClearCommand extends CommandNode {
private final PlanPlugin plugin;
public ManageClearCommand(PlanPlugin plugin) {
public ManageClearCommand() {
super("clear", Permissions.MANAGE.getPermission(), CommandType.PLAYER_OR_ARGS);
setShortHelp(Locale.get(Msg.CMD_USG_MANAGE_CLEAR).toString());
setArguments("<DB>", "[-a]");
setInDepthHelp(Locale.get(Msg.CMD_HELP_MANAGE_CLEAR).toArray());
this.plugin = plugin;
}

View File

@ -30,13 +30,13 @@ import java.util.UUID;
*/
public final class AnalysisContainer extends InspectContainer {
private TreeMap<String, Map<UUID, ? extends Serializable>> playerTableValues;
private Map<String, Map<UUID, ? extends Serializable>> playerTableValues;
public AnalysisContainer() {
playerTableValues = new TreeMap<>();
}
public TreeMap<String, Map<UUID, ? extends Serializable>> getPlayerTableValues() {
public Map<String, Map<UUID, ? extends Serializable>> getPlayerTableValues() {
return playerTableValues;
}

View File

@ -30,8 +30,7 @@ import com.djrapitops.plugin.api.utility.log.Log;
public class BukkitSystem extends PlanSystem implements ServerSystem {
public BukkitSystem(Plan plugin) {
testSystem = this;
setTestSystem(this);
Log.setErrorManager(new PlanErrorManager());

View File

@ -29,7 +29,7 @@ import com.djrapitops.plugin.api.utility.log.Log;
public class BungeeSystem extends PlanSystem {
public BungeeSystem(PlanBungee plugin) {
testSystem = this;
setTestSystem(this);
Log.setErrorManager(new PlanErrorManager());

View File

@ -196,4 +196,8 @@ public abstract class PlanSystem implements SubSystem {
public Processing getProcessing() {
return processing;
}
static void setTestSystem(PlanSystem testSystem) {
PlanSystem.testSystem = testSystem;
}
}

View File

@ -32,7 +32,7 @@ public class SpongeSystem extends PlanSystem implements ServerSystem {
private boolean firstInstall = false;
public SpongeSystem(PlanSponge plugin) {
testSystem = this;
setTestSystem(this);
Log.setErrorManager(new PlanErrorManager());

View File

@ -29,7 +29,7 @@ public class SessionCache {
}
public static SessionCache getInstance() {
DataCache dataCache = CacheSystem.getInstance().getDataCache();
SessionCache dataCache = CacheSystem.getInstance().getDataCache();
Verify.nullCheck(dataCache, () -> new IllegalStateException("Data Cache was not initialized."));
return dataCache;
}

View File

@ -373,7 +373,7 @@ public abstract class SQLDB extends Database {
}
public boolean isUsingMySQL() {
return this instanceof MySQLDB;
return usingMySQL;
}
@Override

View File

@ -760,7 +760,7 @@ public class SessionsTable extends UserIDTable {
return query(new QueryAllStatement<Map<Integer, Integer>>(sql, 10000) {
@Override
public Map<Integer, Integer> processResults(ResultSet set) throws SQLException {
HashMap<Integer, Integer> idServerIdMap = new HashMap<>();
Map<Integer, Integer> idServerIdMap = new HashMap<>();
while (set.next()) {
idServerIdMap.put(set.getInt(Col.ID.get()), set.getInt(Col.SERVER_ID.get()));
}

View File

@ -310,7 +310,7 @@ public class WorldTable extends Table {
return query(new QueryAllStatement<Map<Integer, List<Integer>>>(sql, 100) {
@Override
public Map<Integer, List<Integer>> processResults(ResultSet set) throws SQLException {
HashMap<Integer, List<Integer>> map = new HashMap<>();
Map<Integer, List<Integer>> map = new HashMap<>();
while (set.next()) {
int serverID = set.getInt(Col.SERVER_ID.get());

View File

@ -185,7 +185,7 @@ public class DebugPageResponse extends ErrorResponse {
try {
content.append("<pre>### Logged Errors<br>");
TreeMap<String, List<String>> errors = ErrorLogger.getLoggedErrors(PlanPlugin.getInstance());
SortedMap<String, List<String>> errors = ErrorLogger.getLoggedErrors(PlanPlugin.getInstance());
if (!errors.isEmpty()) {
List<String> errorLines = new ArrayList<>();

View File

@ -28,7 +28,7 @@ public class ActionsTable extends TableContainer {
}
}
private void addValues(List<Action> actions) {
private void addValues(Iterable<Action> actions) {
int i = 0;
for (Action action : actions) {
if (i > 50) {

View File

@ -85,7 +85,7 @@ public class PlayersTableCreator {
return html.toString();
}
public static String createPluginsTable(Map<PluginData, AnalysisContainer> containers, List<PlayerProfile> players) {
public static String createPluginsTable(Map<PluginData, AnalysisContainer> containers, Collection<PlayerProfile> players) {
TreeMap<String, Map<UUID, ? extends Serializable>> data = new TreeMap<>();
for (AnalysisContainer container : containers.values()) {
if (!container.hasPlayerTableValues()) {