+1
regards,
-- daniel
On 06/02/17 00:29, Mandy Chung wrote:
sun.management.ConnectorAddressLink is renamed to
jdk.internal.agent.ConnectorAddressLink but missed the Class.forName call in
JConsole. Thanks to Peter catching this regression. Since jdk.jconsole
requires jdk.attach and jdk.management.agent that guarantees the classes
required are present at runtime, so we can drop the Class.forName calls.
I leave the isLocalAttachAvailable() method there to keep the current
implementation that supports to run even if the local attach is not supported.
Mandy
diff --git a/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
b/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
--- a/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
+++ b/src/jdk.jconsole/share/classes/sun/tools/jconsole/JConsole.java
@@ -949,23 +949,12 @@
}
}
- private static final boolean localAttachmentSupported;
- static {
- boolean supported;
- try {
- Class.forName("com.sun.tools.attach.VirtualMachine");
- Class.forName("sun.management.ConnectorAddressLink");
- supported = true;
- } catch (NoClassDefFoundError x) {
- supported = false;
- } catch (ClassNotFoundException x) {
- supported = false;
- }
- localAttachmentSupported = supported;
- }
-
+ /**
+ * local attach is supported in this implementation as jdk.jconsole
+ * requires jdk.attach and jdk.management.agent
+ */
public static boolean isLocalAttachAvailable() {
- return localAttachmentSupported;
+ return true;
}