Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 83590 Details for
Bug 210688
Three-way compare shows wrong changes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Patch that fixes the problem
patch210688.txt (text/plain), 2.22 KB, created by
Michael Valenta
on 2007-11-22 18:25:04 EST
(
hide
)
Description:
Patch that fixes the problem
Filename:
MIME Type:
Creator:
Michael Valenta
Created:
2007-11-22 18:25:04 EST
Size:
2.22 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.compare >Index: compare/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java,v >retrieving revision 1.4 >diff -u -r1.4 RangeComparatorLCS.java >--- compare/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java 16 Mar 2007 19:53:11 -0000 1.4 >+++ compare/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java 22 Nov 2007 23:19:51 -0000 >@@ -133,4 +133,59 @@ > subMonitor.worked(work); > } > >+ /** >+ * This method takes an LCS result interspersed with zeros (i.e. empty slots >+ * from the LCS algorithm), compacts it and shifts the LCS chunks as far towards >+ * the front as possible. This tends to produce good results most of the time. >+ * >+ * @param lcsSide A subsequence of original, presumably it is the LCS of it and >+ * some other collection of lines >+ * @param length The number of non-empty (i.e non-zero) entries in LCS >+ * @param comparator The comparator used to generate the LCS >+ * >+ * @return The subsequence lcs compacted and chunks shifted towards the >+ * front >+ */ >+ private int[] compactAndShiftLCS(int[] lcsSide, int length, >+ IRangeComparator comparator) { >+ int[] result = new int[length]; >+ >+ if (length == 0) { >+ return result; >+ } >+ >+ int j = 0; >+ >+ while (lcsSide[j] == 0) { >+ j++; >+ } >+ >+ result[0] = lcsSide[j]; >+ j++; >+ >+ for (int i = 1; i < length; i++) { >+ while (lcsSide[j] == 0) { >+ j++; >+ } >+ >+ int nextLine = result[i - 1] + 1; >+ if (nextLine != lcsSide[j] && comparator.rangesEqual(nextLine - 1, comparator, lcsSide[j] - 1)) { >+ result[i] = nextLine; >+ } else { >+ result[i] = lcsSide[j]; >+ } >+ j++; >+ } >+ >+ return result; >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.compare.internal.LCS#longestCommonSubsequence(org.eclipse.core.runtime.SubMonitor) >+ */ >+ public void longestCommonSubsequence(SubMonitor subMonitor) { >+ super.longestCommonSubsequence(subMonitor); >+ lcs[0] = compactAndShiftLCS(lcs[0], getLength(), comparator1); >+ lcs[1] = compactAndShiftLCS(lcs[1], getLength(), comparator2); >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 210688
:
83547
|
83590
|
83634
|
83637
|
83901