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

Bug 300347

Summary: [Sync View][Apply Patch] Fix hunks sorting
Product: [Eclipse Project] Platform Reporter: Tomasz Zarna <tomasz.zarna>
Component: TeamAssignee: Pawel Pogorzelski <pawel.pogorzelski1>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: 3.6   
Target Milestone: 3.6 M6   
Hardware: PC   
OS: Windows XP   
URL: http://wiki.eclipse.org/Apply_patch_in_Sync_view
Whiteboard:
Bug Depends on:    
Bug Blocks: 300345    
Attachments:
Description Flags
Patch_v01
none
Patch_v02 none

Description Tomasz Zarna CLA 2010-01-21 07:18:24 EST
Hunk labeled '123...' should not appear before '13...'.
Comment 1 Pawel Pogorzelski CLA 2010-02-09 06:32:10 EST
Created attachment 158576 [details]
Patch_v01
Comment 2 Pawel Pogorzelski CLA 2010-02-09 06:35:49 EST
Tom, please have a look. There is probably a better place for HunkDiffNodeSorter class.
Comment 3 Tomasz Zarna CLA 2010-02-09 15:17:08 EST
The patch works fine but I have a few concerns:
* I don't think the sorter needs to be API
* To avoid code duplication I would reuse org.eclipse.compare.structuremergeviewer.DiffTreeViewer.DiffViewerComparator. You already did that by copying the code to the sorter, but I think we can do better than that:
** Modify DiffViewerComparator so it extends ViewerSorter
** Set the new sorter as commonSorter for 'Patch' navigatorContent. I'm not sure if we can refer to inner classes in plugin.xml though. You will need to check it and either make the inner class public or convert it to top level class (internal I guess). It's your call.
Comment 4 Pawel Pogorzelski CLA 2010-02-10 05:41:22 EST
Created attachment 158682 [details]
Patch_v02
Comment 5 Pawel Pogorzelski CLA 2010-02-10 05:44:28 EST
Patch_v02 released to HEAD, marking as FIXED.