This commit is contained in:
Vladimir Krivosheev
2014-03-25 09:35:10 +01:00
parent 7e47fb66e5
commit 47a0146ccf
4 changed files with 11 additions and 6 deletions
@@ -44,9 +44,11 @@ public class Launcher {
final URLClassLoader jpsLoader = new URLClassLoader(urls.toArray(new URL[urls.size()]), Launcher.class.getClassLoader());
// IDEA-120811; speeding up DefaultChannelIDd calculation for netty
final String id = UUID.randomUUID().toString();
System.setProperty("io.netty.machineId", id.substring(id.length() - 8));
System.setProperty("io.netty.processId", Integer.toString(new Random().nextInt(65535)));
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.processId", Integer.toString(new Random().nextInt(65535)));
}
final Class<?> mainClass = jpsLoader.loadClass(mainClassName);
final Method mainMethod = mainClass.getMethod("main", String[].class);
Binary file not shown.
Binary file not shown.
@@ -17,6 +17,7 @@ package org.jetbrains.io;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.ActionCallback;
import com.intellij.util.SystemProperties;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.BootstrapUtil;
import io.netty.bootstrap.ServerBootstrap;
@@ -44,9 +45,11 @@ public final class NettyUtil {
static {
// IDEA-120811
String id = UUID.randomUUID().toString();
System.setProperty("io.netty.machineId", id.substring(id.length() - 8));
System.setProperty("io.netty.processId", Integer.toString(new Random().nextInt(65535)));
if (SystemProperties.getBooleanProperty("io.netty.random.id", false)) {
String id = UUID.randomUUID().toString();
System.setProperty("io.netty.machineId", id.substring(id.length() - 8));
System.setProperty("io.netty.processId", Integer.toString(new Random().nextInt(65535)));
}
}
public static void log(Throwable throwable, Logger log) {