mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-01-30 16:19:56 +08:00
Fix Map#keyset()#remove bug detected by sonar
This commit is contained in:
parent
c2b2b5635e
commit
3119f35cb6
@ -166,10 +166,12 @@ public class NetworkSettingManager implements SubSystem {
|
|||||||
private void updateConfigFromDBIfUpdated() {
|
private void updateConfigFromDBIfUpdated() {
|
||||||
Database database = dbSystem.getDatabase();
|
Database database = dbSystem.getDatabase();
|
||||||
Set<ServerUUID> serverUUIDs = database.query(ServerQueries.fetchPlanServerInformation()).keySet();
|
Set<ServerUUID> serverUUIDs = database.query(ServerQueries.fetchPlanServerInformation()).keySet();
|
||||||
// Remove the proxy server from the list
|
|
||||||
serverUUIDs.remove(serverInfo.getServerUUID());
|
|
||||||
|
|
||||||
for (ServerUUID serverUUID : serverUUIDs) {
|
for (ServerUUID serverUUID : serverUUIDs) {
|
||||||
|
// Remove the proxy server on the list
|
||||||
|
if (serverUUID.equals(serverInfo.getServerUUID())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
updateConfigFromDBIfUpdated(database, serverUUID);
|
updateConfigFromDBIfUpdated(database, serverUUID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -201,8 +203,8 @@ public class NetworkSettingManager implements SubSystem {
|
|||||||
Database database = dbSystem.getDatabase();
|
Database database = dbSystem.getDatabase();
|
||||||
|
|
||||||
try (ConfigReader reader = new ConfigReader(file.toPath())) {
|
try (ConfigReader reader = new ConfigReader(file.toPath())) {
|
||||||
Config config = reader.read();
|
Config serverConfig = reader.read();
|
||||||
database.executeTransaction(new StoreConfigTransaction(serverUUID, config, file.lastModified()));
|
database.executeTransaction(new StoreConfigTransaction(serverUUID, serverConfig, file.lastModified()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new UncheckedIOException(e);
|
throw new UncheckedIOException(e);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user