[java] makes source code compatible with outdated IDEA builds

This commit is contained in:
Roman Shevchenko
2017-03-23 10:21:12 +01:00
parent 4a0984b05b
commit 8552aaee0d
@@ -150,16 +150,21 @@ public class AppMainV2 {
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() + ')');
}
AppMainV2.premain(args);
}
}
// todo[r.sh] inline some time after 2017.1.1 release
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() + ')');
}
}
}