changeset 1314:7cff26ccc4d3

Amend 7901645 with better check.
author shade
date Tue, 29 Mar 2016 15:06:40 +0300
parents 43bfb46b7fa3
children 6b825c9b1c94
files jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java	Tue Mar 29 14:49:33 2016 +0300
+++ b/jmh-core/src/main/java/org/openjdk/jmh/profile/GCProfiler.java	Tue Mar 29 15:06:40 2016 +0300
@@ -220,7 +220,7 @@
                     Class<?> pmo = Class.forName("java.lang.management.PlatformManagedObject");
                     Method m = ManagementFactory.class.getMethod("getPlatformMXBean", Class.class, pmo);
                     bean = (ThreadMXBean) m.invoke(null, internalIntf);
-                    if (!internalIntf.isAssignableFrom(bean.getClass())) {
+                    if (bean == null) {
                         throw new UnsupportedOperationException("No way to access private ThreadMXBean");
                     }
                 }