Drop usage of deprecated apache lang library

This commit is contained in:
games647
2019-05-01 17:03:04 +02:00
parent 3fe17cf8d9
commit 145bd95679
3 changed files with 8 additions and 9 deletions

View File

@@ -6,8 +6,6 @@ import com.github.games647.fastlogin.core.shared.LoginSession;
import java.util.Optional; import java.util.Optional;
import org.apache.commons.lang.ArrayUtils;
/** /**
* Represents a client connecting to the server. * Represents a client connecting to the server.
* *
@@ -15,6 +13,8 @@ import org.apache.commons.lang.ArrayUtils;
*/ */
public class BukkitLoginSession extends LoginSession { public class BukkitLoginSession extends LoginSession {
private static final byte[] EMPTY_ARRAY = {};
private final String serverId; private final String serverId;
private final byte[] verifyToken; private final byte[] verifyToken;
@@ -27,17 +27,17 @@ public class BukkitLoginSession extends LoginSession {
super(username, registered, profile); super(username, registered, profile);
this.serverId = serverId; this.serverId = serverId;
this.verifyToken = ArrayUtils.clone(verifyToken); this.verifyToken = verifyToken.clone();
} }
//available for BungeeCord //available for BungeeCord
public BukkitLoginSession(String username, boolean registered) { public BukkitLoginSession(String username, boolean registered) {
this(username, "", ArrayUtils.EMPTY_BYTE_ARRAY, registered, null); this(username, "", EMPTY_ARRAY, registered, null);
} }
//cracked player //cracked player
public BukkitLoginSession(String username, StoredProfile profile) { public BukkitLoginSession(String username, StoredProfile profile) {
this(username, "", ArrayUtils.EMPTY_BYTE_ARRAY, false, profile); this(username, "", EMPTY_ARRAY, false, profile);
} }
/** /**
@@ -48,7 +48,7 @@ public class BukkitLoginSession extends LoginSession {
* @return the verify token from the server * @return the verify token from the server
*/ */
public byte[] getVerifyToken() { public byte[] getVerifyToken() {
return ArrayUtils.clone(verifyToken); return verifyToken.clone();
} }
/** /**

View File

@@ -1,5 +1,6 @@
package com.github.games647.fastlogin.bukkit.hook; package com.github.games647.fastlogin.bukkit.hook;
import com.comphenix.protocol.reflect.FieldUtils;
import com.github.games647.fastlogin.bukkit.FastLoginBukkit; import com.github.games647.fastlogin.bukkit.FastLoginBukkit;
import com.github.games647.fastlogin.core.hooks.AuthPlugin; import com.github.games647.fastlogin.core.hooks.AuthPlugin;
@@ -13,7 +14,6 @@ import java.util.Optional;
import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.apache.commons.lang.reflect.FieldUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@@ -14,7 +14,6 @@ import java.security.PublicKey;
import java.util.Arrays; import java.util.Arrays;
import java.util.Random; import java.util.Random;
import org.apache.commons.lang.ArrayUtils;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import static com.comphenix.protocol.PacketType.Login.Server.DISCONNECT; import static com.comphenix.protocol.PacketType.Login.Server.DISCONNECT;
@@ -85,7 +84,7 @@ public class ProtocolLibLoginSource implements LoginSource {
} }
public byte[] getVerifyToken() { public byte[] getVerifyToken() {
return ArrayUtils.clone(verifyToken); return verifyToken.clone();
} }
@Override @Override