Make getRandomKey() properly random (#1834)

This commit is contained in:
Rodney authored and GitHub committed 2022-08-13 15:08:01 +00:00
1 parent 20e73369fa
commit 2092b8f48e
1 file changed
+2 -1
@@ -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) {