Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Johnson2018-09-03 02:08:31 -0400
committerAndrew Johnson2018-09-03 02:08:31 -0400
commit546d4e686fa6387a55a2f534831cb6a250d84f3d (patch)
tree43d5836136d7ee176592ba40c6dce945a1f2273c
parent5c8d286cab75087a235a0423101e52f7e8e83e20 (diff)
downloadorg.eclipse.mat-546d4e686fa6387a55a2f534831cb6a250d84f3d.tar.gz
org.eclipse.mat-546d4e686fa6387a55a2f534831cb6a250d84f3d.tar.xz
org.eclipse.mat-546d4e686fa6387a55a2f534831cb6a250d84f3d.zip
[436229] Eclipse/OSGi Bundle queries
Fix errors from cleared SoftReferences: Unknown element 0x9dc42088 of type org.eclipse.core.internal.registry.ReferenceMap$SoftRef Change-Id: If877e6209423c8bcc322de918e44de872dde6eee
-rw-r--r--plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/osgi/model/EquinoxBundleReader2.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/osgi/model/EquinoxBundleReader2.java b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/osgi/model/EquinoxBundleReader2.java
index 546e2f3d..832109e1 100644
--- a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/osgi/model/EquinoxBundleReader2.java
+++ b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/osgi/model/EquinoxBundleReader2.java
@@ -793,6 +793,23 @@ public class EquinoxBundleReader2 implements IBundleReader
// get type of object (Extension, ExtensionPoint,
// ConfigurationElement)
String className = instance.getClazz().getName();
+ if (instance.getClazz().doesExtend("java.lang.ref.SoftReference"))
+ {
+ // Some null SoftReferences get to here, just check they are null
+ ObjectReference ref = ReferenceQuery.getReferent((IInstance) instance);
+ if (ref != null)
+ {
+ // The SoftReferences should have been resolved
+ // before the call, but just in case:
+ instance = ref.getObject();
+ className = instance.getClazz().getName();
+ }
+ else
+ {
+ // The SoftReference is cleared, so nothing to do
+ return;
+ }
+ }
if (className.equals("org.eclipse.core.internal.registry.ExtensionPoint")) //$NON-NLS-1$
{
ExtensionPoint extensionPoint = extractExtensionPointInfo(instance);

Back to the top