Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Johnson2018-06-03 16:09:42 -0400
committerAndrew Johnson2018-06-03 16:09:42 -0400
commit53f15641a321282eeb122d810347ff7816979739 (patch)
tree8a1ff1676d7b4f1684a19af1e34f858cd0c75350
parent9e6b9126a16ce184c214f29cc31834b6005eebcb (diff)
downloadorg.eclipse.mat-R_1.8.0.tar.gz
org.eclipse.mat-R_1.8.0.tar.xz
org.eclipse.mat-R_1.8.0.zip
[535353] Attach API dump provider doesn't work with OpenJ9 Java 10R_1.8.0
Exclude unexported classes/methods from reflective calls Change-Id: I71481b7ab9787e2f6e69af7d08d6647c0729f17a
-rw-r--r--plugins/org.eclipse.mat.ibmdumps/src/org/eclipse/mat/ibmvm/acquire/IBMDumpProvider.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/org.eclipse.mat.ibmdumps/src/org/eclipse/mat/ibmvm/acquire/IBMDumpProvider.java b/plugins/org.eclipse.mat.ibmdumps/src/org/eclipse/mat/ibmvm/acquire/IBMDumpProvider.java
index 8775e4ad..d453029a 100644
--- a/plugins/org.eclipse.mat.ibmdumps/src/org/eclipse/mat/ibmvm/acquire/IBMDumpProvider.java
+++ b/plugins/org.eclipse.mat.ibmdumps/src/org/eclipse/mat/ibmvm/acquire/IBMDumpProvider.java
@@ -246,7 +246,8 @@ public class IBMDumpProvider extends BaseProvider
}
if (t instanceof IOException)
{
- if (t.getMessage().contains("not attach to current VM"))
+ // OpenJDK or OpenJ9 exceptions
+ if (t.getMessage().contains("not attach to current VM") || t.getMessage().contains("jdk.attach.allowAttachSelf"))
{
// Java 9/10 throws IOException instead of more useful AttachNotSupportedException
throw new AttachNotSupportedException(t);
@@ -365,8 +366,12 @@ public class IBMDumpProvider extends BaseProvider
cls = o.getClass();
}
// Find a public class we can call methods from.
- // The ibm. is to exclude IBM Java 9 classes which are public but not accessible
- while (!Modifier.isPublic(cls.getModifiers()) || cls.getPackage().getName().startsWith("ibm.") || cls.getPackage().getName().startsWith("sun."))
+ // The ibm. is to exclude IBM Java 9 classes which are public but not accessible.
+ // The sun. is to exclude Oracle Java 9 classes which are public but not accessible.
+ // The com.ibm.tools.attach.attacher. is to exclude OpenJ9 Java 10 classes which are public but not accessible.
+ // The org. is to exclude possible future OpenJ9 Java 10 classes which are public but not accessible.
+ while (!Modifier.isPublic(cls.getModifiers()) || cls.getPackage().getName().startsWith("ibm.") || cls.getPackage().getName().startsWith("sun.")
+ || cls.getPackage().getName().startsWith("com.ibm.tools.attach.attacher") || cls.getPackage().getName().startsWith("org."))
{
cls = cls.getSuperclass();
}
@@ -558,7 +563,8 @@ public class IBMDumpProvider extends BaseProvider
}
if (t instanceof IOException)
{
- if (t.getMessage().contains("not attach to current VM"))
+ // OpenJDK or OpenJ9 exception
+ if (t.getMessage().contains("not attach to current VM") || t.getMessage().contains("jdk.attach.allowAttachSelf"))
{
// Java 9/10 throws IOException instead of more useful AttachNotSupportedException
throw new AttachNotSupportedException(t);

Back to the top