Fixed sonar smells:

Level major:
- Specified exception in ServerServerInfo

Level minor:
- Unnecessary parentheses removed in BukkitUserImportRefiner

Level info:
- Removed DataCache
- Finished a todo in H2DB
This commit is contained in:
Rsl1122 2019-02-19 12:56:12 +02:00
parent ee50ebde2c
commit 1e87145767
4 changed files with 3 additions and 39 deletions

View File

@ -157,7 +157,7 @@ public class BukkitUserImportRefiner {
private void addFoundUUIDs(Map<String, String> foundUUIDs) {
List<UserImportData> found = new ArrayList<>();
missingUUIDs.entrySet().parallelStream().forEach((entry) -> {
missingUUIDs.entrySet().parallelStream().forEach(entry -> {
UserImportData importer = entry.getKey();
String name = entry.getValue();

View File

@ -75,7 +75,6 @@ public class H2DB extends SQLDB {
throw new DBInitException(e.getMessage(), e);
}
// TODO Figure out if execute("SET REFERENTIAL_INTEGRITY FALSE"); is required
startConnectionPingTask();
}

View File

@ -1,36 +0,0 @@
/*
* This file is part of Player Analytics (Plan).
*
* Plan is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License v3 as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Plan is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Plan. If not, see <https://www.gnu.org/licenses/>.
*/
package com.djrapitops.plan.system.cache;
import javax.inject.Inject;
import javax.inject.Singleton;
/**
* This class is present to not break compiling as some PlanPluginBridge dagger components inject DataCache.
*
* @author Rsl1122
*/
@Singleton
@Deprecated
public class DataCache {
@Inject
public DataCache() {
// Dagger requires an Inject constructor.
}
}

View File

@ -33,6 +33,7 @@ import javax.inject.Singleton;
import java.io.IOException;
import java.util.Optional;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
/**
* Manages the Server UUID for Bukkit servers.
@ -120,7 +121,7 @@ public class ServerServerInfo extends ServerInfo {
return registerServer(generateNewUUID());
}
private Server registerServer(UUID serverUUID) throws Exception {
private Server registerServer(UUID serverUUID) throws ExecutionException, InterruptedException, IOException {
Database db = dbSystem.getDatabase();
// Create the server object