Make getRandomKey() properly random (#1834)

This commit is contained in:
Rodney 2022-08-13 17:08:01 +02:00 committed by GitHub
parent 20e73369fa
commit 2092b8f48e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,6 +11,7 @@ import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentHashMap;
@ -170,7 +171,7 @@ public class NettyChannelInjector implements Injector {
}
private static String getRandomKey() {
return Long.toString(System.nanoTime());
return "ProtocolLib-" + ThreadLocalRandom.current().nextLong();
}
private static boolean hasProtocolLibHandler(Channel channel) {