From 4b5d9f84fbd05789600f3a100f437faf8c7feab9 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Mon, 19 Sep 2016 17:16:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E8=88=AC?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- src/main/java/pw/yumc/YumCore/kit/StrKit.java | 5 ++++- src/main/java/pw/yumc/YumCore/misc/L10N.java | 3 +++ src/main/java/pw/yumc/YumCore/sql/core/KeyValue.java | 5 +++-- src/main/java/pw/yumc/YumCore/statistic/Statistics.java | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/pw/yumc/YumCore/kit/StrKit.java b/src/main/java/pw/yumc/YumCore/kit/StrKit.java index 764e517..c261bd4 100644 --- a/src/main/java/pw/yumc/YumCore/kit/StrKit.java +++ b/src/main/java/pw/yumc/YumCore/kit/StrKit.java @@ -2,11 +2,14 @@ package pw.yumc.YumCore.kit; /** * 字符串工具类 - * + * * @author 喵♂呜 * @since 2016年9月14日 上午1:02:23 */ public class StrKit { + private StrKit() { + } + /** * 转移数组后获取字符串 * diff --git a/src/main/java/pw/yumc/YumCore/misc/L10N.java b/src/main/java/pw/yumc/YumCore/misc/L10N.java index 8221166..7a739ee 100644 --- a/src/main/java/pw/yumc/YumCore/misc/L10N.java +++ b/src/main/java/pw/yumc/YumCore/misc/L10N.java @@ -28,6 +28,9 @@ public class L10N { load(); } + private L10N() { + } + /** * 获取物品完整汉化名称(包括原版) * diff --git a/src/main/java/pw/yumc/YumCore/sql/core/KeyValue.java b/src/main/java/pw/yumc/YumCore/sql/core/KeyValue.java index 02f382a..e0579a3 100644 --- a/src/main/java/pw/yumc/YumCore/sql/core/KeyValue.java +++ b/src/main/java/pw/yumc/YumCore/sql/core/KeyValue.java @@ -3,6 +3,7 @@ package pw.yumc.YumCore.sql.core; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Map.Entry; /** @@ -13,7 +14,7 @@ import java.util.Map.Entry; */ public class KeyValue { - private final HashMap keyvalues = new HashMap(); + private final Map keyvalues = new HashMap<>(); /** * 数据库键值管理类 @@ -74,7 +75,7 @@ public class KeyValue { * @return 所有的值 */ public Object[] getValues() { - final List keys = new ArrayList(); + final List keys = new ArrayList<>(); for (final Entry next : this.keyvalues.entrySet()) { keys.add(next.getValue()); } diff --git a/src/main/java/pw/yumc/YumCore/statistic/Statistics.java b/src/main/java/pw/yumc/YumCore/statistic/Statistics.java index 93c0ae7..0ba4297 100644 --- a/src/main/java/pw/yumc/YumCore/statistic/Statistics.java +++ b/src/main/java/pw/yumc/YumCore/statistic/Statistics.java @@ -295,7 +295,7 @@ public class Statistics { final long startTime = System.nanoTime(); final long timeSpent = (startTime - lastPoll) / 1000; if (history.size() > 10) { - history.remove(); + history.removeFirst(); } final double ttps = 2.0E7D / (timeSpent == 0 ? 1 : timeSpent); if (ttps <= 21.0D) {