Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.mat.api/.settings/.api_filters20
-rw-r--r--plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/FinalizerReferenceStatQuery.java5
-rw-r--r--plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/PhantomReferenceStatQuery.java4
-rw-r--r--plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/SoftReferenceStatQuery.java4
-rw-r--r--plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/WeakReferenceStatQuery.java4
-rw-r--r--plugins/org.eclipse.mat.api/src/org/eclipse/mat/internal/snapshot/inspections/DominatorQuery.java10
-rw-r--r--plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/browser/QueryBrowserProvider.java8
-rw-r--r--plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/query/arguments/ArgumentsTable.java30
8 files changed, 53 insertions, 32 deletions
diff --git a/plugins/org.eclipse.mat.api/.settings/.api_filters b/plugins/org.eclipse.mat.api/.settings/.api_filters
index 85e67d30..6bea27f4 100644
--- a/plugins/org.eclipse.mat.api/.settings/.api_filters
+++ b/plugins/org.eclipse.mat.api/.settings/.api_filters
@@ -15,24 +15,4 @@
</message_arguments>
</filter>
</resource>
- <resource path="src/org/eclipse/mat/snapshot/SnapshotFactory.java" type="org.eclipse.mat.snapshot.SnapshotFactory">
- <filter id="1143996420">
- <message_arguments>
- <message_argument value="openSnapshot(File, Map&lt;String,String&gt;, IProgressListener)"/>
- </message_arguments>
- </filter>
- </resource>
- <resource path="src/org/eclipse/mat/snapshot/SnapshotFactory.java" type="org.eclipse.mat.snapshot.SnapshotFactory$Implementation">
- <filter id="405901410">
- <message_arguments>
- <message_argument value="org.eclipse.mat.snapshot.SnapshotFactory.Implementation"/>
- <message_argument value="openSnapshot(File, IProgressListener)"/>
- </message_arguments>
- </filter>
- <filter id="1211105284">
- <message_arguments>
- <message_argument value="openSnapshot(File, Map&lt;String,String&gt;, IProgressListener)"/>
- </message_arguments>
- </filter>
- </resource>
</component> \ No newline at end of file
diff --git a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/FinalizerReferenceStatQuery.java b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/FinalizerReferenceStatQuery.java
index e208d537..62d23701 100644
--- a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/FinalizerReferenceStatQuery.java
+++ b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/FinalizerReferenceStatQuery.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 SAP AG.
+ * Copyright (c) 2008, 2018 SAP AG and IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* SAP AG - initial API and implementation
+ * Andrew Johnson/IBM Corporation - only make query available with relevant classes
*******************************************************************************/
package org.eclipse.mat.inspections;
@@ -17,10 +18,12 @@ import org.eclipse.mat.query.annotations.Argument;
import org.eclipse.mat.query.annotations.CommandName;
import org.eclipse.mat.query.annotations.Icon;
import org.eclipse.mat.snapshot.ISnapshot;
+import org.eclipse.mat.snapshot.extension.Subject;
import org.eclipse.mat.util.IProgressListener;
@CommandName("finalizer_references_statistics")
@Icon("/META-INF/icons/finalizer.gif")
+@Subject("java.lang.ref.Finalizer")
public class FinalizerReferenceStatQuery implements IQuery
{
@Argument
diff --git a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/PhantomReferenceStatQuery.java b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/PhantomReferenceStatQuery.java
index 5f1452cb..1d314402 100644
--- a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/PhantomReferenceStatQuery.java
+++ b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/PhantomReferenceStatQuery.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2018 IBM Corporation and others.
+ * Copyright (c) 2009, 2019 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,10 +18,12 @@ import org.eclipse.mat.query.annotations.Argument;
import org.eclipse.mat.query.annotations.CommandName;
import org.eclipse.mat.query.annotations.Icon;
import org.eclipse.mat.snapshot.ISnapshot;
+import org.eclipse.mat.snapshot.extension.Subject;
import org.eclipse.mat.util.IProgressListener;
@CommandName("phantom_references_statistics")
@Icon("/META-INF/icons/phantom_reference.gif")
+@Subject("java.lang.ref.PhantomReference")
public class PhantomReferenceStatQuery implements IQuery
{
@Argument
diff --git a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/SoftReferenceStatQuery.java b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/SoftReferenceStatQuery.java
index cd7526f0..727179ad 100644
--- a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/SoftReferenceStatQuery.java
+++ b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/SoftReferenceStatQuery.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 SAP AG and IBM Corporation.
+ * Copyright (c) 2008, 2019 SAP AG and IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,10 +18,12 @@ import org.eclipse.mat.query.annotations.Argument;
import org.eclipse.mat.query.annotations.CommandName;
import org.eclipse.mat.query.annotations.Icon;
import org.eclipse.mat.snapshot.ISnapshot;
+import org.eclipse.mat.snapshot.extension.Subject;
import org.eclipse.mat.util.IProgressListener;
@CommandName("soft_references_statistics")
@Icon("/META-INF/icons/soft_reference.gif")
+@Subject("java.lang.ref.SoftReference")
public class SoftReferenceStatQuery implements IQuery
{
@Argument
diff --git a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/WeakReferenceStatQuery.java b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/WeakReferenceStatQuery.java
index 027e1d9a..2ad991f4 100644
--- a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/WeakReferenceStatQuery.java
+++ b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/inspections/WeakReferenceStatQuery.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2018 IBM Corporation.
+ * Copyright (c) 2009, 2019 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,10 +17,12 @@ import org.eclipse.mat.query.annotations.Argument;
import org.eclipse.mat.query.annotations.CommandName;
import org.eclipse.mat.query.annotations.Icon;
import org.eclipse.mat.snapshot.ISnapshot;
+import org.eclipse.mat.snapshot.extension.Subject;
import org.eclipse.mat.util.IProgressListener;
@CommandName("weak_references_statistics")
@Icon("/META-INF/icons/weak_reference.gif")
+@Subject("java.lang.ref.WeakReference")
public class WeakReferenceStatQuery implements IQuery
{
@Argument
diff --git a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/internal/snapshot/inspections/DominatorQuery.java b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/internal/snapshot/inspections/DominatorQuery.java
index 1b7b22af..3343e28f 100644
--- a/plugins/org.eclipse.mat.api/src/org/eclipse/mat/internal/snapshot/inspections/DominatorQuery.java
+++ b/plugins/org.eclipse.mat.api/src/org/eclipse/mat/internal/snapshot/inspections/DominatorQuery.java
@@ -658,11 +658,11 @@ public class DominatorQuery implements IQuery
NumberFormat nf = NumberFormat.getPercentInstance();
nf.setMinimumFractionDigits(2);
nf.setMaximumFractionDigits(2);
- return new Column[] { new Column(Messages.Column_ClassLoaderName, String.class), //
- new Column(Messages.Column_Objects, int.class), //
- new Column(Messages.Column_ShallowHeap, Bytes.class), //
- new Column(Messages.Column_RetainedHeap, Bytes.class).sorting(SortDirection.DESC), //
- new Column(Messages.Column_Percentage, double.class).formatting(nf) }; //$NON-NLS-1$
+ return new Column[] { new Column(Messages.Column_ClassLoaderName, String.class),
+ new Column(Messages.Column_Objects, int.class),
+ new Column(Messages.Column_ShallowHeap, Bytes.class),
+ new Column(Messages.Column_RetainedHeap, Bytes.class).sorting(SortDirection.DESC),
+ new Column(Messages.Column_Percentage, double.class).formatting(nf) };
}
public List<?> getElements()
diff --git a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/browser/QueryBrowserProvider.java b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/browser/QueryBrowserProvider.java
index 402e742d..0f564ced 100644
--- a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/browser/QueryBrowserProvider.java
+++ b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/browser/QueryBrowserProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2010 SAP AG.
+ * Copyright (c) 2008, 2019 SAP AG and IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* SAP AG - initial API and implementation
+ * Andrew Johnson/IBM Corporation - allow matching of subject classes by subclasses
*******************************************************************************/
package org.eclipse.mat.ui.internal.browser;
@@ -60,6 +61,11 @@ public abstract class QueryBrowserProvider
{
try
{
+ /*
+ * Until we can efficiently match objects for a query against the subject we don't
+ * need to check subclasses as if the class is present then all the subclasses
+ * will be available too as we are considering the entire snapshot.
+ */
Collection<IClass> ss = snapshot.getClassesByName(cn, false);
if (ss == null || ss.isEmpty())
continue;
diff --git a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/query/arguments/ArgumentsTable.java b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/query/arguments/ArgumentsTable.java
index 40b1c6e3..c82776b4 100644
--- a/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/query/arguments/ArgumentsTable.java
+++ b/plugins/org.eclipse.mat.ui/src/org/eclipse/mat/ui/internal/query/arguments/ArgumentsTable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2018 SAP AG, IBM Corporation and others.
+ * Copyright (c) 2008, 2019 SAP AG, IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -30,6 +30,7 @@ import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.window.DefaultToolTip;
import org.eclipse.jface.window.ToolTip;
import org.eclipse.mat.SnapshotException;
+import org.eclipse.mat.internal.snapshot.ArgumentParser;
import org.eclipse.mat.internal.snapshot.HeapObjectContextArgument;
import org.eclipse.mat.internal.snapshot.HeapObjectParamArgument;
import org.eclipse.mat.query.IContextObject;
@@ -251,7 +252,32 @@ public class ArgumentsTable implements ArgumentEditor.IEditorListener
}
else if (isHeapObject)
{
- addHeapObjectTableItems(descriptor, (HeapObjectParamArgument) argumentValue);
+ Object value = argumentValue;
+ if (value == null)
+ {
+ // Experimental
+ // No heap object provided, so see if query has a default heap object argument
+ value = descriptor.getDefaultValue();
+ if (value instanceof IHeapObjectArgument)
+ {
+ // The default heap object argument has a null snapshot,
+ ISnapshot snapshot = (ISnapshot) context.get(ISnapshot.class, null);
+ // So convert it to a string then reparse in this context.
+ // Only really makes sense for class name or OQL arguments as object
+ // addresses won't apply between snapshots (except boot classloader @0x0 ?)
+ String line = ((IHeapObjectArgument) value).getLabel();
+ try
+ {
+ HeapObjectParamArgument hoa = ArgumentParser.consumeHeapObjects(snapshot, line);
+ value = hoa;
+ }
+ catch (SnapshotException e)
+ {
+ value = null;
+ }
+ }
+ }
+ addHeapObjectTableItems(descriptor, (HeapObjectParamArgument) value);
}
else
{

Back to the top