Bug 209989 - CompareEditor doesn't show child files if folder not available on both sides
Summary: CompareEditor doesn't show child files if folder not available on both sides
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Compare (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P4 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Compare-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2007-11-15 11:50 EST by Federico CLA
Modified: 2019-09-06 16:06 EDT (History)
0 users

See Also:


Attachments
Screenshot of the Compare Editor opened with shows the "subfolder" without its children (56.63 KB, image/jpeg)
2007-11-15 11:50 EST, Federico CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Federico CLA 2007-11-15 11:50:52 EST
Created attachment 82980 [details]
Screenshot of the Compare Editor opened with shows the "subfolder" without its children

Build ID: eclipse.buildId=M20070921-1145

Steps To Reproduce:
1. in your project, create the following folder hierarchy:
- folder1
  - subfolder1
     - subfile1
  - file1

- folder2
  - file1 


2. Select folder1 and folder2 with multiselection. Then choose Compare With -> Each Other

3. Check the Compare Editor which is opened: The Structure Viewer will show the following diffs:
- file1
- subfolder1

That's correct, but I would have expected to see the children of subfolder1 (in this example it is called subfile1). But the subhierarchy of subfolder1 is not shown. Furthermore, the file "subfile1", which is only available on one side, should be also marked as diff. This is the hierarchy I would have expected:
- file1
- subfolder1
  - subfile1

4. The bad thing about this is, that the CompareEditor doesn't allow me to open the subfile1 in order to copy it (along with  subfolder1) to the other side, where it is missing. 
This makes the CompareEditor nearly unusable.



More information:
I've found out that the subtree is explicitely not traversed. For good reasons: org.eclipse.compare.structuremergeviewer.Differencer
Line 248 
if (((threeWay && ancestorChildren != null) || !threeWay)
 && rightChildren != null && leftChildren != null) {
// we only recurse down if no leg is null

here, subfolder1 is on the right side and left side is null. Therefore, the subhierarchy is not traversed and we don't see the child files of "subfolder1"
If we simply remove the check, the compare result will be corrupt.
Comment 1 Tomasz Zarna CLA 2008-01-18 09:38:54 EST
Federico, I see your point but I'm afraid that fixing this issue doesn't come down to removing the check. I would expect different kind of errors popping up either when opening a non-existing children or saving changes. But still, it would be great if we had it fixed. Unfortunately, we don't have the manpower to address it at this time. Patches will be accepted.
Comment 2 Eclipse Webmaster CLA 2019-09-06 16:06:31 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.