Skip to content

Commit 2392524

Browse files
committed
Properly cast vm object
1 parent cd27242 commit 2392524

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/cyclopsgroup/jmxterm/jdk9/Jdk9JavaProcess.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public void startManagementAgent() throws IOException {
4949
Object vm = staticVirtualMachine.attach(vmd.id());
5050
try {
5151
Class<?> originalVirtualMachine = Class.forName(VirtualMachine.ORIGINAL_CLASS_NAME);
52-
VirtualMachine vmProxy = WeakCastUtils.cast(originalVirtualMachine, VirtualMachine.class);
52+
VirtualMachine vmProxy = WeakCastUtils.cast(originalVirtualMachine, vm, VirtualMachine.class);
5353
vmProxy.startLocalManagementAgent();
5454
} catch (ClassNotFoundException | SecurityException | NoSuchMethodException e) {
5555
throw new RuntimeException("Can't cast " + vm + " to VirtualMachineDescriptor", e);

0 commit comments

Comments
 (0)