From 3158fa73c585d9c053b7c2358d8a8dfdc69df720 Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Sun, 4 Jul 2021 20:06:28 +0200 Subject: [PATCH] Updated bungee version + removed dependency to Apache commons lang --- Core/pom.xml | 12 ------------ .../java/fr/pandacube/lib/core/db/SQLElement.java | 10 +++++----- .../main/java/fr/pandacube/lib/core/net/PServer.java | 9 +++++---- .../main/java/fr/pandacube/lib/core/net/PSocket.java | 10 +++++----- pom.xml | 2 +- 5 files changed, 16 insertions(+), 27 deletions(-) diff --git a/Core/pom.xml b/Core/pom.xml index 508fbfa..16b72fd 100644 --- a/Core/pom.xml +++ b/Core/pom.xml @@ -15,24 +15,12 @@ PandaLib-Core - - commons-lang - commons-lang - 2.6 - compile - fr.pandacube.bungeecord bungeecord-chat ${bungeecord.version} compile - io.github.classgraph classgraph diff --git a/Core/src/main/java/fr/pandacube/lib/core/db/SQLElement.java b/Core/src/main/java/fr/pandacube/lib/core/db/SQLElement.java index 2cd569b..7305104 100644 --- a/Core/src/main/java/fr/pandacube/lib/core/db/SQLElement.java +++ b/Core/src/main/java/fr/pandacube/lib/core/db/SQLElement.java @@ -17,8 +17,8 @@ import java.util.Objects; import java.util.Set; import java.util.UUID; -import org.apache.commons.lang.builder.ToStringBuilder; - +import com.google.common.base.MoreObjects; +import com.google.common.base.MoreObjects.ToStringHelper; import com.google.gson.Gson; import com.google.gson.JsonObject; @@ -368,13 +368,13 @@ public abstract class SQLElement> { @Override public String toString() { - ToStringBuilder b = new ToStringBuilder(this); + ToStringHelper b = MoreObjects.toStringHelper(this); for (SQLField f : fields.values()) try { - b.append(f.getName(), get(f)); + b.add(f.getName(), get(f)); } catch (IllegalArgumentException e) { - b.append(f.getName(), "(Undefined)"); + b.add(f.getName(), "(Undefined)"); } return b.toString(); diff --git a/Core/src/main/java/fr/pandacube/lib/core/net/PServer.java b/Core/src/main/java/fr/pandacube/lib/core/net/PServer.java index e061ddb..33ac3a0 100644 --- a/Core/src/main/java/fr/pandacube/lib/core/net/PServer.java +++ b/Core/src/main/java/fr/pandacube/lib/core/net/PServer.java @@ -12,7 +12,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.commons.lang.builder.ToStringBuilder; +import com.google.common.base.MoreObjects; import fr.pandacube.lib.core.util.Log; @@ -156,9 +156,10 @@ public class PServer extends Thread implements Closeable { @Override public String toString() { - return new ToStringBuilder(this) - .append("thread", getName()) - .append("socket", socket).toString(); + return MoreObjects.toStringHelper(this) + .add("thread", getName()) + .add("socket", socket) + .toString(); } } diff --git a/Core/src/main/java/fr/pandacube/lib/core/net/PSocket.java b/Core/src/main/java/fr/pandacube/lib/core/net/PSocket.java index b4c6a8f..29a11cd 100644 --- a/Core/src/main/java/fr/pandacube/lib/core/net/PSocket.java +++ b/Core/src/main/java/fr/pandacube/lib/core/net/PSocket.java @@ -15,8 +15,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.commons.lang.builder.ToStringBuilder; - +import com.google.common.base.MoreObjects; import com.google.common.base.Objects; import fr.pandacube.lib.core.util.Log; @@ -346,9 +345,10 @@ public class PSocket extends Thread implements Closeable { @Override public String toString() { - return new ToStringBuilder(this) - .append("thread", getName()) - .append("socket", socket.getRemoteSocketAddress()).toString(); + return MoreObjects.toStringHelper(this) + .add("thread", getName()) + .add("socket", socket.getRemoteSocketAddress()) + .toString(); } } diff --git a/pom.xml b/pom.xml index f53f101..af48f26 100644 --- a/pom.xml +++ b/pom.xml @@ -41,7 +41,7 @@ 11 UTF-8 - 1.16-R0.4-SNAPSHOT + 1.17-R0.1-SNAPSHOT 1.16.5-R0.1 1.16.5