Skip to content

Commit

Permalink
Bug 573598 Display unindexed objects for dumps with discarded objects
Browse files Browse the repository at this point in the history
Minor fixes for OQL lists

Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=573598
Change-Id: I4358ca17d8035584584e967a2280d69f51aef064
  • Loading branch information
ajohnson1 committed May 24, 2021
1 parent 6fa64b5 commit 4d619a0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,10 @@ public RowMap get(int index)
{
// Always return a map not a single item for consistency.
// Except if the alias is "" as this used for CompareTablesQuery.
if (getColumns().length == 1 && getColumns()[0].getLabel().length() == 0)
if (getColumns().length == 1 && getColumns()[0].getLabel().isEmpty())
{
Object ret = getColumnValue(getRow(index), 0);
// Squash?
if (ret instanceof RowMap)
return (RowMap)ret;
}
Expand Down Expand Up @@ -538,7 +539,7 @@ public String toString()
* Result from a select with select list where the from clause returned a list or array of non-heap objects.
* Each row is backed by a non-heap object.
*/
private static class ObjectResultSet extends AbstractCustomTableResultSet implements CustomTableResultSet
private static class ObjectResultSet extends AbstractCustomTableResultSet
{
private static final Object NULL_VALUE = new Object();

Expand Down Expand Up @@ -714,7 +715,7 @@ private void resolve(int index)
* Result from a select with select list where the from clause returned an array of object IDs.
* Each row is backed by a heap object, so will appear in the inspector view.
*/
private static class ResultSet extends AbstractCustomTableResultSet implements CustomTableResultSet
private static class ResultSet extends AbstractCustomTableResultSet
{
private static final Object NULL_VALUE = new Object();

Expand Down Expand Up @@ -2351,8 +2352,11 @@ else if (select.isAsObjects())
{
ResultSet temp = new ResultSet(getSelectQuery(), objectIds.toArray());
IntResult r = createIntResult(objectIds.size());
convertToObjects(temp, r, null, listener);
return r;
Collection<IObject> r2 = r instanceof IntSetResult ? new LinkedHashSet<IObject>() : new ArrayList<IObject>();
convertToObjects(temp, r, r2, listener);
if (!(r2 instanceof List))
r2 = new ArrayList<IObject>(r2);
return r2.size() > 0 ? r2 : r;
}
else
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,13 @@
*******************************************************************************/
package org.eclipse.mat.query.registry;

import java.net.URL;
import java.lang.reflect.Constructor;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Locale;

import javax.tools.JavaCompiler;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.mat.SnapshotException;
import org.eclipse.mat.query.IQuery;
Expand Down Expand Up @@ -178,10 +176,13 @@ public boolean accept(IQueryContext context)
if (!context.available(argument.getType(), argument.getAdvice()) && //
!context.converts(argument.getType(), argument.getAdvice()))
{
if (ReportPlugin.getDefault().isDebugging())
ReportPlugin.log(IStatus.INFO, MessageUtil.format(Messages.QueryDescriptor_Error_IgnoringQuery,
getIdentifier(), argument.getName()));
return false;
if (argument.isMandatory())
{
if (ReportPlugin.getDefault().isDebugging())
ReportPlugin.log(IStatus.INFO, MessageUtil.format(Messages.QueryDescriptor_Error_IgnoringQuery,
getIdentifier(), argument.getName()));
return false;
}
}
}

Expand Down

0 comments on commit 4d619a0

Please sign in to comment.