Bug 405764

Summary: [Structure Compare] Does not compare nor navigate through non-leaf (inner) nodes in the structure difference viewer.
Product: [Eclipse Project] Platform Reporter: Kalin Malinov <kmalinov>
Component: CompareAssignee: Platform-Compare-Inbox <platform-compare-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: frederic.gurr
Version: 3.8   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
A CVS patch for navigation.
none
A CVS patch for comparison.
none
Screenshot none

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