Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 353341 - Proposed patch to add IHeapObjectArgument to ThreadOverviewQuery
Summary: Proposed patch to add IHeapObjectArgument to ThreadOverviewQuery
Status: RESOLVED DUPLICATE of bug 353517
Alias: None
Product: MAT
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-28 12:03 EDT by Kevin Grigorenko CLA
Modified: 2011-10-21 05:42 EDT (History)
0 users

See Also:


Attachments
Patch to add IHeapObjectArgument to ThreadOverviewQuery (2.30 KB, patch)
2011-07-28 12:03 EDT, Kevin Grigorenko CLA
no flags Details | Diff
Patch to add IHeapObjectArgument to ThreadOverviewQuery V2 (2.29 KB, patch)
2011-07-28 12:08 EDT, Kevin Grigorenko CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Grigorenko CLA 2011-07-28 12:03:48 EDT
Created attachment 200541 [details]
Patch to add IHeapObjectArgument to ThreadOverviewQuery

I wanted to build a query which returned a subset of the ThreadOverviewQuery; for example:

SnapshotQuery threads = SnapshotQuery.lookup("thread_overview", snapshot);
threads.setArgument("objects", hungThreadObjectIds);
return threads.execute(listener);

However, the ThreadOverviewQuery does not have an IHeapObjectArgument argument. I ended up using thread_stacks, but I would have liked the data in thread_overview. Attached is a proposed patch to add this support -- it blindly takes input object IDs as threads, and if there were none, falls back to the old behavior of finding all Thread objects.

One downside is that this changes the behavior of Thread Overview because the input dialog pops up now. I think this is okay since all the other thread queries do this. If this is an issue, one solution would be to add a "default" parameter to @Argument, so that the user doesn't think that the class name of threads must be specified:

@Argument(isMandatory = false, flag = Argument.UNFLAGGED, default = "java.lang.Thread")
public IHeapObjectArgument objects;
Comment 1 Kevin Grigorenko CLA 2011-07-28 12:08:53 EDT
Created attachment 200542 [details]
Patch to add IHeapObjectArgument to ThreadOverviewQuery V2

Fixed NPE
Comment 2 Andrew Johnson CLA 2011-10-21 05:42:00 EDT
Fixed by 353517.

*** This bug has been marked as a duplicate of bug 353517 ***