mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
we must avoid use UUID.randomUUID — can cause long network calls
This commit is contained in:
@@ -21,7 +21,10 @@ import java.lang.reflect.Method;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLClassLoader;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* @author Eugene Zhuravlev
|
||||
@@ -45,8 +48,7 @@ public class Launcher {
|
||||
|
||||
// IDEA-120811; speeding up DefaultChannelIDd calculation for netty
|
||||
//if (Boolean.parseBoolean(System.getProperty("io.netty.random.id"))) {
|
||||
final String id = UUID.randomUUID().toString();
|
||||
System.setProperty("io.netty.machineId", id.substring(id.length() - 8));
|
||||
System.setProperty("io.netty.machineId", "9e43d860");
|
||||
System.setProperty("io.netty.processId", Integer.toString(new Random().nextInt(65535)));
|
||||
//}
|
||||
|
||||
|
||||
@@ -37,7 +37,6 @@ import java.net.BindException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Socket;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class NettyUtil {
|
||||
public static final int DEFAULT_CONNECT_ATTEMPT_COUNT = 20;
|
||||
@@ -46,8 +45,7 @@ public final class NettyUtil {
|
||||
static {
|
||||
// IDEA-120811
|
||||
if (SystemProperties.getBooleanProperty("io.netty.random.id", true)) {
|
||||
String id = UUID.randomUUID().toString();
|
||||
System.setProperty("io.netty.machineId", id.substring(id.length() - 8));
|
||||
System.setProperty("io.netty.machineId", "9e43d860");
|
||||
System.setProperty("io.netty.processId", Integer.toString(new Random().nextInt(65535)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user