Removed DataCache#getUUIDof - the cache was never updated

This commit is contained in:
Rsl1122 2019-02-02 09:11:24 +02:00
parent e2507c249b
commit 48ec77c30e
3 changed files with 2 additions and 25 deletions

View File

@ -45,7 +45,6 @@ public class DataCache extends SessionCache implements SubSystem {
private final ErrorHandler errorHandler; private final ErrorHandler errorHandler;
private final Map<String, UUID> uuids;
private final Map<UUID, String> displayNames; private final Map<UUID, String> displayNames;
@Inject @Inject
@ -56,7 +55,6 @@ public class DataCache extends SessionCache implements SubSystem {
super(dbSystem); super(dbSystem);
this.errorHandler = errorHandler; this.errorHandler = errorHandler;
displayNames = new HashMap<>(); displayNames = new HashMap<>();
uuids = new HashMap<>();
} }
@Override @Override
@ -66,7 +64,6 @@ public class DataCache extends SessionCache implements SubSystem {
@Override @Override
public void disable() { public void disable() {
uuids.clear();
displayNames.clear(); displayNames.clear();
} }
@ -105,8 +102,4 @@ public class DataCache extends SessionCache implements SubSystem {
} }
return cached; return cached;
} }
public UUID getUUIDof(String playerName) {
return uuids.get(playerName);
}
} }

View File

@ -18,10 +18,8 @@ package com.djrapitops.plan.system.processing.processors.player;
import com.djrapitops.plan.data.store.objects.Nickname; import com.djrapitops.plan.data.store.objects.Nickname;
import com.djrapitops.plan.system.cache.DataCache; import com.djrapitops.plan.system.cache.DataCache;
import com.djrapitops.plan.system.cache.GeolocationCache;
import com.djrapitops.plan.system.database.DBSystem; import com.djrapitops.plan.system.database.DBSystem;
import com.djrapitops.plan.system.info.server.ServerInfo; import com.djrapitops.plan.system.info.server.ServerInfo;
import com.djrapitops.plan.system.processing.Processing;
import dagger.Lazy; import dagger.Lazy;
import javax.inject.Inject; import javax.inject.Inject;
@ -37,25 +35,19 @@ import java.util.function.BooleanSupplier;
@Singleton @Singleton
public class PlayerProcessors { public class PlayerProcessors {
private final Lazy<Processing> processing;
private final Lazy<ServerInfo> serverInfo; private final Lazy<ServerInfo> serverInfo;
private final Lazy<DBSystem> dbSystem; private final Lazy<DBSystem> dbSystem;
private final Lazy<DataCache> dataCache; private final Lazy<DataCache> dataCache;
private final Lazy<GeolocationCache> geolocationCache;
@Inject @Inject
public PlayerProcessors( public PlayerProcessors(
Lazy<Processing> processing,
Lazy<ServerInfo> serverInfo, Lazy<ServerInfo> serverInfo,
Lazy<DBSystem> dbSystem, Lazy<DBSystem> dbSystem,
Lazy<DataCache> dataCache, Lazy<DataCache> dataCache
Lazy<GeolocationCache> geolocationCache
) { ) {
this.processing = processing;
this.serverInfo = serverInfo; this.serverInfo = serverInfo;
this.dbSystem = dbSystem; this.dbSystem = dbSystem;
this.dataCache = dataCache; this.dataCache = dataCache;
this.geolocationCache = geolocationCache;
} }
public BanAndOpProcessor banAndOpProcessor(UUID uuid, BooleanSupplier banned, boolean op) { public BanAndOpProcessor banAndOpProcessor(UUID uuid, BooleanSupplier banned, boolean op) {

View File

@ -17,7 +17,6 @@
package com.djrapitops.plan.utilities.uuid; package com.djrapitops.plan.utilities.uuid;
import com.djrapitops.plan.api.exceptions.database.DBOpException; import com.djrapitops.plan.api.exceptions.database.DBOpException;
import com.djrapitops.plan.system.cache.DataCache;
import com.djrapitops.plan.system.database.DBSystem; import com.djrapitops.plan.system.database.DBSystem;
import com.djrapitops.plugin.api.utility.UUIDFetcher; import com.djrapitops.plugin.api.utility.UUIDFetcher;
import com.djrapitops.plugin.logging.L; import com.djrapitops.plugin.logging.L;
@ -33,13 +32,11 @@ import java.util.UUID;
@Singleton @Singleton
public class UUIDUtility { public class UUIDUtility {
private final DataCache dataCache;
private final DBSystem dbSystem; private final DBSystem dbSystem;
private final ErrorHandler errorHandler; private final ErrorHandler errorHandler;
@Inject @Inject
public UUIDUtility(DataCache dataCache, DBSystem dbSystem, ErrorHandler errorHandler) { public UUIDUtility(DBSystem dbSystem, ErrorHandler errorHandler) {
this.dataCache = dataCache;
this.dbSystem = dbSystem; this.dbSystem = dbSystem;
this.errorHandler = errorHandler; this.errorHandler = errorHandler;
} }
@ -56,11 +53,6 @@ public class UUIDUtility {
return uuid; return uuid;
} }
uuid = dataCache.getUUIDof(playerName);
if (uuid != null) {
return uuid;
}
uuid = getUUIDFromDB(playerName); uuid = getUUIDFromDB(playerName);
if (uuid != null) { if (uuid != null) {
return uuid; return uuid;