Skip to content

Commit 625bc7d

Browse files
committed
fix bug
1 parent d1228d5 commit 625bc7d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

inject/src/main/java/Attach.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,20 @@ public static void main(String[] args) throws IOException {
5454
private static boolean inject(String agentArgs, String agentPath,String process) throws Exception {
5555
List<VirtualMachineDescriptor> vmList = VirtualMachine.list();
5656
if (vmList.size() <= 0)
57-
return true;
57+
return false;
5858
if (process != null){
5959
for (VirtualMachineDescriptor vmd : vmList) {
6060
String displayName = vmd.displayName();
6161
if (displayName.equals(process)){
62-
inject(vmd,agentArgs,agentPath);
62+
return inject(vmd,agentArgs,agentPath);
6363
}
6464
}
6565
}
6666

6767
for (VirtualMachineDescriptor vmd : vmList) {
6868
String displayName = vmd.displayName();
6969
if (displayName.contains("weblogic.Server") || displayName.contains("catalina")) {
70-
inject(vmd,agentArgs,agentPath);
70+
return inject(vmd,agentArgs,agentPath);
7171
}
7272
}
7373
return false;

0 commit comments

Comments
 (0)