Bug 405764 - [Structure Compare] Does not compare nor navigate through non-leaf (inner) nodes in the structure difference viewer.
Summary: [Structure Compare] Does not compare nor navigate through non-leaf (inner) no...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.8   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-16 03:08 EDT by Kalin Malinov CLA
Modified: 2013-04-16 06:03 EDT (History)
1 user (show)

See Also:


Attachments
A CVS patch for navigation. (805 bytes, patch)
2013-04-16 03:08 EDT, Kalin Malinov CLA
no flags Details | Diff
A CVS patch for comparison. (518 bytes, patch)
2013-04-16 03:10 EDT, Kalin Malinov CLA
no flags Details | Diff
Screenshot (27.76 KB, image/png)
2013-04-16 03:13 EDT, Kalin Malinov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kalin Malinov CLA 2013-04-16 03:08:47 EDT
Created attachment 229749 [details]
A CVS patch for navigation.

Hello,

When comparing our specific models, we are facing two problems with non-leaf (inner) nodes. 
The model content is represented as tree of nodes. Each node, including inner nodes, may contain data.

In the current implementation, navigating through the nodes in the structure difference viewer only selects the leaf nodes, no matter if there are inner (non-leaf) nodes with differences or not. We would expect that inner nodes, containing differences can be selected, too.

The other problem is related to the lack of comparison on inner (non-leaf) nodes. The current implementation only compares leaf-nodes and propagates their status to the parent.

The solution for navigation is to add a protected method to the DiffTreeViewer class and a third if-statement in the "while" loop of getNextItem(…) method.

Inner node comparison requires changing the Differencer class. In traverse(...) method the boolean "content" field should be removed and at the end the "code" should be or-ed with the result of compare(...).

Please find attached a screenshot, showing the expected results and patches for each solution.

We believe this is a general problem in the Eclipse compare framework with models containing data in inner nodes.
Solving this problem may also solve bug 400424.
Comment 1 Kalin Malinov CLA 2013-04-16 03:10:15 EDT
Created attachment 229750 [details]
A CVS patch for comparison.
Comment 2 Kalin Malinov CLA 2013-04-16 03:13:14 EDT
Created attachment 229751 [details]
Screenshot