mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] makes AppMain compatible with Java <= 5 (IDEA-170021)
This commit is contained in:
@@ -1 +1 @@
|
||||
Premain-Class: com.intellij.rt.execution.application.AppMainV2
|
||||
Premain-Class: com.intellij.rt.execution.application.AppMainV2$Agent
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.intellij.rt.execution.application;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.instrument.Instrumentation;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
@@ -89,19 +90,6 @@ public class AppMainV2 {
|
||||
t.start();
|
||||
}
|
||||
|
||||
public static void premain(String args) {
|
||||
try {
|
||||
int p = args.indexOf(':');
|
||||
if (p < 0) throw new IllegalArgumentException("incorrect parameter: " + args);
|
||||
boolean helperLibLoaded = loadHelper(args.substring(p + 1));
|
||||
int portNumber = Integer.parseInt(args.substring(0, p));
|
||||
startMonitor(portNumber, helperLibLoaded);
|
||||
}
|
||||
catch (Throwable t) {
|
||||
System.err.println("Launcher failed - \"Dump Threads\" and \"Exit\" actions are unavailable (" + t.getMessage() + ')');
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Throwable {
|
||||
try {
|
||||
boolean helperLibLoaded = loadHelper(System.getProperty(LAUNCHER_BIN_PATH));
|
||||
@@ -159,4 +147,19 @@ public class AppMainV2 {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Agent {
|
||||
public static void premain(String args, Instrumentation i) {
|
||||
try {
|
||||
int p = args.indexOf(':');
|
||||
if (p < 0) throw new IllegalArgumentException("incorrect parameter: " + args);
|
||||
boolean helperLibLoaded = loadHelper(args.substring(p + 1));
|
||||
int portNumber = Integer.parseInt(args.substring(0, p));
|
||||
startMonitor(portNumber, helperLibLoaded);
|
||||
}
|
||||
catch (Throwable t) {
|
||||
System.err.println("Launcher failed - \"Dump Threads\" and \"Exit\" actions are unavailable (" + t.getMessage() + ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user