Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361631

Summary: Allow comparisons of trees as well as tables
Product: [Tools] MAT Reporter: Andrew Johnson <andrew_johnson>
Component: CoreAssignee: Andrew Johnson <andrew_johnson>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: apupier
Version: 1.1   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 369047, 394222    

Description Andrew Johnson CLA 2011-10-21 06:41:25 EDT
Currently the comparison basket allows tables to be compared.
The comparison basket and the comparison query could be enhanced to allow trees to be compared as well.
Just the top level of the tree would be compared, as though it was a table, and the comparison view would still be a table. Change CompareTablesQuery.java
The compare basket code would need to changed to allow trees to be added. CompareBasketView.java
Some of the query registry/SnapshotQueryContext/Policy code may need to be updated to allow IStructuredResult arrays.

Ideally the query code would be sensitive to the types of the arguments:
Argument:
List <IStructuredResult>compare; // Query appears for tables and tree selections
List <IResultTable>compare; // Query only appears when tables are selected in the compare basket
List <IResultTree>compare; // Query only appears when trees are selected in the compare basket
Comment 1 Andrew Johnson CLA 2011-10-21 11:11:45 EDT
I've made a first pass at the changes.

A query is eligible as a compare query if all the IStructuredResult arguments are of a type which can hold all of the selected objects in the compare basket.
Comment 2 Andrew Johnson CLA 2011-10-23 12:42:58 EDT
Where do we need to update query names, query help, parameter names, HTML help etc. to reflect this change to allow trees?
We should also allow the results of an OQL query to be compared.
Should we allow more generic compares/queries of any IResult? E.g. for a query doing group by value on a column etc.
Comment 3 Andrew Johnson CLA 2013-05-10 17:56:34 EDT
Results from OQL queries can now be compared.
I've experimented with adding IStructuredResult as arguments to ordinary queries. It's a modification to Policy and QueryContextMenu. I'm not sure whether to add this yet - I'd need to see some queries that could use it.
Comment 4 Andrew Johnson CLA 2013-05-14 15:58:03 EDT
If we want to allow an IStructuredResult as an argument to an ordinary query then we should raise a new bug, preferably with an example query that could use that facility.

This bug is now fixed - the use of trees as well as tables is mentioned in the documentation. This results of an OQL query can also now be compared.