if -jar, use the jar name since no classname will be specified

This commit is contained in:
Doug MacEachern 2005-12-16 20:14:11 +00:00
parent 3a2fcef755
commit 430962a988
1 changed files with 8 additions and 5 deletions

View File

@ -138,12 +138,15 @@ public class Ps extends SigarCommandBase {
String[] args = sigar.getProcArgs(pid);
for (int i=1; i<args.length; i++) {
String arg = args[i];
if (!isClassName(arg)) {
continue;
if (isClassName(arg)) {
//example: "java:weblogic.Server"
name += ":" + arg;
break;
}
else if (arg.equals("-jar")) {
name += ":" + args[i+1];
break;
}
//example: "java:weblogic.Server"
name += ":" + arg;
break;
}
} catch (SigarException e) {}