Finally fixed NPE

Former-commit-id: 9408958e09075621d7cf5c2191ef41ac9a26a356 [formerly 92e217a037a7253550d4f691c1fe14631eef1104]
Former-commit-id: bc9ca0a9d24bf47fd930d5d9a41698bcef8ca00d
This commit is contained in:
Ghost_chu committed 2019-05-30 16:47:35 +08:00
1 parent b57df7f334
commit bbb25207a9
1 file changed
+4 -1
@@ -20,7 +20,7 @@ import org.maxgamer.quickshop.Util.Util;
public class ShopLoader {
private QuickShop plugin;
private int errors;
private ArrayList<Long> loadTimes;
private ArrayList<Long> loadTimes = new ArrayList<>();
private int totalLoaded = 0;
private int loadAfterChunkLoaded = 0;
private int loadAfterWorldLoaded = 0;
@@ -39,6 +39,7 @@ public class ShopLoader {
this.plugin.getLogger().info("Used " + Util.endTimer(fetchUUID) + "ms to fetch all shops from database.");
while (rs.next()) {
UUID singleShopLoadTimer = Util.setTimer();
Util.debugLog("New single timer was set: "+singleShopLoadTimer.toString());
Util.debugLog("Reading [Database data] to [Origin shop data]");
ShopDatabaseInfoOrigin origin = new ShopDatabaseInfoOrigin(rs);
@@ -83,6 +84,7 @@ public class ShopLoader {
loadAfterChunkLoaded++;
}
singleShopLoaded(singleShopLoadTimer);
continue;
}
long totalUsedTime = Util.endTimer(totalLoadTimer);
long avgPerShop = mean(loadTimes.toArray(new Long[0]));
@@ -249,6 +251,7 @@ public class ShopLoader {
private void singleShopLoaded(@NotNull UUID singleShopLoadTimer) {
totalLoaded++;
Util.debugLog("New single timer was ended: "+singleShopLoadTimer.toString());
long singleShopLoadTime = Util.endTimer(singleShopLoadTimer);
loadTimes.add(singleShopLoadTime);
Util.debugLog("Loaded shop used time " + singleShopLoadTime + "ms");