Skip to content

Commit

Permalink
8322981: Fix 2 locations in JDI that throw IOException without using …
Browse files Browse the repository at this point in the history
…the "Caused by" exception

Reviewed-by: dholmes, lmesnik
  • Loading branch information
plummercj committed Jan 5, 2024
1 parent 700c25f commit 46965a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -103,7 +103,7 @@ public VirtualMachine attach(Map<String,? extends Connector.Argument> args)
Properties props = vm.getAgentProperties();
address = props.getProperty("sun.jdwp.listenerAddress");
} catch (Exception x) {
throw new IOException(x.getMessage());
throw new IOException(x);
} finally {
if (vm != null) vm.detach();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -226,7 +226,7 @@ public synchronized VirtualMachine createVirtualMachine(
vm = new VirtualMachineImpl(this, connection, process,
++vmSequenceNumber);
} catch (VMDisconnectedException e) {
throw new IOException(e.getMessage());
throw new IOException(e);
}
targets.add(vm);
return vm;
Expand Down

1 comment on commit 46965a0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.