Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2009-03-18 11:50:58 +0000
committerTomasz Zarna2009-03-18 11:50:58 +0000
commit4ef746b3ecb3aa3872a80a29b8dff2230ea4a5a7 (patch)
tree1aa20be159c38e68daafd059722f567bb95584f5
parente2355a24555cf9db4c6a5f2eba2c5fdba6eb1eb6 (diff)
downloadeclipse.platform.team-4ef746b3ecb3aa3872a80a29b8dff2230ea4a5a7.tar.gz
eclipse.platform.team-4ef746b3ecb3aa3872a80a29b8dff2230ea4a5a7.tar.xz
eclipse.platform.team-4ef746b3ecb3aa3872a80a29b8dff2230ea4a5a7.zip
Rebasing
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java4
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/INavigatable.java4
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java84
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java25
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java18
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java2
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java2
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties8
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java5
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java3
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FilePatch.java (renamed from bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FileDiffWrapper.java)51
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java8
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java10
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java10
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java83
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java6
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java6
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java4
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java4
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java44
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java17
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java9
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/contentMergeViewers.exsd5
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/structureMergeViewers.exsd55
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/autofuzz-f1/addition.txt9
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_addition_context.txt14
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_context3_context.txt51
-rw-r--r--tests/org.eclipse.compare.tests/patchdata/patch_oneline_context.txt7
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AbstractPatchTest.java4
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java1
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FileDiffResultTest.java4
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java27
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java172
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java7
-rw-r--r--tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/performance/RangeDifferencerTest.java9
35 files changed, 528 insertions, 244 deletions
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
index 31a89a157..297ef6b48 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
@@ -175,6 +175,8 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane {
* @return the optional title argument or <code>null</code>
* @noreference This method is for internal use only. Clients should not
* call this method.
+ * @nooverride This method is not intended to be re-implemented or extended
+ * by clients.
*/
public String getTitleArgument() {
return fTitleArgument;
@@ -295,6 +297,8 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane {
* an optional argument for the pane's title
* @noreference This method is for internal use only. Clients should not
* call this method.
+ * @nooverride This method is not intended to be re-implemented or extended
+ * by clients.
*/
public void setTitleArgument(String argument) {
fTitleArgument= argument;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/INavigatable.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/INavigatable.java
index a53b876f6..8cfe6bd83 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/INavigatable.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/INavigatable.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -80,7 +80,7 @@ public interface INavigatable {
/**
* Request that the currently selected change be opened. Return <code>true</code>
- * if the request resulted in the change being opened and <code>false/code> if the
+ * if the request resulted in the change being opened and <code>false</code> if the
* currently selected change could not be opened.
* @return whether the selected change was opened.
*/
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 36619a511..e25be5bec 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -38,6 +38,7 @@ import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.SharedDocumentAdapter;
import org.eclipse.compare.internal.BufferedCanvas;
import org.eclipse.compare.internal.ChangePropertyAction;
+import org.eclipse.compare.internal.CompareEditor;
import org.eclipse.compare.internal.CompareEditorSelectionProvider;
import org.eclipse.compare.internal.CompareHandlerService;
import org.eclipse.compare.internal.CompareMessages;
@@ -2627,6 +2628,19 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
public void run() {
if (viewer != null) {
setActionsActivated(viewer.getSourceViewer(), connect);
+ if (isEditorBacked(viewer.getSourceViewer()) && connect) {
+ /*
+ * If editor backed, activating contributed actions
+ * might have disconnected actions provided in
+ * CompareEditorContributor => when connecting,
+ * refresh active editor in the contributor, when
+ * disconnecting do nothing. See bug 261229.
+ */
+ IWorkbenchPart part = getCompareConfiguration().getContainer().getWorkbenchPart();
+ if (part instanceof CompareEditor) {
+ ((CompareEditor) part).refreshActionBarsContributor();
+ }
+ }
}
}
});
@@ -3364,26 +3378,40 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
if (fCopyDiffRightToLeftItem != null)
((Action)fCopyDiffRightToLeftItem.getAction()).setEnabled(rightToLeft);
- boolean enableNavigation= isNavigationPossible();
-
if (fNextDiff != null) {
IAction a= fNextDiff.getAction();
- a.setEnabled(enableNavigation || hasNextElement(true));
+ a.setEnabled(isNavigationButtonEnabled(true, false));
}
if (fPreviousDiff != null) {
IAction a= fPreviousDiff.getAction();
- a.setEnabled(enableNavigation || hasNextElement(false));
+ a.setEnabled(isNavigationButtonEnabled(false, false));
}
if (fNextChange != null) {
IAction a= fNextChange.getAction();
- a.setEnabled(enableNavigation);
+ a.setEnabled(isNavigationButtonEnabled(true, true));
}
if (fPreviousChange != null) {
IAction a= fPreviousChange.getAction();
- a.setEnabled(enableNavigation);
+ a.setEnabled(isNavigationButtonEnabled(false, true));
}
}
+ private boolean isNavigationButtonEnabled(boolean down, boolean deep) {
+ String value = fPreferenceStore
+ .getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION);
+ if (value.equals(ICompareUIConstants.PREF_VALUE_DO_NOTHING)) {
+ return getNextVisibleDiff(down, deep) != null;
+ } else if (value.equals(ICompareUIConstants.PREF_VALUE_LOOP)) {
+ return isNavigationPossible();
+ } else if (value.equals(ICompareUIConstants.PREF_VALUE_NEXT)) {
+ return hasNextElement(down);
+ } else if (value.equals(ICompareUIConstants.PREF_VALUE_PROMPT)) {
+ return isNavigationPossible() || hasNextElement(true);
+ }
+ Assert.isTrue(false);
+ return false;
+ }
+
private void updateResolveStatus() {
RGB rgb= null;
@@ -3707,12 +3735,12 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
fUseSingleLine= fPreferenceStore.getBoolean(ComparePreferencePage.USE_SINGLE_LINE);
// fUseResolveUI= fUseSingleLine;
fBasicCenterCurve= null;
- updateResolveStatus();
+ updateControls();
invalidateLines();
} else if (key.equals(ComparePreferencePage.HIGHLIGHT_TOKEN_CHANGES)) {
fHighlightTokenChanges= fPreferenceStore.getBoolean(ComparePreferencePage.HIGHLIGHT_TOKEN_CHANGES);
- updateResolveStatus();
+ updateControls();
updatePresentation();
// } else if (key.equals(ComparePreferencePage.USE_RESOLVE_UI)) {
@@ -3767,11 +3795,13 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
} else {
setForegroundColor(createColor(fPreferenceStore, AbstractTextEditor.PREFERENCE_COLOR_FOREGROUND));
}
+ } else if (key.equals(ICompareUIConstants.PREF_NAVIGATION_END_ACTION)) {
+ updateControls();
} else {
super.handlePropertyChangeEvent(event);
if (key.equals(ICompareUIConstants.PROP_IGNORE_ANCESTOR)) {
- update(false);
+ update(true);
selectFirstDiff(true);
}
}
@@ -4321,18 +4351,12 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
}
private void handleEndOfDocumentReached(Shell shell, boolean next) {
- boolean hasNextElement = hasNextElement(next);
IPreferenceStore store = CompareUIPlugin.getDefault().getPreferenceStore();
String value = store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION);
if (!value.equals(ICompareUIConstants.PREF_VALUE_PROMPT)) {
- // We only want to do the automatic thing if there is something to do
- if (hasNextElement || store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION).equals(ICompareUIConstants.PREF_VALUE_LOOP)) {
performEndOfDocumentAction(shell, store, ICompareUIConstants.PREF_NAVIGATION_END_ACTION, next);
- return;
- }
- }
+ } else {
shell.getDisplay().beep();
- if (hasNextElement) {
String loopMessage;
String nextMessage;
String message;
@@ -4350,6 +4374,7 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
}
String[] localLoopOption = new String[] { loopMessage, ICompareUIConstants.PREF_VALUE_LOOP };
String[] nextElementOption = new String[] { nextMessage, ICompareUIConstants.PREF_VALUE_NEXT};
+ String[] doNothingOption = new String[] { CompareMessages.TextMergeViewer_17, ICompareUIConstants.PREF_VALUE_DO_NOTHING};
NavigationEndDialog dialog = new NavigationEndDialog(shell,
title,
null,
@@ -4357,38 +4382,31 @@ public class TextMergeViewer extends ContentMergeViewer implements IAdaptable {
new String[][] {
localLoopOption,
nextElementOption,
+ doNothingOption
});
int result = dialog.open();
if (result == Window.OK) {
performEndOfDocumentAction(shell, store, ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL, next);
if (dialog.getToggleState()) {
+ String oldValue = store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION);
store.putValue(ICompareUIConstants.PREF_NAVIGATION_END_ACTION, store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL));
+ store.firePropertyChangeEvent(ICompareUIConstants.PREF_NAVIGATION_END_ACTION, oldValue, store.getString(ICompareUIConstants.PREF_NAVIGATION_END_ACTION_LOCAL));
}
}
- } else {
- String message;
- String title;
- if (next) {
- title = CompareMessages.TextMergeViewer_8;
- message = CompareMessages.TextMergeViewer_9;
- } else {
- title = CompareMessages.TextMergeViewer_10;
- message = CompareMessages.TextMergeViewer_11;
- }
- if (MessageDialog.openQuestion(shell, title, message)) {
- selectFirstDiff(next);
- }
}
}
private void performEndOfDocumentAction(Shell shell, IPreferenceStore store, String key, boolean next) {
String value = store.getString(key);
+ if (value.equals(ICompareUIConstants.PREF_VALUE_DO_NOTHING)) {
+ return;
+ }
if (value.equals(ICompareUIConstants.PREF_VALUE_NEXT)) {
- ICompareNavigator navigator = getCompareConfiguration().getContainer().getNavigator();
- if (hasNextElement(next))
+ ICompareNavigator navigator = getCompareConfiguration()
+ .getContainer().getNavigator();
+ if (hasNextElement(next)) {
navigator.selectChange(next);
- else
- shell.getDisplay().beep();
+ }
} else {
selectFirstDiff(next);
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
index 6a5bb5886..1fdd5c1f6 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -59,6 +59,12 @@ public class AddFromHistoryAction extends BaseCompareAction {
} catch (CoreException ex) {
pm.done();
}
+
+ // There could be a recently deleted file at the same path as
+ // the container. If such a file is the only one to restore, we
+ // should not suggest to restore it, so set states to null.
+ if (states.length == 1 && states[0].getFullPath().equals(container.getFullPath()))
+ states = null;
if (states == null || states.length <= 0) {
String msg= Utilities.getString(bundle, "noLocalHistoryError"); //$NON-NLS-1$
@@ -71,20 +77,19 @@ public class AddFromHistoryAction extends BaseCompareAction {
dialog.setHelpContextId(ICompareContextIds.ADD_FROM_HISTORY_DIALOG);
}
- if (dialog.select(container, states)) {
-
- AddFromHistoryDialog.HistoryInput[] selected= dialog.getSelected();
-
- if (selected != null && selected.length > 0) {
+ if (dialog.select(container, states)) {
+ AddFromHistoryDialog.HistoryInput[] selected = dialog
+ .getSelected();
+ if (selected != null && selected.length > 0) {
try {
updateWorkspace(bundle, parentShell, selected);
-
} catch (InterruptedException x) {
// Do nothing. Operation has been canceled by user.
-
} catch (InvocationTargetException x) {
- String reason= x.getTargetException().getMessage();
- MessageDialog.openError(parentShell, title, Utilities.getFormattedString(bundle, "replaceError", reason)); //$NON-NLS-1$
+ String reason = x.getTargetException().getMessage();
+ MessageDialog.openError(parentShell, title,
+ Utilities.getFormattedString(bundle,
+ "replaceError", reason)); //$NON-NLS-1$
}
}
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
index e0745fdbe..0bb24bc9e 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -168,12 +168,18 @@ public class AddFromHistoryDialog extends ResizableDialog {
String prefix= root.getFullPath().toString();
if (fMemberTable != null && !fMemberTable.isDisposed()) {
- for (int i= 0; i < files.length; i++) {
- IFile file= files[i];
- String path= file.getFullPath().toString();
+ for (int i = 0; i < files.length; i++) {
+ IFile file = files[i];
+ String path = file.getFullPath().toString();
+
+ // ignore a recently deleted file at the same path as the
+ // container
+ if (path.equals(prefix))
+ continue;
+
if (path.startsWith(prefix))
- path= path.substring(prefix.length()+1);
- TableItem ti= new TableItem(fMemberTable, SWT.NONE);
+ path = path.substring(prefix.length() + 1);
+ TableItem ti = new TableItem(fMemberTable, SWT.NONE);
ti.setImage(CompareUI.getImage(file));
ti.setText(path);
ti.setData(new FileHistory(file));
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
index ced5faf57..cc822a356 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
@@ -250,7 +250,7 @@ public class CompareEditor extends EditorPart implements IReusableEditor, ISavea
refreshActionBarsContributor();
}
- private void refreshActionBarsContributor() {
+ public void refreshActionBarsContributor() {
IEditorSite editorSite= getEditorSite();
if (editorSite != null) {
IEditorActionBarContributor actionBarContributor= editorSite.getActionBarContributor();
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java
index 66f0e4bea..bfd0e8379 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java
@@ -51,6 +51,7 @@ public final class CompareMessages extends NLS {
public static String ComparePreferencePage_1;
public static String ComparePreferencePage_2;
public static String ComparePreferencePage_3;
+ public static String ComparePreferencePage_4;
public static String CompareUIPlugin_0;
public static String CompareUIPlugin_1;
public static String ContentMergeViewer_resource_changed_description;
@@ -75,6 +76,7 @@ public final class CompareMessages extends NLS {
public static String TextMergeViewer_14;
public static String TextMergeViewer_15;
public static String TextMergeViewer_16;
+ public static String TextMergeViewer_17;
public static String TextMergeViewer_2;
public static String TextMergeViewer_3;
public static String TextMergeViewer_4;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
index 903de260f..7fb37c36d 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.properties
@@ -73,6 +73,7 @@ TextMergeViewer_13=The element being edited is read-only
TextMergeViewer_14=Element is Read Only
TextMergeViewer_15=The element being edited is read-only
TextMergeViewer_16=Show &Line Numbers
+TextMergeViewer_17=Do nothing
TextMergeViewer_atEnd_message= End of document reached. Continue from beginning?
TextMergeViewer_atBeginning_title= Go to Previous Difference
@@ -84,9 +85,10 @@ CompareNavigator_atEnd_title= End Reached
CompareDialog_commit_button=C&ommit
CompareDialog_error_title=Error Saving Changes
ComparePreferencePage_0=When the end/beginning is reached while navigating an element
-ComparePreferencePage_1=Prompt
-ComparePreferencePage_2=Loop back to the beginning/end
-ComparePreferencePage_3=Go to the next/previous element
+ComparePreferencePage_1=Pro&mpt
+ComparePreferencePage_2=&Loop back to the beginning/end
+ComparePreferencePage_3=Go to the ne&xt/previous element
+ComparePreferencePage_4=D&o nothing
CompareDialog_error_message=The changes were not saved: {0}
CompareNavigator_atEnd_message= You have reached the last difference.
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
index bbcd0ce42..5108fdf68 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ComparePreferencePage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -350,7 +350,8 @@ public class ComparePreferencePage extends PreferencePage implements IWorkbenchP
new String[][] {
new String[] { CompareMessages.ComparePreferencePage_1, ICompareUIConstants.PREF_VALUE_PROMPT },
new String[] { CompareMessages.ComparePreferencePage_2, ICompareUIConstants.PREF_VALUE_LOOP },
- new String[] { CompareMessages.ComparePreferencePage_3, ICompareUIConstants.PREF_VALUE_NEXT}
+ new String[] { CompareMessages.ComparePreferencePage_3, ICompareUIConstants.PREF_VALUE_NEXT },
+ new String[] { CompareMessages.ComparePreferencePage_4, ICompareUIConstants.PREF_VALUE_DO_NOTHING}
},
radioGroup, true);
editor.setPreferenceStore(CompareUIPlugin.getDefault().getPreferenceStore());
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java
index d50cc0a85..aef3d3279 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/ICompareUIConstants.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -47,6 +47,7 @@ public interface ICompareUIConstants {
public static final String PREF_VALUE_PROMPT = "prompt"; //$NON-NLS-1$
public static final String PREF_VALUE_LOOP = "loop"; //$NON-NLS-1$
public static final String PREF_VALUE_NEXT = "next"; //$NON-NLS-1$
+ public static final String PREF_VALUE_DO_NOTHING = "doNothing"; //$NON-NLS-1$
public static final String COMMAND_IGNORE_WHITESPACE = PREFIX + "ignoreWhiteSpace"; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FileDiffWrapper.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FilePatch.java
index 6d3991953..5841f269e 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FileDiffWrapper.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/FilePatch.java
@@ -10,22 +10,19 @@
*******************************************************************************/
package org.eclipse.compare.internal.patch;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.patch.IFilePatch;
import org.eclipse.compare.patch.IFilePatchResult;
-import org.eclipse.compare.patch.IHunk;
import org.eclipse.compare.patch.PatchConfiguration;
-import org.eclipse.compare.patch.ReaderCreator;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-public class FileDiffWrapper implements IFilePatch {
+public class FilePatch extends FilePatch2 implements IFilePatch {
- private FileDiff fileDiff;
-
- public FileDiffWrapper(FileDiff fileDiff) {
- this.fileDiff = fileDiff;
+ public FilePatch(IPath oldPath, long oldDate, IPath newPath,
+ long newDate) {
+ super(oldPath, oldDate, newPath, newDate);
}
/*
@@ -38,41 +35,13 @@ public class FileDiffWrapper implements IFilePatch {
*/
public IFilePatchResult apply(IStorage content,
PatchConfiguration configuration, IProgressMonitor monitor) {
- return fileDiff.apply(content != null ? Utilities
- .getReaderCreator(content) : null, configuration, monitor);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.compare.patch.IFilePatch2#apply(org.eclipse.compare.patch
- * .ReaderCreator, org.eclipse.compare.patch.PatchConfiguration,
- * org.eclipse.core.runtime.IProgressMonitor)
- */
- public IFilePatchResult apply(ReaderCreator content,
- PatchConfiguration configuration, IProgressMonitor monitor) {
- return fileDiff.apply(content, configuration, monitor);
- }
-
- public long getAfterDate() {
- return fileDiff.getAfterDate();
- }
-
- public long getBeforeDate() {
- return fileDiff.getBeforeDate();
- }
-
- public String getHeader() {
- return fileDiff.getHeader();
- }
-
- public IPath getTargetPath(PatchConfiguration configuration) {
- return fileDiff.getTargetPath(configuration);
+ return apply(content != null ? Utilities.getReaderCreator(content)
+ : null, configuration, monitor);
}
- public IHunk[] getHunks() {
- return fileDiff.getHunks();
+ protected FilePatch2 create(IPath oldPath, long oldDate, IPath newPath,
+ long newDate) {
+ return new FilePatch(oldPath, oldDate, newPath, newDate);
}
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
index 0da38432f..9b51fb3c8 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -22,7 +22,7 @@ import java.io.StringReader;
import org.eclipse.compare.internal.ICompareContextIds;
import org.eclipse.compare.internal.Utilities;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
@@ -189,7 +189,7 @@ import com.ibm.icu.text.MessageFormat;
// Read in the patch
readInPatch();
- FileDiff[] diffs= patcher.getDiffs();
+ FilePatch2[] diffs= patcher.getDiffs();
if (diffs == null || diffs.length == 0) {
String format= PatchMessages.InputPatchPage_NoDiffsFound_format;
String message= MessageFormat.format(format, new String[] { fPatchSource });
@@ -792,7 +792,7 @@ import com.ibm.icu.text.MessageFormat;
return false;
}
- FileDiff[] diffs= patcher.getDiffs();
+ FilePatch2[] diffs= patcher.getDiffs();
if (diffs == null || diffs.length == 0)
return false;
return true;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java
index 28cd43e9d..f68109d49 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchCompareEditorInput.java
@@ -15,7 +15,7 @@ import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.*;
import org.eclipse.compare.internal.*;
import org.eclipse.compare.internal.core.patch.DiffProject;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.FileDiffResult;
import org.eclipse.compare.internal.core.patch.HunkResult;
import org.eclipse.compare.patch.PatchConfiguration;
@@ -206,7 +206,7 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
getViewer().refresh();
}
- private void processDiffs(FileDiff[] diffs) {
+ private void processDiffs(FilePatch2[] diffs) {
for (int i = 0; i < diffs.length; i++) {
processDiff(diffs[i], getRoot());
}
@@ -216,15 +216,15 @@ public abstract class PatchCompareEditorInput extends CompareEditorInput {
//create diffProject nodes
for (int i = 0; i < diffProjects.length; i++) {
PatchProjectDiffNode projectNode = new PatchProjectDiffNode(getRoot(), diffProjects[i], getPatcher().getConfiguration());
- FileDiff[] diffs = diffProjects[i].getFileDiffs();
+ FilePatch2[] diffs = diffProjects[i].getFileDiffs();
for (int j = 0; j < diffs.length; j++) {
- FileDiff fileDiff = diffs[j];
+ FilePatch2 fileDiff = diffs[j];
processDiff(fileDiff, projectNode);
}
}
}
- private void processDiff(FileDiff diff, DiffNode parent) {
+ private void processDiff(FilePatch2 diff, DiffNode parent) {
FileDiffResult diffResult = getPatcher().getDiffResult(diff);
PatchFileDiffNode node = PatchFileDiffNode.createDiffNode(parent, diffResult);
HunkResult[] hunkResults = diffResult.getHunkResults();
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java
index 15cfa5a22..8149140ea 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchFileDiffNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,7 @@
package org.eclipse.compare.internal.patch;
import org.eclipse.compare.*;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.FileDiffResult;
import org.eclipse.compare.patch.PatchConfiguration;
import org.eclipse.compare.structuremergeviewer.*;
@@ -36,13 +36,13 @@ public class PatchFileDiffNode extends PatchDiffNode implements IContentChangeLi
private static int convertFileDiffTypeToDifferencerType(int fileDiffKind) {
int kind;
switch (fileDiffKind) {
- case FileDiff.ADDITION:
+ case FilePatch2.ADDITION:
kind = Differencer.ADDITION;
break;
- case FileDiff.DELETION:
+ case FilePatch2.DELETION:
kind = Differencer.DELETION;
break;
- case FileDiff.CHANGE:
+ case FilePatch2.CHANGE:
kind = Differencer.CHANGE;
break;
default:
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index 9fb1787d2..0217db414 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -28,7 +28,7 @@ import java.util.Set;
import org.eclipse.compare.internal.core.Messages;
import org.eclipse.compare.internal.core.patch.DiffProject;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.FileDiffResult;
import org.eclipse.compare.internal.core.patch.Hunk;
import org.eclipse.compare.internal.core.patch.PatchReader;
@@ -77,7 +77,7 @@ public class Patcher implements IHunkFilter {
// private static final int NORMAL= 2;
// private static final int UNIFIED= 3;
- private FileDiff[] fDiffs;
+ private FilePatch2[] fDiffs;
private IResource fTarget;
// patch options
private Set disabledElements = new HashSet();
@@ -98,13 +98,13 @@ public class Patcher implements IHunkFilter {
* Returns an array of Diffs after a sucessfull call to <code>parse</code>.
* If <code>parse</code> hasn't been called returns <code>null</code>.
*/
- public FileDiff[] getDiffs() {
+ public FilePatch2[] getDiffs() {
if (fDiffs == null)
- return new FileDiff[0];
+ return new FilePatch2[0];
return fDiffs;
}
- public IPath getPath(FileDiff diff) {
+ public IPath getPath(FilePatch2 diff) {
return diff.getStrippedPath(getStripPrefixSegments(), isReversed());
}
@@ -176,7 +176,12 @@ public class Patcher implements IHunkFilter {
}
public void parse(BufferedReader reader) throws IOException {
- PatchReader patchReader= new PatchReader();
+ PatchReader patchReader = new PatchReader() {
+ protected FilePatch2 createFileDiff(IPath oldPath, long oldDate,
+ IPath newPath, long newDate) {
+ return new FilePatch(oldPath, oldDate, newPath, newDate);
+ }
+ };
patchReader.parse(reader);
patchParsed(patchReader);
}
@@ -186,11 +191,11 @@ public class Patcher implements IHunkFilter {
}
public void countLines() {
- FileDiff[] fileDiffs = getDiffs();
+ FilePatch2[] fileDiffs = getDiffs();
for (int i = 0; i < fileDiffs.length; i++) {
int addedLines = 0;
int removedLines = 0;
- FileDiff fileDiff = fileDiffs[i];
+ FilePatch2 fileDiff = fileDiffs[i];
for (int j = 0; j < fileDiff.getHunkCount(); j++) {
IHunk hunk = fileDiff.getHunks()[j];
String[] lines = ((Hunk) hunk).getLines();
@@ -234,10 +239,10 @@ public class Patcher implements IHunkFilter {
list.add(singleFile);
else {
for (i= 0; i < fDiffs.length; i++) {
- FileDiff diff= fDiffs[i];
+ FilePatch2 diff= fDiffs[i];
if (isEnabled(diff)) {
switch (diff.getDiffType(isReversed())) {
- case FileDiff.CHANGE:
+ case FilePatch2.CHANGE:
list.add(createPath(container, getPath(diff)));
break;
}
@@ -258,7 +263,7 @@ public class Patcher implements IHunkFilter {
int workTicks= WORK_UNIT;
- FileDiff diff= fDiffs[i];
+ FilePatch2 diff= fDiffs[i];
if (isEnabled(diff)) {
IPath path= getPath(diff);
@@ -273,18 +278,18 @@ public class Patcher implements IHunkFilter {
int type= diff.getDiffType(isReversed());
switch (type) {
- case FileDiff.ADDITION:
+ case FilePatch2.ADDITION:
// patch it and collect rejected hunks
List result= apply(diff, file, true, failed);
if (result != null)
store(LineReader.createString(isPreserveLineDelimeters(), result), file, new SubProgressMonitor(pm, workTicks));
workTicks-= WORK_UNIT;
break;
- case FileDiff.DELETION:
+ case FilePatch2.DELETION:
file.delete(true, true, new SubProgressMonitor(pm, workTicks));
workTicks-= WORK_UNIT;
break;
- case FileDiff.CHANGE:
+ case FilePatch2.CHANGE:
// patch it and collect rejected hunks
result= apply(diff, file, false, failed);
if (result != null)
@@ -328,7 +333,7 @@ public class Patcher implements IHunkFilter {
return pp;
}
- List apply(FileDiff diff, IFile file, boolean create, List failedHunks) {
+ List apply(FilePatch2 diff, IFile file, boolean create, List failedHunks) {
FileDiffResult result = getDiffResult(diff);
List lines = LineReader.load(file, create);
result.patch(lines, null);
@@ -432,7 +437,7 @@ public class Patcher implements IHunkFilter {
}
- public IFile getTargetFile(FileDiff diff) {
+ public IFile getTargetFile(FilePatch2 diff) {
IPath path = diff.getStrippedPath(getStripPrefixSegments(), isReversed());
return existsInTarget(path);
}
@@ -476,21 +481,21 @@ public class Patcher implements IHunkFilter {
int length= 99;
if (fDiffs!=null)
for (int i= 0; i<fDiffs.length; i++) {
- FileDiff diff= fDiffs[i];
+ FilePatch2 diff= fDiffs[i];
length= Math.min(length, diff.segmentCount());
}
return length;
}
- public void addDiff(FileDiff newDiff){
- FileDiff[] temp = new FileDiff[fDiffs.length + 1];
+ public void addDiff(FilePatch2 newDiff){
+ FilePatch2[] temp = new FilePatch2[fDiffs.length + 1];
System.arraycopy(fDiffs,0, temp, 0, fDiffs.length);
temp[fDiffs.length] = newDiff;
fDiffs = temp;
}
- public void removeDiff(FileDiff diffToRemove){
- FileDiff[] temp = new FileDiff[fDiffs.length - 1];
+ public void removeDiff(FilePatch2 diffToRemove){
+ FilePatch2[] temp = new FilePatch2[fDiffs.length - 1];
int counter = 0;
for (int i = 0; i < fDiffs.length; i++) {
if (fDiffs[i] != diffToRemove){
@@ -503,20 +508,20 @@ public class Patcher implements IHunkFilter {
public void setEnabled(Object element, boolean enabled) {
if (element instanceof DiffProject)
setEnabledProject((DiffProject) element, enabled);
- if (element instanceof FileDiff)
- setEnabledFile((FileDiff)element, enabled);
+ if (element instanceof FilePatch2)
+ setEnabledFile((FilePatch2)element, enabled);
if (element instanceof Hunk)
setEnabledHunk((Hunk) element, enabled);
}
private void setEnabledProject(DiffProject projectDiff, boolean enabled) {
- FileDiff[] diffFiles = projectDiff.getFileDiffs();
+ FilePatch2[] diffFiles = projectDiff.getFileDiffs();
for (int i = 0; i < diffFiles.length; i++) {
setEnabledFile(diffFiles[i], enabled);
}
}
- private void setEnabledFile(FileDiff fileDiff, boolean enabled) {
+ private void setEnabledFile(FilePatch2 fileDiff, boolean enabled) {
IHunk[] hunks = fileDiff.getHunks();
for (int i = 0; i < hunks.length; i++) {
setEnabledHunk((Hunk) hunks[i], enabled);
@@ -526,14 +531,14 @@ public class Patcher implements IHunkFilter {
private void setEnabledHunk(Hunk hunk, boolean enabled) {
if (enabled) {
disabledElements.remove(hunk);
- FileDiff file = hunk.getParent();
+ FilePatch2 file = hunk.getParent();
disabledElements.remove(file);
DiffProject project = file.getProject();
if (project != null)
disabledElements.remove(project);
} else {
disabledElements.add(hunk);
- FileDiff file = hunk.getParent();
+ FilePatch2 file = hunk.getParent();
if (disabledElements.containsAll(Arrays.asList(file.getHunks()))) {
disabledElements.add(file);
DiffProject project = file.getProject();
@@ -570,12 +575,12 @@ public class Patcher implements IHunkFilter {
public int guessFuzzFactor(IProgressMonitor monitor) {
try {
monitor.beginTask(Messages.Patcher_2, IProgressMonitor.UNKNOWN);
- FileDiff[] diffs= getDiffs();
+ FilePatch2[] diffs= getDiffs();
if (diffs==null||diffs.length<=0)
return -1;
int fuzz= -1;
for (int i= 0; i<diffs.length; i++) {
- FileDiff d= diffs[i];
+ FilePatch2 d= diffs[i];
IFile file= getTargetFile(d);
if (file != null && file.exists()) {
List lines= LineReader.load(file, false);
@@ -596,15 +601,15 @@ public class Patcher implements IHunkFilter {
refresh(getDiffs());
}
- protected void refresh(FileDiff[] diffs) {
+ protected void refresh(FilePatch2[] diffs) {
for (int i = 0; i < diffs.length; i++) {
- FileDiff diff = diffs[i];
+ FilePatch2 diff = diffs[i];
FileDiffResult result = getDiffResult(diff);
((WorkspaceFileDiffResult)result).refresh();
}
}
- public FileDiffResult getDiffResult(FileDiff diff) {
+ public FileDiffResult getDiffResult(FilePatch2 diff) {
FileDiffResult result = (FileDiffResult)diffResults.get(diff);
if (result == null) {
result = new WorkspaceFileDiffResult(diff, getConfiguration());
@@ -623,7 +628,7 @@ public class Patcher implements IHunkFilter {
* @param diff the diff
* @return the project that contains the diff
*/
- public DiffProject getProject(FileDiff diff) {
+ public DiffProject getProject(FilePatch2 diff) {
return diff.getProject();
}
@@ -651,7 +656,7 @@ public class Patcher implements IHunkFilter {
* @param diff the file diff
* @param contents the contents for the file diff
*/
- public void cacheContents(FileDiff diff, byte[] contents) {
+ public void cacheContents(FilePatch2 diff, byte[] contents) {
contentCache.put(diff, contents);
}
@@ -660,9 +665,9 @@ public class Patcher implements IHunkFilter {
* given file diff.
* @param diff the file diff
* @return whether contents have been cached for the file diff
- * @see #cacheContents(FileDiff, byte[])
+ * @see #cacheContents(FilePatch2, byte[])
*/
- public boolean hasCachedContents(FileDiff diff) {
+ public boolean hasCachedContents(FilePatch2 diff) {
return contentCache.containsKey(diff);
}
@@ -672,7 +677,7 @@ public class Patcher implements IHunkFilter {
* @param diff the file diff
* @return the content lines that are cached for the file diff
*/
- public List getCachedLines(FileDiff diff) {
+ public List getCachedLines(FilePatch2 diff) {
byte[] contents = (byte[])contentCache.get(diff);
if (contents != null) {
BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(contents)));
@@ -688,7 +693,7 @@ public class Patcher implements IHunkFilter {
* @return the contents that are cached for the given diff or
* <code>null</code>
*/
- public byte[] getCachedContents(FileDiff diff) {
+ public byte[] getCachedContents(FilePatch2 diff) {
return (byte[])contentCache.get(diff);
}
@@ -727,7 +732,7 @@ public class Patcher implements IHunkFilter {
mergedHunks.remove(hunk);
}
- public IProject getTargetProject(FileDiff diff) {
+ public IProject getTargetProject(FilePatch2 diff) {
DiffProject dp = getProject(diff);
if (dp != null)
return Utilities.getProject(dp);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
index 49db581a9..c28684f2b 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage2.java
@@ -19,7 +19,7 @@ import org.eclipse.compare.CompareUI;
import org.eclipse.compare.internal.ComparePreferencePage;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.ICompareUIConstants;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.Hunk;
import org.eclipse.compare.patch.IHunk;
import org.eclipse.core.runtime.Assert;
@@ -705,7 +705,7 @@ public class PreviewPatchPage2 extends WizardPage {
&& (removedLinesRegex == null || "".equals(removedLinesRegex))) { //$NON-NLS-1$
fPatcher.countLines();
- FileDiff[] fileDiffs = fPatcher.getDiffs();
+ FilePatch2[] fileDiffs = fPatcher.getDiffs();
for (int i = 0; i < fileDiffs.length; i++) {
added += fileDiffs[i].getAddedLines();
removed += fileDiffs[i].getRemovedLines();
@@ -716,7 +716,7 @@ public class PreviewPatchPage2 extends WizardPage {
Pattern addedPattern = Pattern.compile(addedLinesRegex);
Pattern removedPattern = Pattern.compile(removedLinesRegex);
- FileDiff[] fileDiffs = fPatcher.getDiffs();
+ FilePatch2[] fileDiffs = fPatcher.getDiffs();
for (int i = 0; i < fileDiffs.length; i++) {
IHunk[] hunks = fileDiffs[i].getHunks();
for (int j = 0; j < hunks.length; j++) {
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java
index 3a515616f..3efc37027 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/RetargetPatchElementDialog.java
@@ -13,7 +13,7 @@ package org.eclipse.compare.internal.patch;
import java.util.ArrayList;
import org.eclipse.compare.internal.core.patch.DiffProject;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.Hunk;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.Assert;
@@ -148,7 +148,7 @@ class RetargetPatchElementDialog extends Dialog {
} else if (fSelectedNode instanceof PatchFileDiffNode) {
PatchFileDiffNode node = (PatchFileDiffNode) fSelectedNode;
//copy over all hunks to new target resource
- FileDiff diff = node.getDiffResult().getDiff();
+ FilePatch2 diff = node.getDiffResult().getDiff();
return NLS.bind(PatchMessages.RetargetPatchElementDialog_0, fPatcher.getPath(diff));
} else if (fSelectedNode instanceof HunkDiffNode) {
HunkDiffNode node = (HunkDiffNode) fSelectedNode;
@@ -167,7 +167,7 @@ class RetargetPatchElementDialog extends Dialog {
} else if (fSelectedNode instanceof PatchFileDiffNode && fSelectedResource instanceof IFile) {
PatchFileDiffNode node = (PatchFileDiffNode) fSelectedNode;
//copy over all hunks to new target resource
- FileDiff diff = node.getDiffResult().getDiff();
+ FilePatch2 diff = node.getDiffResult().getDiff();
fPatcher.retargetDiff(diff, (IFile)fSelectedResource);
} else if (fSelectedNode instanceof HunkDiffNode && fSelectedResource instanceof IFile) {
HunkDiffNode node = (HunkDiffNode) fSelectedNode;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java
index e0e33b62e..09eb69c83 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/UnmatchedHunkTypedElement.java
@@ -21,7 +21,7 @@ import org.eclipse.compare.IEditableContent;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.internal.CompareUIPlugin;
import org.eclipse.compare.internal.ContentChangeNotifier;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.HunkResult;
import org.eclipse.compare.patch.PatchConfiguration;
import org.eclipse.core.resources.IFile;
@@ -79,7 +79,7 @@ public class UnmatchedHunkTypedElement extends HunkTypedElement implements ICont
changeNotifier.fireContentChanged();
}
- private FileDiff getDiff() {
+ private FilePatch2 getDiff() {
return getHunkResult().getDiffResult().getDiff();
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java
index abaaa48cb..81711f1ea 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspaceFileDiffResult.java
@@ -12,7 +12,7 @@ package org.eclipse.compare.internal.patch;
import java.util.List;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.FileDiffResult;
import org.eclipse.compare.patch.PatchConfiguration;
import org.eclipse.core.resources.IFile;
@@ -21,7 +21,7 @@ import org.eclipse.core.resources.IStorage;
public class WorkspaceFileDiffResult extends FileDiffResult {
- public WorkspaceFileDiffResult(FileDiff diff,
+ public WorkspaceFileDiffResult(FilePatch2 diff,
PatchConfiguration configuration) {
super(diff, configuration);
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
index 4bed69672..0699d116c 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/WorkspacePatcher.java
@@ -18,7 +18,7 @@ import java.util.Map;
import org.eclipse.compare.internal.core.Messages;
import org.eclipse.compare.internal.core.patch.DiffProject;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.Hunk;
import org.eclipse.compare.internal.core.patch.PatchReader;
import org.eclipse.compare.patch.IHunk;
@@ -91,7 +91,7 @@ public class WorkspacePatcher extends Patcher {
return;
}
- FileDiff[] diffs = getDiffs();
+ FilePatch2[] diffs = getDiffs();
if (pm != null) {
String message= Messages.WorkspacePatcher_0;
pm.beginTask(message, diffs.length * WORK_UNIT);
@@ -101,7 +101,7 @@ public class WorkspacePatcher extends Patcher {
int workTicks= WORK_UNIT;
- FileDiff diff= diffs[i];
+ FilePatch2 diff= diffs[i];
if (isAccessible(diff)) {
IFile file= getTargetFile(diff);
IPath path= file.getProjectRelativePath();
@@ -113,18 +113,18 @@ public class WorkspacePatcher extends Patcher {
int type= diff.getDiffType(isReversed());
switch (type) {
- case FileDiff.ADDITION :
+ case FilePatch2.ADDITION :
// patch it and collect rejected hunks
List result= apply(diff, file, true, failed);
if (result != null)
store(LineReader.createString(isPreserveLineDelimeters(), result), file, new SubProgressMonitor(pm, workTicks));
workTicks -= WORK_UNIT;
break;
- case FileDiff.DELETION :
+ case FilePatch2.DELETION :
file.delete(true, true, new SubProgressMonitor(pm, workTicks));
workTicks -= WORK_UNIT;
break;
- case FileDiff.CHANGE :
+ case FilePatch2.CHANGE :
// patch it and collect rejected hunks
result= apply(diff, file, false, failed);
if (result != null)
@@ -164,7 +164,7 @@ public class WorkspacePatcher extends Patcher {
}
}
- private boolean isAccessible(FileDiff diff) {
+ private boolean isAccessible(FilePatch2 diff) {
return isEnabled(diff) && Utilities.getProject(diff.getProject()).isAccessible();
}
@@ -176,9 +176,9 @@ public class WorkspacePatcher extends Patcher {
*/
public IFile[] getTargetFiles(DiffProject project) {
List files= new ArrayList();
- FileDiff[] diffs = project.getFileDiffs();
+ FilePatch2[] diffs = project.getFileDiffs();
for (int i = 0; i < diffs.length; i++) {
- FileDiff diff = diffs[i];
+ FilePatch2 diff = diffs[i];
if (isEnabled(diff)) {
files.add(getTargetFile(diff));
}
@@ -186,7 +186,7 @@ public class WorkspacePatcher extends Patcher {
return (IFile[]) files.toArray(new IFile[files.size()]);
}
- public IFile getTargetFile(FileDiff diff) {
+ public IFile getTargetFile(FilePatch2 diff) {
IPath path = diff.getStrippedPath(getStripPrefixSegments(), isReversed());
DiffProject project = getProject(diff);
if (project != null)
@@ -194,7 +194,7 @@ public class WorkspacePatcher extends Patcher {
return super.getTargetFile(diff);
}
- private IPath getFullPath(FileDiff diff) {
+ private IPath getFullPath(FilePatch2 diff) {
IPath path = diff.getStrippedPath(getStripPrefixSegments(), isReversed());
DiffProject project = getProject(diff);
if (project != null)
@@ -238,8 +238,8 @@ public class WorkspacePatcher extends Patcher {
}
protected Object getElementParent(Object element) {
- if (element instanceof FileDiff && fDiffProjects != null) {
- FileDiff diff = (FileDiff) element;
+ if (element instanceof FilePatch2 && fDiffProjects != null) {
+ FilePatch2 diff = (FilePatch2) element;
for (int i = 0; i < fDiffProjects.length; i++) {
DiffProject project = fDiffProjects[i];
if (project.contains(diff))
@@ -257,7 +257,7 @@ public class WorkspacePatcher extends Patcher {
return (IPath)retargetedDiffs.get(object);
}
- public void retargetDiff(FileDiff diff, IFile file) {
+ public void retargetDiff(FilePatch2 diff, IFile file) {
retargetedDiffs.put(diff, diff.getPath(false));
IHunk[] hunks = diff.getHunks();
@@ -266,16 +266,16 @@ public class WorkspacePatcher extends Patcher {
diff.getProject().remove(diff);
}
removeDiff(diff);
- FileDiff newDiff = getDiffForFile(file);
+ FilePatch2 newDiff = getDiffForFile(file);
for (int i = 0; i < hunks.length; i++) {
Hunk hunk = (Hunk) hunks[i];
newDiff.add(hunk);
}
}
- private FileDiff getDiffForFile(IFile file) {
+ private FilePatch2 getDiffForFile(IFile file) {
DiffProject diffProject = null;
- FileDiff[] diffsToCheck;
+ FilePatch2[] diffsToCheck;
if (isWorkspacePatch()){
// Check if the diff project already exists for the file
IProject project = file.getProject();
@@ -296,7 +296,7 @@ public class WorkspacePatcher extends Patcher {
}
// Check to see if a diff already exists for the file
for (int i = 0; i < diffsToCheck.length; i++) {
- FileDiff fileDiff = diffsToCheck[i];
+ FilePatch2 fileDiff = diffsToCheck[i];
if (isDiffForFile(fileDiff, file)) {
return fileDiff;
}
@@ -304,7 +304,7 @@ public class WorkspacePatcher extends Patcher {
// Create a new diff for the file
IPath path = getDiffPath(file);
- FileDiff newDiff = new FileDiff(path, 0, path, 0);
+ FilePatch2 newDiff = new FilePatch2(path, 0, path, 0);
if (diffProject != null){
diffProject.add(newDiff);
}
@@ -320,7 +320,7 @@ public class WorkspacePatcher extends Patcher {
return file.getFullPath().removeFirstSegments(getTarget().getFullPath().segmentCount());
}
- private boolean isDiffForFile(FileDiff fileDiff, IFile file) {
+ private boolean isDiffForFile(FilePatch2 fileDiff, IFile file) {
return getFullPath(fileDiff).equals(file.getFullPath());
}
@@ -335,13 +335,13 @@ public class WorkspacePatcher extends Patcher {
}
public void retargetHunk(Hunk hunk, IFile file) {
- FileDiff newDiff = getDiffForFile(file);
+ FilePatch2 newDiff = getDiffForFile(file);
newDiff.add(hunk);
}
public void retargetProject(DiffProject project, IProject targetProject) {
retargetedDiffs.put(project, Utilities.getProject(project).getFullPath());
- FileDiff[] diffs = project.getFileDiffs();
+ FilePatch2[] diffs = project.getFileDiffs();
DiffProject selectedProject = getDiffProject(targetProject);
if (selectedProject == null)
selectedProject = addDiffProjectForProject(targetProject);
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
index 470d54499..0ce507cbb 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/patch/ApplyPatchOperation.java
@@ -16,9 +16,9 @@ import java.io.IOException;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.internal.ComparePreferencePage;
import org.eclipse.compare.internal.CompareUIPlugin;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.PatchReader;
-import org.eclipse.compare.internal.patch.FileDiffWrapper;
+import org.eclipse.compare.internal.patch.FilePatch;
import org.eclipse.compare.internal.patch.PatchWizard;
import org.eclipse.compare.internal.patch.PatchWizardDialog;
import org.eclipse.compare.internal.patch.Utilities;
@@ -27,6 +27,7 @@ import org.eclipse.core.resources.IStorage;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -204,13 +205,19 @@ public class ApplyPatchOperation implements Runnable {
throws CoreException {
BufferedReader reader = Utilities.createReader(storage);
try {
- PatchReader patchReader = new PatchReader();
+ PatchReader patchReader = new PatchReader() {
+ protected FilePatch2 createFileDiff(IPath oldPath, long oldDate,
+ IPath newPath, long newDate) {
+ return new FilePatch(oldPath, oldDate, newPath,
+ newDate);
+ }
+ };
patchReader.parse(reader);
- FileDiff[] fileDiffs = patchReader.getAdjustedDiffs();
+ FilePatch2[] fileDiffs = patchReader.getAdjustedDiffs();
IFilePatch[] filePatch = new IFilePatch[fileDiffs.length];
for (int i = 0; i < fileDiffs.length; i++) {
- filePatch[i] = new FileDiffWrapper(fileDiffs[i]);
+ filePatch[i] = (FilePatch) fileDiffs[i];
}
return filePatch;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
index d5e2a7340..5acd5701b 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -214,8 +214,7 @@ public class DiffTreeViewer extends TreeViewer {
return DiffTreeViewer.this.getInput();
}
public boolean openSelectedChange() {
- internalOpen();
- return true;
+ return internalOpen();
}
public boolean hasChange(int changeFlag) {
return getNextItem(changeFlag == INavigatable.NEXT_CHANGE) != null;
@@ -754,11 +753,13 @@ public class DiffTreeViewer extends TreeViewer {
/*
* Fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=20106
*/
- private void internalOpen() {
+ private boolean internalOpen() {
ISelection selection= getSelection();
if (selection != null && !selection.isEmpty()) {
fireOpen(new OpenEvent(this, selection));
+ return true;
}
+ return false;
}
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/contentMergeViewers.exsd b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/contentMergeViewers.exsd
index ee34a6dc5..35ac4e5cd 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/contentMergeViewers.exsd
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/contentMergeViewers.exsd
@@ -83,7 +83,7 @@ content merge viewer and implements &lt;samp&gt;org.eclipse.compare.IViewerCreat
<attribute name="label" type="string">
<annotation>
<documentation>
- a translatable label that will be used in the UI for this viewer
+ Since 3.5. A translatable label that will be used in the UI for this viewer.
</documentation>
<appInfo>
<meta.attribute translatable="true"/>
@@ -136,7 +136,8 @@ for text files (extension &quot;txt&quot;):
&lt;viewer
id=&quot;org.eclipse.compare.contentmergeviewer.TextMergeViewer&quot;
class=&quot;org.eclipse.compare.internal.TextMergeViewerCreator&quot;
- extensions=&quot;txt&quot;
+ extensions=&quot;txt&quot;
+ label=&quot;Text Compare&quot;
/&gt;
&lt;/extension&gt;
&lt;/pre&gt;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/structureMergeViewers.exsd b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/structureMergeViewers.exsd
index 38da39338..644461f27 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/structureMergeViewers.exsd
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/schema/structureMergeViewers.exsd
@@ -2,9 +2,9 @@
<!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.compare" xmlns="http://www.w3.org/2001/XMLSchema">
<annotation>
- <appinfo>
+ <appInfo>
<meta.schema plugin="org.eclipse.compare" id="structureMergeViewers" name="StructureMerge Viewers"/>
- </appinfo>
+ </appInfo>
<documentation>
This extension point allows a plug-in to register compare/merge
viewers for structural content types. The viewer is expected to
@@ -17,9 +17,9 @@ for viewers &lt;samp&gt;org.eclipse.compare.IViewerCreator&lt;/samp&gt;.
<element name="extension">
<annotation>
- <appinfo>
+ <appInfo>
<meta.element />
- </appinfo>
+ </appInfo>
</annotation>
<complexType>
<sequence>
@@ -45,9 +45,9 @@ for viewers &lt;samp&gt;org.eclipse.compare.IViewerCreator&lt;/samp&gt;.
<documentation>
an optional name of the extension instance
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute translatable="true"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
@@ -68,9 +68,9 @@ for viewers &lt;samp&gt;org.eclipse.compare.IViewerCreator&lt;/samp&gt;.
a fully qualified name of a class that implements a factory for the
structure merge viewer and implements &lt;samp&gt;org.eclipse.compare.IViewerCreator&lt;/samp&gt;
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="java" basedOn=":org.eclipse.compare.IViewerCreator"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
<attribute name="extensions" type="string" use="required">
@@ -80,6 +80,16 @@ structure merge viewer and implements &lt;samp&gt;org.eclipse.compare.IViewerCre
</documentation>
</annotation>
</attribute>
+ <attribute name="label" type="string">
+ <annotation>
+ <documentation>
+ Since 3.5. A translatable label that will be used in the UI for this viewer.
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
</complexType>
</element>
@@ -95,9 +105,9 @@ structure merge viewer and implements &lt;samp&gt;org.eclipse.compare.IViewerCre
<documentation>
The id of a content type defined using the &lt;code&gt;org.eclipse.core.contenttype.contentTypes&lt;/code&gt; extension point.
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="identifier" basedOn="org.eclipse.core.contenttype.contentTypes/content-type/@id"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
<attribute name="structureMergeViewerId" type="string" use="required">
@@ -105,18 +115,18 @@ structure merge viewer and implements &lt;samp&gt;org.eclipse.compare.IViewerCre
<documentation>
The id of a structure merge viewer defined using the &lt;code&gt;viewer&lt;/code&gt; element of this extension point (i.e. &lt;code&gt;org.eclipse.compare.structureMergeViewers&lt;/code&gt;)
</documentation>
- <appinfo>
+ <appInfo>
<meta.attribute kind="identifier" basedOn="org.eclipse.compare.structureMergeViewers/viewer/@id"/>
- </appinfo>
+ </appInfo>
</annotation>
</attribute>
</complexType>
</element>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="examples"/>
- </appinfo>
+ </appInfo>
<documentation>
The following is an example of compare/merge viewer
for zip files (extension &quot;zip&quot;):
@@ -126,7 +136,8 @@ for zip files (extension &quot;zip&quot;):
&lt;viewer
id=&quot;org.eclipse.compare.ZipCompareViewer&quot;
class=&quot;org.eclipse.compare.ZipCompareViewerCreator&quot;
- extensions=&quot;zip&quot;
+ extensions=&quot;zip&quot;
+ label=&quot;Binary Compare&quot;
/&gt;
&lt;/extension&gt;
&lt;/pre&gt;
@@ -135,9 +146,9 @@ for zip files (extension &quot;zip&quot;):
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="apiInfo"/>
- </appinfo>
+ </appInfo>
<documentation>
The contributed class must implement &lt;code&gt;org.eclipse.compare.IViewerCreator&lt;/code&gt;
</documentation>
@@ -145,9 +156,9 @@ for zip files (extension &quot;zip&quot;):
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="implementation"/>
- </appinfo>
+ </appInfo>
<documentation>
The Compare UI plugin defines a structure compare
viewer for zip archives.
@@ -155,11 +166,11 @@ viewer for zip archives.
</annotation>
<annotation>
- <appinfo>
+ <appInfo>
<meta.section type="copyright"/>
- </appinfo>
+ </appInfo>
<documentation>
- Copyright (c) 2000, 2008 IBM Corporation and others.&lt;br&gt;
+ Copyright (c) 2000, 2009 IBM Corporation and others.&lt;br&gt;
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at &lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
</documentation>
</annotation>
diff --git a/tests/org.eclipse.compare.tests/patchdata/autofuzz-f1/addition.txt b/tests/org.eclipse.compare.tests/patchdata/autofuzz-f1/addition.txt
new file mode 100644
index 000000000..e58329b43
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/patchdata/autofuzz-f1/addition.txt
@@ -0,0 +1,9 @@
+[1]
+[2]
+[3]
+[4]
+[5]
+[6]
+[7]
+[8]
+[9] \ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_addition_context.txt b/tests/org.eclipse.compare.tests/patchdata/patch_addition_context.txt
new file mode 100644
index 000000000..3b6317351
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_addition_context.txt
@@ -0,0 +1,14 @@
+*** /dev/null 1 Jan 1970 00:00:00 -0000
+--- addition.txt 1 Jan 1970 00:00:00 -0000
+***************
+*** 0 ****
+--- 1,9 ----
++ [1]
++ [2]
++ [3]
++ [4]
++ [5]
++ [6]
++ [7]
++ [8]
++ [9] \ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_context3_context.txt b/tests/org.eclipse.compare.tests/patchdata/patch_context3_context.txt
new file mode 100644
index 000000000..b9d747daf
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_context3_context.txt
@@ -0,0 +1,51 @@
+*** old.txt 18 Apr 2008 15:48:57 -0000 1.1
+--- old.txt 18 Apr 2008 15:50:03 -0000
+***************
+*** 1,22 ****
+ [a]
+ [b]
+ [c]
+ [d]
+ [e]
+ [f]
+ [g]
+ [h]
+! [i]
+ [j]
+ [k]
+ [l]
+ [m]
+ [n]
+- [o]
+ [p]
+ [q]
+ [r]
+ [s]
+ [t]
+ [u]
+ [v]
+--- 1,24 ----
+ [a]
+ [b]
+ [c]
++ [c1]
++ [c2]
+ [d]
+ [e]
+ [f]
+ [g]
+ [h]
+! [i1]
+ [j]
+ [k]
+ [l]
+ [m]
+ [n]
+ [p]
+ [q]
+ [r]
+ [s]
++ [s1]
+ [t]
+ [u]
+ [v]
diff --git a/tests/org.eclipse.compare.tests/patchdata/patch_oneline_context.txt b/tests/org.eclipse.compare.tests/patchdata/patch_oneline_context.txt
new file mode 100644
index 000000000..6736515bd
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/patchdata/patch_oneline_context.txt
@@ -0,0 +1,7 @@
+*** addition.txt 9 May 2005 11:25:30 -0000 1.1
+--- addition.txt 18 Apr 2008 15:35:17 -0000
+***************
+*** 0 ****
+--- 1 ----
++ one line
+\ No newline at end of file
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AbstractPatchTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AbstractPatchTest.java
index 82ccafbb1..1a2f56cc0 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AbstractPatchTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AbstractPatchTest.java
@@ -25,8 +25,8 @@ import junit.framework.Assert;
import junit.framework.TestCase;
import org.eclipse.compare.internal.Utilities;
-import org.eclipse.compare.internal.core.patch.FileDiff;
import org.eclipse.compare.internal.core.patch.FileDiffResult;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.LineReader;
import org.eclipse.compare.internal.patch.WorkspacePatcher;
import org.eclipse.compare.patch.ApplyPatchOperation;
@@ -158,7 +158,7 @@ public abstract class AbstractPatchTest extends TestCase {
e.printStackTrace();
}
- FileDiff[] diffs = patcher.getDiffs();
+ FilePatch2[] diffs = patcher.getDiffs();
Assert.assertEquals(diffs.length, 1);
FileDiffResult diffResult = patcher.getDiffResult(diffs[0]);
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java
index 204b224bf..ab3e6152b 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/AllTests.java
@@ -33,6 +33,7 @@ public class AllTests {
suite.addTestSuite(DiffTest.class);
suite.addTestSuite(FileDiffResultTest.class);
suite.addTestSuite(ContentMergeViewerTest.class);
+ suite.addTestSuite(PatchLinesTest.class);
suite.addTestSuite(UnifiedDiffFormatterTest.class);
//$JUnit-END$
return suite;
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FileDiffResultTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FileDiffResultTest.java
index aba379831..e0d2db849 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FileDiffResultTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/FileDiffResultTest.java
@@ -18,7 +18,7 @@ import java.io.InputStream;
import java.util.ArrayList;
import org.eclipse.compare.internal.Utilities;
-import org.eclipse.compare.internal.core.patch.FileDiff;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.FileDiffResult;
import org.eclipse.compare.internal.core.patch.Hunk;
import org.eclipse.compare.internal.patch.Patcher;
@@ -216,7 +216,7 @@ public class FileDiffResultTest extends WorkspaceTest {
/**
* A mock FileDiff class.
*/
- private class MyFileDiff extends FileDiff {
+ private class MyFileDiff extends FilePatch2 {
protected MyFileDiff() {
super(null, 0, null, 0);
add(Hunk.createHunk(this, new int[] { 0, 0 }, new int[] { 0, 0 },
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
index a69656f33..08e9a317c 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchBuilderTest.java
@@ -16,10 +16,9 @@ import java.util.List;
import junit.framework.TestCase;
-import org.eclipse.compare.internal.core.patch.FileDiff;
import org.eclipse.compare.internal.core.patch.Hunk;
import org.eclipse.compare.internal.core.patch.LineReader;
-import org.eclipse.compare.internal.patch.FileDiffWrapper;
+import org.eclipse.compare.internal.patch.Utilities;
import org.eclipse.compare.patch.ApplyPatchOperation;
import org.eclipse.compare.patch.IFilePatch;
import org.eclipse.compare.patch.IFilePatch2;
@@ -75,9 +74,9 @@ public class PatchBuilderTest extends TestCase {
assertEquals(28, ((Hunk) hunksAfter[3]).getStart(false));
assertEquals(33, ((Hunk) hunksAfter[3]).getStart(true));
- FileDiffWrapper wrapper = new FileDiffWrapper((FileDiff) filePatch);
- IFilePatchResult result = wrapper.apply(contextStorage,
- new PatchConfiguration(), new NullProgressMonitor());
+ IFilePatchResult result = filePatch.apply(Utilities
+ .getReaderCreator(contextStorage), new PatchConfiguration(),
+ new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
assertEquals(1, rejects.length);
@@ -126,9 +125,9 @@ public class PatchBuilderTest extends TestCase {
assertEquals(46, ((Hunk) hunksAfter[4]).getStart(false));
assertEquals(51, ((Hunk) hunksAfter[4]).getStart(true));
- FileDiffWrapper wrapper = new FileDiffWrapper((FileDiff) filePatch);
- IFilePatchResult result = wrapper.apply(contextStorage,
- new PatchConfiguration(), new NullProgressMonitor());
+ IFilePatchResult result = filePatch.apply(Utilities
+ .getReaderCreator(contextStorage), new PatchConfiguration(),
+ new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
assertEquals(0, rejects.length);
@@ -162,9 +161,9 @@ public class PatchBuilderTest extends TestCase {
assertEquals(46, ((Hunk) hunksAfter[2]).getStart(false));
assertEquals(43, ((Hunk) hunksAfter[2]).getStart(true));
- FileDiffWrapper wrapper = new FileDiffWrapper((FileDiff) filePatch);
- IFilePatchResult result = wrapper.apply(contextStorage,
- new PatchConfiguration(), new NullProgressMonitor());
+ IFilePatchResult result = filePatch.apply(Utilities
+ .getReaderCreator(contextStorage), new PatchConfiguration(),
+ new NullProgressMonitor());
IHunk[] rejects = result.getRejects();
assertEquals(0, rejects.length);
@@ -202,9 +201,9 @@ public class PatchBuilderTest extends TestCase {
assertEquals(hunk0, filePatch.getHunks()[0]);
assertEquals(hunk1, filePatch.getHunks()[1]);
- FileDiffWrapper wrapper = new FileDiffWrapper((FileDiff) filePatch);
- IFilePatchResult result = wrapper.apply(contextStorage,
- new PatchConfiguration(), new NullProgressMonitor());
+ IFilePatchResult result = filePatch.apply(Utilities
+ .getReaderCreator(contextStorage), new PatchConfiguration(),
+ new NullProgressMonitor());
InputStream actual = result.getPatchedContents();
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java
new file mode 100644
index 000000000..bd41c5864
--- /dev/null
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchLinesTest.java
@@ -0,0 +1,172 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.compare.tests;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.lang.reflect.Field;
+
+import junit.framework.TestCase;
+
+import org.eclipse.compare.internal.core.patch.FilePatch2;
+import org.eclipse.compare.internal.patch.WorkspacePatcher;
+import org.eclipse.compare.patch.IHunk;
+
+public class PatchLinesTest extends TestCase {
+
+ public PatchLinesTest(String name) {
+ super(name);
+ }
+
+ // unified diff format
+
+ public void test_196847() throws Exception {
+ int[] lines = parsePatch("196847/stuff_patch.txt");
+ assertEquals(6, lines[0]);
+ assertEquals(5, lines[1]);
+ }
+
+ public void test_deletion_autofuzz() throws Exception {
+ int[] lines = parsePatch("deletion_autofuzz/patch.txt");
+ assertEquals(0, lines[0]);
+ assertEquals(1, lines[1]);
+ }
+
+ public void test_patch_addition() throws Exception {
+ int[] lines = parsePatch("patch_addition.txt");
+ assertEquals(9, lines[0]);
+ assertEquals(0, lines[1]);
+ }
+
+ public void test_patch_context1() throws Exception {
+ int[] lines = parsePatch("patch_context1.txt");
+ assertEquals(4, lines[0]);
+ assertEquals(2, lines[1]);
+ }
+
+ public void test_patch_context3() throws Exception {
+ int[] lines = parsePatch("patch_context3.txt");
+ assertEquals(4, lines[0]);
+ assertEquals(2, lines[1]);
+ }
+
+ public void test_patch_workspacePatchAddition() throws Exception {
+ int[] lines = parsePatch("patch_workspacePatchAddition.txt");
+ assertEquals(31, lines[0]);
+ assertEquals(0, lines[1]);
+ }
+
+ public void test_patch_workspacePatchDelete() throws Exception {
+ int[] lines = parsePatch("patch_workspacePatchDelete.txt");
+ assertEquals(29, lines[0]);
+ assertEquals(46, lines[1]);
+ }
+
+ public void test_patch_workspacePatchMod() throws Exception {
+ int[] lines = parsePatch("patch_workspacePatchMod.txt");
+ assertEquals(33, lines[0]);
+ assertEquals(8, lines[1]);
+ }
+
+ // context diff format
+
+ public void test_patch_addition_context() throws Exception {
+ int[] lines = parsePatch("patch_addition_context.txt");
+ assertEquals(9, lines[0]);
+ assertEquals(0, lines[1]);
+ }
+
+ public void test_patch_oneline_context() throws Exception {
+ int[] lines = parsePatch("patch_oneline_context.txt");
+ assertEquals(1, lines[0]);
+ assertEquals(0, lines[1]);
+ }
+
+ public void test_patch_context3_context() throws Exception {
+ int[] lines = parsePatch("patch_context3_context.txt");
+ assertEquals(4, lines[0]);
+ assertEquals(2, lines[1]);
+ }
+
+ private int[] parsePatch(String patch) {
+ WorkspacePatcher patcher = new WorkspacePatcher();
+ try {
+ patcher.parse(getReader(patch));
+ patcher.countLines();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+
+ int[] result = new int[] { 0, 0 };
+ int hunksLengthSum = 0;
+ int fileDiffSum = 0;
+
+ FilePatch2[] diffs = patcher.getDiffs();
+ for (int i = 0; i < diffs.length; i++) {
+ FilePatch2 fileDiff = diffs[i];
+ IHunk[] hunks = fileDiff.getHunks();
+ for (int j = 0; j < hunks.length; j++) {
+ IHunk hunk = hunks[j];
+ hunksLengthSum += getNewLength(hunk);
+ hunksLengthSum -= getOldLength(hunk);
+ }
+ result[0] += fileDiff.getAddedLines();
+ result[1] += fileDiff.getRemovedLines();
+ fileDiffSum += fileDiff.getAddedLines();
+ fileDiffSum -= fileDiff.getRemovedLines();
+ }
+
+ assertEquals(hunksLengthSum, fileDiffSum);
+ return result;
+ }
+
+ private BufferedReader getReader(String name) {
+ return PatchUtils.getReader(name);
+ }
+
+ private int getNewLength(IHunk hunk) {
+ Class cls = hunk.getClass();
+ try {
+ Field fld = cls.getDeclaredField("fNewLength");
+ fld.setAccessible(true);
+ return fld.getInt(hunk);
+ } catch (SecurityException e) {
+ fail(e.getMessage());
+ } catch (NoSuchFieldException e) {
+ fail(e.getMessage());
+ } catch (IllegalArgumentException e) {
+ fail(e.getMessage());
+ } catch (IllegalAccessException e) {
+ fail(e.getMessage());
+ }
+ fail();
+ return -1;
+ }
+
+ private int getOldLength(IHunk hunk) {
+ Class cls = hunk.getClass();
+ try {
+ Field fld = cls.getDeclaredField("fOldLength");
+ fld.setAccessible(true);
+ return fld.getInt(hunk);
+ } catch (SecurityException e) {
+ fail(e.getMessage());
+ } catch (NoSuchFieldException e) {
+ fail(e.getMessage());
+ } catch (IllegalArgumentException e) {
+ fail(e.getMessage());
+ } catch (IllegalAccessException e) {
+ fail(e.getMessage());
+ }
+ fail();
+ return -1;
+ }
+}
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
index 80884e150..5dce7d748 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/PatchTest.java
@@ -35,8 +35,8 @@ import java.util.zip.ZipEntry;
import junit.framework.Assert;
import junit.framework.AssertionFailedError;
-import org.eclipse.compare.internal.core.patch.FileDiff;
import org.eclipse.compare.internal.core.patch.FileDiffResult;
+import org.eclipse.compare.internal.core.patch.FilePatch2;
import org.eclipse.compare.internal.core.patch.LineReader;
import org.eclipse.compare.internal.patch.WorkspacePatcher;
import org.eclipse.compare.patch.ApplyPatchOperation;
@@ -57,7 +57,6 @@ import org.eclipse.core.runtime.Status;
public class PatchTest extends AbstractPatchTest {
- private static final String PATCHDATA = "patchdata";
private static final String PATCH_CONFIGURATION = "patchConfiguration.properties";
Properties defaultPatchProperties;
@@ -111,7 +110,7 @@ public class PatchTest extends AbstractPatchTest {
}
protected String getWorkingFolder() {
- return PATCHDATA;
+ return "patchdata";
}
protected void setUp() throws Exception {
@@ -503,7 +502,7 @@ public class PatchTest extends AbstractPatchTest {
}
//Sort the diffs by project
- FileDiff[] diffs= patcher.getDiffs();
+ FilePatch2[] diffs= patcher.getDiffs();
//Iterate through all of the original files, apply the diffs that belong to the file and compare
//with the corresponding outcome file
diff --git a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/performance/RangeDifferencerTest.java b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/performance/RangeDifferencerTest.java
index 31157b7d5..10abd537f 100644
--- a/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/performance/RangeDifferencerTest.java
+++ b/tests/org.eclipse.compare.tests/src/org/eclipse/compare/tests/performance/RangeDifferencerTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2008 IBM Corporation and others.
+ * Copyright (c) 2005, 2009 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,13 +18,12 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
import org.eclipse.test.performance.Dimension;
-import org.eclipse.test.performance.Performance;
import org.eclipse.test.performance.PerformanceTestCase;
-
public class RangeDifferencerTest extends PerformanceTestCase {
- static private final String EXPLANATION = "Performance decrease caused by changes in the compare framework, see bug 210688";
+
+ // static private final String EXPLANATION = "Performance decrease caused by changes in the compare framework, see bug 210688";
public RangeDifferencerTest(String name) {
super(name);
@@ -63,7 +62,7 @@ public class RangeDifferencerTest extends PerformanceTestCase {
public void testLargeDocument() {
tagAsGlobalSummary("3-way compare, 5000 lines", Dimension.ELAPSED_PROCESS); //$NON-NLS-1$
- setComment(Performance.EXPLAINS_DEGRADATION_COMMENT, EXPLANATION);
+ // setComment(Performance.EXPLAINS_DEGRADATION_COMMENT, EXPLANATION);
ITokenComparator ancestor= new DocLineComparator(createDocument(0), null, false);
ITokenComparator left= new DocLineComparator(createDocument(1), null, false);

Back to the top