From 7096eb92f7c8b4debc2e67df828a7eb77331295b Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Thu, 18 Jul 2019 21:40:52 +0800 Subject: [PATCH] Optimize code Former-commit-id: a804f43920436cbce88f170af37ed77a3a71f3ef [formerly 544bb3795e922e2129440dc47e752e2b03693116] Former-commit-id: 2e3013ec7039c7a6ca26e4a2764bf6bc27646cf9 --- .../org/maxgamer/quickshop/Shop/ShopModerator.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/ShopModerator.java b/src/main/java/org/maxgamer/quickshop/Shop/ShopModerator.java index e1991afa2..0c4dec5f8 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/ShopModerator.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/ShopModerator.java @@ -22,8 +22,9 @@ public class ShopModerator { Gson gson = new Gson(); return gson.toJson(shopModerator); //Use Gson serialize this class } - private UUID owner; - private ArrayList staffs; + + @NonNull private UUID owner; + @NonNull private ArrayList staffs; private ShopModerator(@NotNull ShopModerator shopModerator) { this.owner = shopModerator.owner; @@ -37,7 +38,7 @@ public class ShopModerator { */ public ShopModerator(@NotNull UUID owner) { this.owner = owner; - this.staffs = new ArrayList(); + this.staffs = new ArrayList<>(); } /** @@ -47,7 +48,7 @@ public class ShopModerator { */ public ShopModerator(@NotNull UUID owner, @NotNull ArrayList staffs) { this.owner = owner; - this.staffs = new ArrayList(); + this.staffs = new ArrayList<>(); } /** @@ -69,8 +70,9 @@ public class ShopModerator { staffs.clear(); } + @SuppressWarnings("MethodDoesntCallSuperMethod") public ShopModerator clone() { - return new ShopModerator(this); + return new ShopModerator(this.owner, this.staffs); } @Override