Skip to content

Commit 37bcddc

Browse files
authored
Properly cast vm object (#129)
1 parent 6afce1c commit 37bcddc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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)