Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2004-12-01 09:24:32 -0500
committerAndre Weinand2004-12-01 09:24:32 -0500
commit9682a859e4d52532c67752d5241c56faf92d4415 (patch)
tree8162ece53be101a9c112a8001d066f8e405fe932 /bundles/org.eclipse.compare/compare
parenta76e737ba9d024f3e4661f1950c4369baa05aaff (diff)
downloadeclipse.platform.team-9682a859e4d52532c67752d5241c56faf92d4415.tar.gz
eclipse.platform.team-9682a859e4d52532c67752d5241c56faf92d4415.tar.xz
eclipse.platform.team-9682a859e4d52532c67752d5241c56faf92d4415.zip
removed all warnings; removed runtime.compatibility
Diffstat (limited to 'bundles/org.eclipse.compare/compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/IEditableContent.java17
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java9
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/IMergeViewerContentProvider.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java64
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilter.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java219
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ExceptionHandler.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/INavigatable.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java7
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java12
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StructureCreatorDescriptor.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TokenComparator.java11
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java18
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/MergeMessages.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Hunk.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java45
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java11
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/DifferencesIterator.java10
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/LinkedRangeDifference.java8
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifference.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifferencer.java27
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffContainer.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffElement.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java4
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java16
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java15
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java6
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java11
53 files changed, 347 insertions, 292 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
index 08c569903..9cfb91b88 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareEditorInput.java
@@ -658,7 +658,9 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
* <p>
* Subclasses may override to implement a different strategy.
* </p>
- *
+ * @param oldViewer a new viewer is only created if this old viewer cannot show the given input
+ * @param input the input object for which to find a structure viewer
+ * @param parent the SWT parent composite under which the new viewer is created
* @return a compare viewer which is suitable for the given input object or <code>null</code>
*/
public Viewer findStructureViewer(Viewer oldViewer, ICompareInput input, Composite parent) {
@@ -676,7 +678,9 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
* <p>
* Subclasses may override to implement a different strategy.
* </p>
- *
+ * @param oldViewer a new viewer is only created if this old viewer cannot show the given input
+ * @param input the input object for which to find a structure viewer
+ * @param parent the SWT parent composite under which the new viewer is created
* @return a compare viewer which is suitable for the given input object or <code>null</code>
*/
public Viewer findContentViewer(Viewer oldViewer, ICompareInput input, Composite parent) {
@@ -776,6 +780,7 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
* @deprecated Override method saveChanges instead.
*/
public void save(IProgressMonitor pm) {
+ // empty default implementation
}
/**
@@ -785,6 +790,7 @@ public abstract class CompareEditorInput implements IEditorInput, IPropertyChang
* calling <code>ISavable.save</code> on them.
*
* @param pm an <code>IProgressMonitor</code> that the implementation of save may use to show progress
+ * @throws CoreException
* @since 2.0
*/
public void saveChanges(IProgressMonitor pm) throws CoreException {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/IEditableContent.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/IEditableContent.java
index a972a0a7d..4d031e69c 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/IEditableContent.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/IEditableContent.java
@@ -48,20 +48,23 @@ public interface IEditableContent {
* <TABLE>
* <TR>
* <TD>add:</TD>
- * <TD>child == null</TD>
- * <TD>other != null</TD>
+ * <TD>dest == null</TD>
+ * <TD>src != null</TD>
* </TR>
* <TR>
* <TD>remove:</TD>
- * <TD>child != null</TD>
- * <TD>other == null</TD>
+ * <TD>dest != null</TD>
+ * <TD>src == null</TD>
* </TR>
* <TR>
* <TD>copy:</TD>
- * <TD>child != null</TD>
- * <TD>other != null</TD>
+ * <TD>dest != null</TD>
+ * <TD>src != null</TD>
* </TR>
* </TABLE>
+ * @param dest the existing child of this object to be replaced; if <code>null</null> a new child can be added.
+ * @param src the new child to be added or replaced; if <code>null</code> an existing child can be removed.
+ * @return the argument <code>dest</code>
*/
- ITypedElement replace(ITypedElement child, ITypedElement other);
+ ITypedElement replace(ITypedElement dest, ITypedElement src);
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
index ad07219e3..36380c4ae 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ResourceNode.java
@@ -109,13 +109,10 @@ public class ResourceNode extends BufferedContent
return CompareUI.getImage(fResource);
}
- /**
+ /*
* Returns <code>true</code> if the other object is of type <code>ITypedElement</code>
* and their names are identical. The content is not considered.
*/
- /* (non Javadoc)
- * see IStructureComparator.equals
- */
public boolean equals(Object other) {
if (other instanceof ITypedElement) {
String otherName= ((ITypedElement)other).getName();
@@ -126,9 +123,7 @@ public class ResourceNode extends BufferedContent
/**
* Returns the hash code of the name.
- */
- /* (non Javadoc)
- * see IStructureComparator.hashCode
+ * @return a hash code value for this object.
*/
public int hashCode() {
return getName().hashCode();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
index 935814485..15a1851dc 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/ZipFileStructureCreator.java
@@ -312,8 +312,11 @@ public class ZipFileStructureCreator implements IStructureCreator {
* additons and deletions.
* <p>
* Note: this method is for internal use only. Clients should not call this method.
+ * @param differencer
+ * @param root
*/
- public void rewriteTree(Differencer diff, IDiffContainer root) {
+ public void rewriteTree(Differencer differencer, IDiffContainer root) {
+ // empty default implementation
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
index 240e6828c..b5a54ba89 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/ContentMergeViewer.java
@@ -447,6 +447,7 @@ public abstract class ContentMergeViewer extends ContentViewer
/**
* The <code>ContentMergeViewer</code> implementation of this
* <code>Viewer</code> method returns the empty selection. Subclasses may override.
+ * @return empty selection.
*/
public ISelection getSelection() {
return new ISelection() {
@@ -456,11 +457,11 @@ public abstract class ContentMergeViewer extends ContentViewer
};
}
- /**
+ /*
* The <code>ContentMergeViewer</code> implementation of this
* <code>Viewer</code> method does nothing. Subclasses may reimplement.
*/
- public void setSelection(ISelection s, boolean reveal) {
+ public void setSelection(ISelection selection, boolean reveal) {
// empty implementation
}
@@ -793,7 +794,7 @@ public abstract class ContentMergeViewer extends ContentViewer
return fComposite;
}
- /**
+ /*
* Called on the viewer disposal.
* Unregisters from the compare configuration.
* Clients may extend if they have to do additional cleanup.
@@ -1003,7 +1004,7 @@ public abstract class ContentMergeViewer extends ContentViewer
}
}
- /**
+ /*
* Save the viewers's content.
* Note: this method is for internal use only. Clients should not call this method.
* @since 2.0
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/IMergeViewerContentProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/IMergeViewerContentProvider.java
index 90e1f0139..31d78b570 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/IMergeViewerContentProvider.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/IMergeViewerContentProvider.java
@@ -56,7 +56,7 @@ public interface IMergeViewerContentProvider extends IContentProvider {
/**
* Returns whether the ancestor side of the given input element should be shown.
- *
+ * @param input the merge viewer's input
* @return <code>true</code> if the ancestor side of the given input element should be shown
*/
boolean showAncestor(Object input);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 1a460dba1..f145e12e1 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -851,11 +851,11 @@ public class TextMergeViewer extends ContentMergeViewer {
* The <code>TextMergeViewer</code> implementation of this method returns a
* tokenizer that breaks a line into words separated by whitespace.
* Subclasses may reimplement to provide a specific tokenizer.
- *
+ * @param line the line for which to create the <code>ITokenComparator</code>
* @return a ITokenComparator which is used for a second level token compare.
*/
- protected ITokenComparator createTokenComparator(String s) {
- return new TokenComparator(s);
+ protected ITokenComparator createTokenComparator(String line) {
+ return new TokenComparator(line);
}
/**
@@ -878,6 +878,7 @@ public class TextMergeViewer extends ContentMergeViewer {
* Called on the viewer disposal.
* Unregisters from the compare configuration.
* Clients may extend if they have to do additional cleanup.
+ * @param event
*/
protected void handleDispose(DisposeEvent event) {
@@ -954,7 +955,7 @@ public class TextMergeViewer extends ContentMergeViewer {
//--- internal ------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------------
- /**
+ /*
* Creates the specific SWT controls for the content areas.
* Clients must not call or override this method.
*/
@@ -1312,7 +1313,7 @@ public class TextMergeViewer extends ContentMergeViewer {
fBirdsEyeCanvas.redraw();
}
- /**
+ /*
* Called whenever setFocus() is called on the ContentViewer's top level SWT Composite.
* This implementation sets the focus to the first enabled text widget.
*/
@@ -1348,7 +1349,7 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
- /**
+ /*
* Creates the central Canvas.
* Called from ContentMergeViewer.
*/
@@ -1420,7 +1421,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return fButtonDiff != null;
}
- /**
+ /*
* Returns width of central canvas.
* Overridden from ContentMergeViewer.
*/
@@ -1430,7 +1431,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return super.getCenterWidth();
}
- /**
+ /*
* Creates and initializes a text part.
*/
private MergeSourceViewer createPart(Composite parent) {
@@ -1553,7 +1554,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return null;
}
- /**
+ /*
* Returns true if the given inputs map to the same documents
*/
boolean sameDoc(char type, Object newInput, Object oldInput) {
@@ -1605,7 +1606,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return null;
}
- /**
+ /*
* Initializes the text viewers of the three content areas with the given input objects.
* Subclasses may extend.
*/
@@ -1791,7 +1792,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return false;
}
- /**
+ /*
* Called whenver one of the documents changes.
* Sets the dirty state of this viewer and updates the lines.
* Implements IDocumentListener.
@@ -1809,7 +1810,7 @@ public class TextMergeViewer extends ContentMergeViewer {
updateLines(doc);
}
- /**
+ /*
* This method is called if a range of text on one side is copied into an empty subdocument
* on the other side. The method returns the position where the subdocument is placed into the base document.
* This default implementation determines the position by using the text range differencer.
@@ -1896,7 +1897,7 @@ public class TextMergeViewer extends ContentMergeViewer {
fHasErrors= true;
}
- /**
+ /*
* Returns true if a new Document could be installed.
*/
private boolean setDocument(MergeSourceViewer tp, char type, Object o) {
@@ -2153,7 +2154,7 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
- /**
+ /*
* Lays out everything.
*/
protected final void handleResizeLeftRight(int x, int y, int width1, int centerWidth, int width2, int height) {
@@ -2228,7 +2229,7 @@ public class TextMergeViewer extends ContentMergeViewer {
refreshBirdsEyeView();
}
- /**
+ /*
* Track selection changes to update the current Diff.
*/
private void handleSelectionChanged(MergeSourceViewer tw) {
@@ -2530,7 +2531,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return null;
}
- /**
+ /*
* Returns true if kind of change should be shown.
*/
private boolean useChange(int kind) {
@@ -2552,7 +2553,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return tc.getTokenStart(start + length);
}
- /**
+ /*
* Returns the content of lines in the specified range as a String.
* This includes the line separators.
*
@@ -2593,7 +2594,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return ""; //$NON-NLS-1$
}
- /**
+ /*
* Performs a token based 3-way diff on the character range specified by the given baseDiff.
*/
private void simpleTokenDiff(final Diff baseDiff,
@@ -2653,7 +2654,7 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
- /**
+ /*
* Performs a "smart" token based 3-way diff on the character range specified by the given baseDiff.
* It is "smart" because it tries to minimize the number of token diffs by merging them.
*/
@@ -2940,7 +2941,7 @@ public class TextMergeViewer extends ContentMergeViewer {
Integer.toString(endLine) } );
}
- /**
+ /*
* Returns a description of the cursor position.
*
* @return a description of the cursor position
@@ -2986,7 +2987,7 @@ public class TextMergeViewer extends ContentMergeViewer {
updateControls();
}
- /**
+ /*
* Creates the two items for copying a difference range from one side to the other
* and adds them to the given toolbar manager.
*/
@@ -3204,9 +3205,6 @@ public class TextMergeViewer extends ContentMergeViewer {
//---- painting lines
- /**
- *
- */
private void updateLines(IDocument d) {
boolean left= false;
@@ -3619,7 +3617,7 @@ public class TextMergeViewer extends ContentMergeViewer {
//---- Navigating and resolving Diffs
- /**
+ /*
* Returns true if end (or beginning) of document reached.
*/
private boolean navigate(boolean down, boolean wrap, boolean deep) {
@@ -3688,7 +3686,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return false;
}
- /**
+ /*
* Find the Diff that overlaps with the given TextPart's text range.
* If the range doesn't overlap with any range <code>null</code>
* is returned.
@@ -3799,7 +3797,7 @@ public class TextMergeViewer extends ContentMergeViewer {
refreshBirdsEyeView();
}
- /**
+ /*
* Smart determines whether
*/
private void revealDiff(Diff d, boolean smart) {
@@ -4094,7 +4092,7 @@ public class TextMergeViewer extends ContentMergeViewer {
//---- scrolling
- /**
+ /*
* Calculates virtual height (in lines) of views by adding the maximum of corresponding diffs.
*/
private int getVirtualHeight() {
@@ -4109,7 +4107,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return h;
}
- /**
+ /*
* Calculates height (in lines) of right view by adding the height of the right diffs.
*/
private int getRightHeight() {
@@ -4124,7 +4122,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return h;
}
- /**
+ /*
* The height of the TextEditors in lines.
*/
private int getViewportHeight() {
@@ -4146,7 +4144,7 @@ public class TextMergeViewer extends ContentMergeViewer {
return vh / te.getLineHeight();
}
- /**
+ /*
* Returns the virtual position for the given view position.
*/
private int realToVirtualPosition(MergeSourceViewer w, int vpos) {
@@ -4232,7 +4230,7 @@ public class TextMergeViewer extends ContentMergeViewer {
fRightCanvas.repaint();
}
- /**
+ /*
* Updates Scrollbars with viewports.
*/
private void syncViewport(MergeSourceViewer w) {
@@ -4270,7 +4268,7 @@ public class TextMergeViewer extends ContentMergeViewer {
}
}
- /**
+ /*
* maps given virtual position into a real view position of this view.
*/
private int virtualToRealPosition(MergeSourceViewer part, int v) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java
index d6c202174..84e8f945c 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AbstractViewer.java
@@ -17,6 +17,7 @@ import org.eclipse.jface.viewers.Viewer;
public abstract class AbstractViewer extends Viewer {
public void setInput(Object input) {
+ // empty default implementation
}
public Object getInput() {
@@ -28,8 +29,10 @@ public abstract class AbstractViewer extends Viewer {
}
public void setSelection(ISelection s, boolean reveal) {
+ // empty default implementation
}
public void refresh() {
+ // empty default implementation
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
index 51892e496..6708a0f69 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryAction.java
@@ -29,6 +29,7 @@ public class AddFromHistoryAction extends BaseCompareAction {
private static final String BUNDLE_NAME= "org.eclipse.compare.internal.AddFromHistoryAction"; //$NON-NLS-1$
public AddFromHistoryAction() {
+ // empty default implementation
}
protected boolean isEnabled(ISelection selection) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
index 103ff7965..642c682f3 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/AddFromHistoryDialog.java
@@ -285,7 +285,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
return parent;
}
- /**
+ /*
* Feeds selection from member viewer to edition viewer.
*/
private void handleMemberSelect(Widget w) {
@@ -317,7 +317,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
fCurrentFileHistory= null;
}
- /**
+ /*
* Adds the given Pair to the edition tree.
* It takes care of creating tree nodes for different dates.
*/
@@ -367,7 +367,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
}
}
- /**
+ /*
* Returns the number of s since Jan 1st, 1970.
* The given date is converted to GMT and daylight saving is taken into account too.
*/
@@ -380,7 +380,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
return (date + localTimeOffset) / ONE_DAY_MS;
}
- /**
+ /*
* Feeds the tree viewer's selection to the contentviewer
*/
private void feedContent(Widget w) {
@@ -424,7 +424,7 @@ public class AddFromHistoryDialog extends ResizableDialog {
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
}
- /**
+ /*
* Returns true if the pathname of f1 comes after f2
*/
private static boolean greaterThan(IFile f1, IFile f2) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java
index 79b34255d..3e20f3d67 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedCanvas.java
@@ -57,7 +57,7 @@ public abstract class BufferedCanvas extends Canvas {
}
}
- /**
+ /*
* Double buffer drawing.
*/
void doubleBufferPaint(GC dest) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java
index c3693b094..4ab61058b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/BufferedResourceNode.java
@@ -34,7 +34,7 @@ public class BufferedResourceNode extends ResourceNode {
super(resource);
}
- /**
+ /*
* Returns <code>true</code> if buffer contains uncommitted changes.
*/
public boolean isDirty() {
@@ -50,7 +50,7 @@ public class BufferedResourceNode extends ResourceNode {
super.setContent(contents);
}
- /**
+ /*
* Commits buffered contents to resource.
*/
public void commit(IProgressMonitor pm) throws CoreException {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
index dddb8a11e..9be68cb7d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditor.java
@@ -62,9 +62,10 @@ public class CompareEditor extends EditorPart implements IReusableEditor {
public CompareEditor() {
+ // empty default implementation
}
- /** (non-Javadoc)
+ /* (non-Javadoc)
* Method declared on IAdaptable
*/
public Object getAdapter(Class key) {
@@ -185,14 +186,15 @@ public class CompareEditor extends EditorPart implements IReusableEditor {
((CompareEditorInput)input).setFocus();
}
- /**
- * Returns false because the editor doesn't support "Save As...".
+ /*
+ * @see IEditorPart#isSaveAsAllowed()
*/
public boolean isSaveAsAllowed() {
return false;
}
public void gotoMarker(IMarker marker) {
+ // empty default implemenatation
}
/**
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
index 07d1f5b8f..672b1327d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareEditorContributor.java
@@ -67,6 +67,7 @@ public class CompareEditorContributor extends EditorActionBarContributor {
* @see EditorActionBarContributor#contributeToMenu(IMenuManager)
*/
public void contributeToMenu(IMenuManager menuManager) {
+ // empty implementation
}
public void setActiveEditor(IEditorPart targetEditor) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilter.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilter.java
index fe3120a7c..abcea3bae 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilter.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareFilter.java
@@ -26,9 +26,10 @@ public class CompareFilter {
public CompareFilter() {
+ // nothing to do
}
- /**
+ /*
* Returns true if path matches filter, that is if path should be filtered.
*/
public boolean filter(String path0, boolean folder, boolean isArchive) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java
index b6fb85fd5..bc2d1464f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareMessages.java
@@ -20,6 +20,7 @@ public class CompareMessages {
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
private CompareMessages() {
+ // nothing to do
}
public static String getString(String key) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
index a2714a9fc..9e00db439 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
@@ -36,6 +36,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.compare.*;
import org.eclipse.compare.structuremergeviewer.*;
+import org.osgi.framework.BundleContext;
/**
@@ -56,15 +57,13 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
static class CompareRegistry {
- private final static String ID_ATTRIBUTE= "id"; //$NON-NLS-1$
+ private final static String ID_ATTRIBUTE= "id"; //$NON-NLS-1$
private final static String EXTENSIONS_ATTRIBUTE= "extensions"; //$NON-NLS-1$
- private final static String CONTENT_TYPE_ID_ATTRIBUTE= "contentTypeId"; //$NON-NLS-1$
+ private final static String CONTENT_TYPE_ID_ATTRIBUTE= "contentTypeId"; //$NON-NLS-1$
-
-
- private HashMap fIdMap;
- private HashMap fExtensionMap;
- private HashMap fContentTypeBindings; // maps content type bindings to datas
+ private HashMap fIdMap;
+ private HashMap fExtensionMap;
+ private HashMap fContentTypeBindings; // maps content type bindings to datas
void register(IConfigurationElement element, Object data) {
@@ -190,13 +189,14 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
private ResourceBundle fResourceBundle;
+ private boolean fRegistriesInitialized;
private CompareRegistry fStreamMergers= new CompareRegistry();
private CompareRegistry fStructureCreators= new CompareRegistry();
private CompareRegistry fStructureMergeViewers= new CompareRegistry();
private CompareRegistry fContentViewers= new CompareRegistry();
private CompareRegistry fContentMergeViewers= new CompareRegistry();
- private Map fStructureViewerAliases= new Hashtable(10);
+ private Map fStructureViewerAliases;
private CompareFilter fFilter;
private IPropertyChangeListener fPropertyChangeListener;
@@ -207,31 +207,18 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
* <p>
* Note that instances of plug-in runtime classes are automatically created
* by the platform in the course of plug-in activation.
- * </p>
- *
- * @param descriptor the plug-in descriptor
*/
- public CompareUIPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
-
+ public CompareUIPlugin() {
+ super();
Assert.isTrue(fgComparePlugin == null);
fgComparePlugin= this;
-
- ComparePreferencePage.initDefaults(getPreferenceStore());
-
- fResourceBundle= descriptor.getResourceBundle();
- registerExtensions();
- initPreferenceStore();
}
-
-// /**
-// * @see AbstractUIPlugin#initializeDefaultPreferences
-// */
-// protected void initializeDefaultPreferences(IPreferenceStore store) {
-// super.initializeDefaultPreferences(store);
-// ComparePreferencePage.initDefaults(store);
-// }
-
+
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ ComparePreferencePage.initDefaults(getPreferenceStore());
+ }
+
/**
* Returns the singleton instance of this plug-in runtime class.
*
@@ -247,7 +234,9 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
* @return the plugin's resource bundle
*/
public ResourceBundle getResourceBundle() {
- return getDefault().fResourceBundle;
+ if (fResourceBundle == null)
+ fResourceBundle= Platform.getResourceBundle(getBundle());
+ return fResourceBundle;
}
/**
@@ -256,15 +245,22 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
* @return the plugin's unique identifier
*/
public static String getPluginId() {
- return getDefault().getDescriptor().getUniqueIdentifier();
+ return getDefault().getBundle().getSymbolicName();
}
+ private void initializeRegistries() {
+ if (!fRegistriesInitialized) {
+ registerExtensions();
+ fRegistriesInitialized= true;
+ }
+ }
+
/**
* Registers all stream mergers, structure creators, content merge viewers, and structure merge viewers
* that are found in the XML plugin files.
*/
private void registerExtensions() {
- IPluginRegistry registry= Platform.getPluginRegistry();
+ IExtensionRegistry registry= Platform.getExtensionRegistry();
// collect all IStreamMergers
IConfigurationElement[] elements= registry.getConfigurationElementsFor(PLUGIN_ID, STREAM_MERGER_EXTENSION_POINT);
@@ -400,39 +396,16 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
fgDisposeOnShutdownImages.add(image);
}
- /* (non-Javadoc)
- * Method declared on Plugin.
- * Frees all resources of the compare plug-in.
- */
- public void shutdown() throws CoreException {
-
- /*
- * Converts the aliases into a single string before they are stored
- * in the preference store.
- * The format is:
- * <key> '.' <alias> ' ' <key> '.' <alias> ...
- */
+ public void stop(BundleContext context) throws Exception {
+
IPreferenceStore ps= getPreferenceStore();
- if (ps != null) {
- StringBuffer sb= new StringBuffer();
- Iterator iter= fStructureViewerAliases.keySet().iterator();
- while (iter.hasNext()) {
- String key= (String) iter.next();
- String alias= (String) fStructureViewerAliases.get(key);
- sb.append(key);
- sb.append('.');
- sb.append(alias);
- sb.append(' ');
- }
- ps.setValue(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME, sb.toString());
-
- if (fPropertyChangeListener != null) {
- ps.removePropertyChangeListener(fPropertyChangeListener);
- fPropertyChangeListener= null;
- }
+ rememberAliases(ps);
+ if (fPropertyChangeListener != null) {
+ ps.removePropertyChangeListener(fPropertyChangeListener);
+ fPropertyChangeListener= null;
}
- super.shutdown();
+ super.stop(context);
if (fgDisposeOnShutdownImages != null) {
Iterator i= fgDisposeOnShutdownImages.iterator();
@@ -444,7 +417,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
fgImages= null;
}
}
-
+
/**
* Performs the comparison described by the given input and opens a
* compare editor on the result.
@@ -495,7 +468,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
}
}
- /**
+ /*
* @return <code>true</code> if compare result is OK to show, <code>false</code> otherwise
*/
private boolean compareResultOK(CompareEditorInput input) {
@@ -526,7 +499,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
return false;
}
- /**
+ /*
* Registers an image for the given type.
*/
private static void registerImage(String type, Image image, boolean dispose) {
@@ -549,8 +522,10 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
public static ImageDescriptor getImageDescriptor(String relativePath) {
URL installURL= null;
- if (fgComparePlugin != null)
- installURL= fgComparePlugin.getDescriptor().getInstallURL();
+ if (fgComparePlugin != null) {
+ //installURL= fgComparePlugin.getDescriptor().getInstallURL();
+ installURL= fgComparePlugin.getBundle().getEntry("/"); //$NON-NLS-1$
+ }
if (installURL != null) {
try {
@@ -663,6 +638,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
* descriptor has been registered
*/
public StructureCreatorDescriptor getStructureCreator(String type) {
+ initializeRegistries();
return (StructureCreatorDescriptor) fStructureCreators.search(type);
}
@@ -674,6 +650,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
* stream merger has been registered
*/
public IStreamMerger createStreamMerger(String type) {
+ initializeRegistries();
StreamMergerDescriptor descriptor= (StreamMergerDescriptor) fStreamMergers.search(type);
if (descriptor != null)
return descriptor.createStreamMerger();
@@ -688,6 +665,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
* stream merger has been registered
*/
public IStreamMerger createStreamMerger(IContentType type) {
+ initializeRegistries();
StreamMergerDescriptor descriptor= (StreamMergerDescriptor) fStreamMergers.search(type);
if (descriptor != null)
return descriptor.createStreamMerger();
@@ -716,6 +694,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
// content type search
IContentType ctype= getCommonType(getContentTypes(input));
if (ctype != null) {
+ initializeRegistries();
Viewer viewer= getViewer(fStructureMergeViewers.search(ctype), oldViewer, parent, configuration);
if (viewer != null)
return viewer;
@@ -726,9 +705,10 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
String type= null;
if (isHomogenous(types)) {
type= normalizeCase(types[0]);
+ initializeRegistries();
IViewerDescriptor vd= (IViewerDescriptor) fStructureMergeViewers.search(type);
if (vd == null) {
- String alias= (String) fStructureViewerAliases.get(type);
+ String alias= getStructureViewerAlias(type);
if (alias != null)
vd= (IViewerDescriptor) fStructureMergeViewers.search(alias);
}
@@ -740,6 +720,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
// now we try to find a structurecreator for the generic StructureDiffViewer
StructureCreatorDescriptor scc= null;
+ initializeRegistries();
Object desc= fStructureCreators.search(ctype); // search for content type
if (desc instanceof StructureCreatorDescriptor)
scc= (StructureCreatorDescriptor) desc;
@@ -764,9 +745,9 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
* If no viewer descriptor can be found <code>null</code> is returned.
*
* @param oldViewer a new viewer is only created if this old viewer cannot show the given input
- * @param input the input object for which to find a content viewer
+ * @param in the input object for which to find a content viewer
* @param parent the SWT parent composite under which the new viewer is created
- * @param configuration a configuration which is passed to a newly created viewer
+ * @param cc a configuration which is passed to a newly created viewer
* @return the compare viewer which is suitable for the given input object or <code>null</code>
*/
public Viewer findContentViewer(Viewer oldViewer, Object in, Composite parent, CompareConfiguration cc) {
@@ -779,6 +760,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
IContentType ct= getContentType(tin);
if (ct != null) {
+ initializeRegistries();
Viewer viewer= getViewer(fContentViewers.search(ct), oldViewer, parent, cc);
if (viewer != null)
return viewer;
@@ -789,6 +771,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
type= ty;
}
+ initializeRegistries();
Viewer viewer= getViewer(fContentViewers.search(type), oldViewer, parent, cc);
if (viewer != null)
return viewer;
@@ -803,6 +786,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
IContentType ctype= getCommonType(getContentTypes(input));
if (ctype != null) {
+ initializeRegistries();
Viewer viewer= getViewer(fContentMergeViewers.search(ctype), oldViewer, parent, cc);
if (viewer != null)
return viewer;
@@ -829,6 +813,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
}
if (type != null) {
+ initializeRegistries();
Viewer viewer= getViewer(fContentMergeViewers.search(type), oldViewer, parent, cc);
if (viewer != null)
return viewer;
@@ -846,6 +831,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
else
type= BINARY_TYPE;
+ initializeRegistries();
IViewerDescriptor vd= (IViewerDescriptor) fContentMergeViewers.search(type);
if (vd != null)
return vd.createViewer(oldViewer, parent, cc);
@@ -919,20 +905,22 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
try {
ct= fgContentTypeManager.findContentTypeFor(is, name);
} catch (IOException e) {
+ // silently ignored
}
try {
bis.close();
} catch (IOException e2) {
- // silently ignored
+ // silently ignored
}
}
} catch (CoreException e1) {
+ // silently ignored
}
}
return ct;
}
- /**
+ /*
* Returns true if the given types are homogenous.
*/
private static boolean isHomogenous(String[] types) {
@@ -947,7 +935,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
return false;
}
- /**
+ /*
* Returns the most specific content type that is common to the given inputs or null.
*/
private static IContentType getCommonType(IContentType[] types) {
@@ -988,7 +976,7 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
return set;
}
- /**
+ /*
* Guesses the file type of the given input.
* Returns ITypedElement.TEXT_TYPE if none of the first 10 lines is longer than 1000 bytes.
* Returns ITypedElement.UNKNOWN_TYPE otherwise.
@@ -1043,12 +1031,18 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
//---- alias mgmt
- private void initPreferenceStore() {
- //System.out.println("initPreferenceStore");
- final IPreferenceStore ps= getPreferenceStore();
- if (ps != null) {
- String aliases= ps.getString(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME);
- //System.out.println(" <" + aliases + ">");
+ private String getStructureViewerAlias(String type) {
+ return (String) getStructureViewerAliases().get(type);
+ }
+
+ public void addStructureViewerAlias(String type, String alias) {
+ getStructureViewerAliases().put(normalizeCase(alias), normalizeCase(type));
+ }
+
+ private Map getStructureViewerAliases() {
+ if (fStructureViewerAliases == null) {
+ fStructureViewerAliases= new Hashtable(10);
+ String aliases= getPreferenceStore().getString(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME);
if (aliases != null && aliases.length() > 0) {
StringTokenizer st= new StringTokenizer(aliases, " "); //$NON-NLS-1$
while (st.hasMoreTokens()) {
@@ -1058,27 +1052,16 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
String key= pair.substring(0, pos);
String alias= pair.substring(pos+1);
fStructureViewerAliases.put(key, alias);
- //System.out.println("<" + key + "><" + alias + ">");
}
}
}
- fFilter= new CompareFilter();
- fFilter.setFilters(ps.getString(ComparePreferencePage.PATH_FILTER));
- fPropertyChangeListener= new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- if (ComparePreferencePage.PATH_FILTER.equals(event.getProperty()))
- fFilter.setFilters(ps.getString(ComparePreferencePage.PATH_FILTER));
- }
- };
- ps.addPropertyChangeListener(fPropertyChangeListener);
}
- }
-
- public void addStructureViewerAlias(String type, String alias) {
- fStructureViewerAliases.put(normalizeCase(alias), normalizeCase(type));
+ return fStructureViewerAliases;
}
public void removeAllStructureViewerAliases(String type) {
+ if (fStructureViewerAliases == null)
+ return;
String t= normalizeCase(type);
Set entrySet= fStructureViewerAliases.entrySet();
for (Iterator iter= entrySet.iterator(); iter.hasNext(); ) {
@@ -1088,6 +1071,48 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
}
}
+ /*
+ * Converts the aliases into a single string before they are stored
+ * in the preference store.
+ * The format is:
+ * <key> '.' <alias> ' ' <key> '.' <alias> ...
+ */
+ private void rememberAliases(IPreferenceStore ps) {
+ if (fStructureViewerAliases == null)
+ return;
+ StringBuffer buffer= new StringBuffer();
+ Iterator iter= fStructureViewerAliases.keySet().iterator();
+ while (iter.hasNext()) {
+ String key= (String) iter.next();
+ String alias= (String) fStructureViewerAliases.get(key);
+ buffer.append(key);
+ buffer.append('.');
+ buffer.append(alias);
+ buffer.append(' ');
+ }
+ ps.setValue(STRUCTUREVIEWER_ALIASES_PREFERENCE_NAME, buffer.toString());
+ }
+
+ //---- filters
+
+ public boolean filter(String name, boolean isFolder, boolean isArchive) {
+ if (fFilter == null) {
+ fFilter= new CompareFilter();
+ final IPreferenceStore ps= getPreferenceStore();
+ fFilter.setFilters(ps.getString(ComparePreferencePage.PATH_FILTER));
+ fPropertyChangeListener= new IPropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent event) {
+ if (ComparePreferencePage.PATH_FILTER.equals(event.getProperty()))
+ fFilter.setFilters(ps.getString(ComparePreferencePage.PATH_FILTER));
+ }
+ };
+ ps.addPropertyChangeListener(fPropertyChangeListener);
+ }
+ return fFilter.filter(name, isFolder, isArchive);
+ }
+
+ //---- more utilities
+
/**
* Returns an array of all editors that have an unsaved content. If the identical content is
* presented in more than one editor, only one of those editor parts is part of the result.
@@ -1116,12 +1141,6 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
return (IEditorPart[])result.toArray(new IEditorPart[result.size()]);
}
- public boolean filter(String name, boolean isFolder, boolean isArchive) {
- if (fFilter != null)
- return fFilter.filter(name, isFolder, isArchive);
- return false;
- }
-
public static void logErrorMessage(String message) {
if (message == null)
message= ""; //$NON-NLS-1$
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ExceptionHandler.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ExceptionHandler.java
index 3ea3ba5f8..58d12b4fb 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ExceptionHandler.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ExceptionHandler.java
@@ -33,7 +33,7 @@ public class ExceptionHandler {
private static ExceptionHandler fgInstance= new ExceptionHandler();
- /**
+ /*
* Logs the given exception using the platform's logging mechanism. The exception is
* logged as an error with the error code <code>JavaStatusConstants.INTERNAL_ERROR</code>.
*/
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/INavigatable.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/INavigatable.java
index 3e64e2e9c..eab7f523d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/INavigatable.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/INavigatable.java
@@ -14,7 +14,7 @@ public interface INavigatable {
static final String NAVIGATOR_PROPERTY= "org.eclipse.compare.internal.Navigator"; //$NON-NLS-1$
- /**
+ /*
* Returns true if at end or beginning.
*/
boolean gotoDifference(boolean next);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
index f598f89b8..7a9266b49 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageCanvas.java
@@ -23,7 +23,7 @@ class ImageCanvas extends Canvas {
private Image fImage;
- /**
+ /*
* Create a new ImageCanvas with the given SWT stylebits.
* (SWT.H_SCROLL and SWT.V_SCROLL are automtically added).
*/
@@ -59,7 +59,7 @@ class ImageCanvas extends Canvas {
});
}
- /**
+ /*
* Set the SWT Image to use as the ImageCanvas contents.
*/
public void setImage(Image img) {
@@ -82,9 +82,6 @@ class ImageCanvas extends Canvas {
}
}
- /**
- * @private
- */
void paint(GC gc) {
if (fImage != null) {
Rectangle bounds= fImage.getBounds();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
index d205e2fd1..fd733547a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ImageMergeViewer.java
@@ -61,7 +61,7 @@ public class ImageMergeViewer extends ContentMergeViewer {
setInput(fRight, right);
}
- /**
+ /*
* We can't modify the contents of either side we just return null.
*/
protected byte[] getContents(boolean left) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
index b39150c19..8de56aa1d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ListContentProvider.java
@@ -22,6 +22,7 @@ public class ListContentProvider implements IStructuredContentProvider {
List fContents;
public ListContentProvider() {
+ // nothing to do
}
public Object[] getElements(Object input) {
@@ -39,6 +40,7 @@ public class ListContentProvider implements IStructuredContentProvider {
}
public void dispose() {
+ // empty default implementation
}
public boolean isDeleted(Object o) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
index 46b7a4d60..d162414d7 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeSourceViewer.java
@@ -170,7 +170,7 @@ public class MergeSourceViewer extends SourceViewer
}
}
- /**
+ /*
* Returns number of lines in document region.
*/
public int getLineCount() {
@@ -215,7 +215,7 @@ public class MergeSourceViewer extends SourceViewer
return 0;
}
- /**
+ /*
* Returns lines
*/
public int getDocumentRegionOffset() {
@@ -237,7 +237,7 @@ public class MergeSourceViewer extends SourceViewer
return getTopInset() - ((getDocumentRegionOffset()*lineHeight) + st.getTopPixel());
}
- /**
+ /*
* Returns the start line and the number of lines which correspond to the given position.
* Starting line number is 0 based.
*/
@@ -288,7 +288,7 @@ public class MergeSourceViewer extends SourceViewer
return region;
}
- /**
+ /*
* Scroll TextPart to the given line.
*/
public void vscroll(int line) {
@@ -367,7 +367,7 @@ public class MergeSourceViewer extends SourceViewer
}
}
- /**
+ /*
* Allows the viewer to add menus and/or tools to the context menu.
*/
public void menuAboutToShow(IMenuManager menu) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java
index 590ab8696..d0e53995e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerAction.java
@@ -39,5 +39,6 @@ public abstract class MergeViewerAction extends Action implements IUpdate {
}
public void update() {
+ // empty default implementation
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java
index 026e0ec22..d36ec19d5 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/MergeViewerContentProvider.java
@@ -38,6 +38,7 @@ public class MergeViewerContentProvider implements IMergeViewerContentProvider {
}
public void dispose() {
+ // empty default implementation
}
public void inputChanged(Viewer v, Object o1, Object o2) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java
index 9fd741dad..9cc039d26 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/OverlayPreferenceStore.java
@@ -23,6 +23,7 @@ public class OverlayPreferenceStore implements IPreferenceStore {
public static final class TypeDescriptor {
private TypeDescriptor() {
+ // nothing to do
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
index 423ba9711..669aec61d 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResizableDialog.java
@@ -131,10 +131,12 @@ public abstract class ResizableDialog extends Dialog {
try {
loc.x= bounds.getInt(X);
} catch (NumberFormatException e) {
+ // silently ignored
}
try {
loc.y= bounds.getInt(Y);
} catch (NumberFormatException e) {
+ // silently ignored
}
}
return loc;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
index 4e1b7acd0..d2de626b2 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java
@@ -94,7 +94,7 @@ class ResourceCompareInput extends CompareEditorInput {
}
}
- /**
+ /*
* Creates an compare editor input for the given selection.
*/
ResourceCompareInput(CompareConfiguration config) {
@@ -162,7 +162,7 @@ class ResourceCompareInput extends CompareEditorInput {
}
}
- /**
+ /*
* Returns true if compare can be executed for the given selection.
*/
public boolean isEnabled(ISelection s) {
@@ -212,14 +212,14 @@ class ResourceCompareInput extends CompareEditorInput {
}
}
- /**
+ /*
* Returns true if both resources are either structured or unstructured.
*/
private boolean comparable(IResource c1, IResource c2) {
return hasStructure(c1) == hasStructure(c2);
}
- /**
+ /*
* Returns true if the given argument has a structure.
*/
private boolean hasStructure(IResource input) {
@@ -239,7 +239,7 @@ class ResourceCompareInput extends CompareEditorInput {
return false;
}
- /**
+ /*
* Creates a <code>IStructureComparator</code> for the given input.
* Returns <code>null</code> if no <code>IStructureComparator</code>
* can be found for the <code>IResource</code>.
@@ -260,7 +260,7 @@ class ResourceCompareInput extends CompareEditorInput {
return null;
}
- /**
+ /*
* Performs a two-way or three-way diff on the current selection.
*/
public Object prepareInput(IProgressMonitor pm) throws InvocationTargetException {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java
index e1ecc1574..16225ecb4 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StreamMergerDescriptor.java
@@ -23,14 +23,14 @@ class StreamMergerDescriptor {
private IConfigurationElement fElement;
- /**
+ /*
* Creates a new sorter node with the given configuration element.
*/
public StreamMergerDescriptor(IConfigurationElement element) {
fElement= element;
}
- /**
+ /*
* Creates a new stream merger from this node.
*/
public IStreamMerger createStreamMerger() {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StructureCreatorDescriptor.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StructureCreatorDescriptor.java
index 8d0bc78ad..be8a4d6b9 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StructureCreatorDescriptor.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/StructureCreatorDescriptor.java
@@ -25,14 +25,14 @@ public class StructureCreatorDescriptor {
private IConfigurationElement fElement;
- /**
+ /*
* Creates a new sorter node with the given configuration element.
*/
public StructureCreatorDescriptor(IConfigurationElement element) {
fElement= element;
}
- /**
+ /*
* Creates a new sorter from this node.
*/
public IStructureCreator createStructureCreator() {
@@ -48,7 +48,7 @@ public class StructureCreatorDescriptor {
}
}
- /**
+ /*
* Returns the structure creator's extensions.
*/
public String getExtension() {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TokenComparator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TokenComparator.java
index e1aca48c9..e2ecaf7eb 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TokenComparator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/TokenComparator.java
@@ -32,7 +32,7 @@ public class TokenComparator implements ITokenComparator {
/**
* Creates a <code>TokenComparator</code> for the given string.
*
- * @param string the string that is split into token
+ * @param text the string that is split into token
*/
public TokenComparator(String text) {
@@ -69,11 +69,11 @@ public class TokenComparator implements ITokenComparator {
/**
* Creates a <code>TokenComparator</code> for the given string.
*
- * @param string the string that is split into token
+ * @param text the string that is split into token
* @param shouldEscape
*/
- public TokenComparator(String s, boolean shouldEscape) {
- this(s);
+ public TokenComparator(String text, boolean shouldEscape) {
+ this(text);
fShouldEscape= shouldEscape;
}
@@ -124,9 +124,8 @@ public class TokenComparator implements ITokenComparator {
return false;
}
- /**
+ /*
* Aborts the comparison if the number of tokens is too large.
- *
* @return <code>true</code> to abort a token comparison
*/
public boolean skipRangeComparison(int length, int max, IRangeComparator other) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
index 3bf7c1670..ef697931f 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/Utilities.java
@@ -19,6 +19,7 @@ import org.eclipse.swt.widgets.*;
import org.eclipse.core.resources.IEncodedStorage;
import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourceAttributes;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.action.IAction;
@@ -142,7 +143,7 @@ public class Utilities {
return tmp;
}
- /**
+ /*
* Convenience method: extract all accessible <code>IResources</code> from given selection.
* Never returns null.
*/
@@ -151,7 +152,7 @@ public class Utilities {
return (IResource[]) tmp.toArray(new IResource[tmp.size()]);
}
- /**
+ /*
* Convenience method: extract all accessible <code>IFiles</code> from given selection.
* Never returns null.
*/
@@ -189,7 +190,7 @@ public class Utilities {
return "icons/full/"; //$NON-NLS-1$
}
- /**
+ /*
* Initialize the given Action from a ResourceBundle.
*/
public static void initAction(IAction a, ResourceBundle bundle, String prefix) {
@@ -383,7 +384,7 @@ public class Utilities {
*/
private static final int VALIDATE_EDIT_PROBLEM= 10004;
- /**
+ /*
* Makes the given resources committable. Committable means that all
* resources are writeable and that the content of the resources hasn't
* changed by calling <code>validateEdit</code> for a given file on
@@ -399,7 +400,7 @@ public class Utilities {
return validateResources(new IResource[] { resource }, shell, title);
}
- /**
+ /*
* Makes the given resources committable. Committable means that all
* resources are writeable and that the content of the resources hasn't
* changed by calling <code>validateEdit</code> for a given file on
@@ -416,7 +417,7 @@ public class Utilities {
return validateResources(r, shell, title);
}
- /**
+ /*
* Makes the given resources committable. Committable means that all
* resources are writeable and that the content of the resources hasn't
* changed by calling <code>validateEdit</code> for a given file on
@@ -478,7 +479,8 @@ public class Utilities {
List readOnlyFiles= new ArrayList();
for (int i= 0; i < resources.length; i++) {
IResource resource= resources[i];
- if (resource.getType() == IResource.FILE && resource.isReadOnly())
+ ResourceAttributes resourceAttributes= resource.getResourceAttributes();
+ if (resource.getType() == IResource.FILE && resourceAttributes != null && resourceAttributes.isReadOnly())
readOnlyFiles.add(resource);
}
return readOnlyFiles;
@@ -513,7 +515,7 @@ public class Utilities {
// encoding
- /**
+ /*
* Returns null if an error occurred.
*/
public static String readString(InputStream is, String encoding) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java
index f9f324339..ce923314a 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/LineComparator.java
@@ -30,6 +30,7 @@ class LineComparator implements IRangeComparator {
while ((line = br.readLine()) != null)
ar.add(line);
} catch (IOException e) {
+ // silently ignored
}
// try {
// is.close();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/MergeMessages.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/MergeMessages.java
index e72825d2a..21c7939cf 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/MergeMessages.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/MergeMessages.java
@@ -20,6 +20,7 @@ class MergeMessages {
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
private MergeMessages() {
+ // nothing to do
}
public static String getString(String key) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java
index 84f68ed2e..c7bc3fe30 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/merge/TextStreamMerger.java
@@ -49,7 +49,7 @@ public class TextStreamMerger implements IStreamMerger {
t= new LineComparator(target, targetEncoding);
o= new LineComparator(other, otherEncoding);
} catch (UnsupportedEncodingException e) {
- return new Status(Status.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.getString("TextAutoMerge.inputEncodingError"), e); //$NON-NLS-1$
+ return new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.getString("TextAutoMerge.inputEncodingError"), e); //$NON-NLS-1$
}
try {
@@ -79,7 +79,7 @@ public class TextStreamMerger implements IStreamMerger {
break;
case RangeDifference.CONFLICT:
- return new Status(Status.ERROR, CompareUI.PLUGIN_ID, CONFLICT, MergeMessages.getString("TextAutoMerge.conflict"), null); //$NON-NLS-1$
+ return new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, CONFLICT, MergeMessages.getString("TextAutoMerge.conflict"), null); //$NON-NLS-1$
default:
break;
@@ -87,9 +87,9 @@ public class TextStreamMerger implements IStreamMerger {
}
} catch (UnsupportedEncodingException e) {
- return new Status(Status.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.getString("TextAutoMerge.outputEncodingError"), e); //$NON-NLS-1$
+ return new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.getString("TextAutoMerge.outputEncodingError"), e); //$NON-NLS-1$
} catch (IOException e) {
- return new Status(Status.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.getString("TextAutoMerge.outputIOError"), e); //$NON-NLS-1$
+ return new Status(IStatus.ERROR, CompareUI.PLUGIN_ID, 1, MergeMessages.getString("TextAutoMerge.outputIOError"), e); //$NON-NLS-1$
}
return Status.OK_STATUS;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Hunk.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Hunk.java
index 9efd347da..24a336532 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Hunk.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Hunk.java
@@ -78,7 +78,7 @@ import java.util.List;
}
}
- /**
+ /*
* Returns the contents of this hunk.
* Each line starts with a control character. Their meaning is as follows:
* <ul>
@@ -100,7 +100,7 @@ import java.util.List;
return sb.toString();
}
- /**
+ /*
* Returns a descriptive String for this hunk.
* It is in the form old_start,old_length -> new_start,new_length.
*/
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
index d36158d56..6ec5fd293 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/InputPatchPage.java
@@ -64,7 +64,7 @@ import org.eclipse.core.runtime.*;
setMessage(PatchMessages.getString("InputPatchPage.message")); //$NON-NLS-1$
}
- /**
+ /*
* Get a path from the supplied text widget.
* @return org.eclipse.core.runtime.IPath
*/
@@ -193,7 +193,7 @@ import org.eclipse.core.runtime.*;
fPatchFileBrowseButton.setEnabled(enable);
}
- /**
+ /*
* Create the group for selecting the patch file
*/
private void buildPatchFileGroup(Composite parent) {
@@ -507,7 +507,7 @@ import org.eclipse.core.runtime.*;
return ""; //$NON-NLS-1$
}
- /**
+ /*
* Adds an entry to a history, while taking care of duplicate history items
* and excessively long histories. The assumption is made that all histories
* should be of length <code>COMBO_HISTORY_LENGTH</code>.
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java
index 02fd97aef..f4ceeeb01 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java
@@ -103,7 +103,8 @@ import org.eclipse.jface.util.Assert;
}
return null;
}
- /**
+
+ /*
* Returns the number of characters in the given string without
* counting a trailing line separator.
*/
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.java
index fc7520bc8..eac554ccf 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchMessages.java
@@ -20,6 +20,7 @@ public class PatchMessages {
private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
private PatchMessages() {
+ // nothing to do
}
public static String getString(String key) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
index 1ad13ef1d..6f7b1f5e5 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PatchWizard.java
@@ -38,7 +38,7 @@ import org.eclipse.compare.internal.*;
private IResource fTarget;
- /**
+ /*
* Creates a wizard for applying a patch file to the workspace.
*/
/* package */ PatchWizard(ISelection selection) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
index 721db089e..29e3827d1 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/Patcher.java
@@ -67,6 +67,7 @@ public class Patcher {
Patcher() {
+ // nothing to do
}
//---- options
@@ -79,7 +80,7 @@ public class Patcher {
return fName;
}
- /**
+ /*
* 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>.
*/
@@ -94,7 +95,7 @@ public class Patcher {
return path;
}
- /**
+ /*
* Returns <code>true</code> if new value differs from old.
*/
boolean setStripPrefixSegments(int strip) {
@@ -109,7 +110,7 @@ public class Patcher {
return fStripPrefixSegments;
}
- /**
+ /*
* Returns <code>true</code> if new value differs from old.
*/
boolean setFuzz(int fuzz) {
@@ -120,7 +121,7 @@ public class Patcher {
return false;
}
- /**
+ /*
* Returns <code>true</code> if new value differs from old.
*/
boolean setReversed(boolean reverse) {
@@ -135,7 +136,7 @@ public class Patcher {
return false;
}
- /**
+ /*
* Returns <code>true</code> if new value differs from old.
*/
boolean setIgnoreWhitespace(boolean ignoreWhitespace) {
@@ -195,7 +196,7 @@ public class Patcher {
fDiffs= (Diff[]) diffs.toArray(new Diff[diffs.size()]);
}
- /**
+ /*
* Returns the next line that does not belong to this diff
*/
private String readUnifiedDiff(List diffs, LineReader reader, String line, String args, String fileName) throws IOException {
@@ -290,7 +291,7 @@ public class Patcher {
}
}
- /**
+ /*
* Returns the next line that does not belong to this diff
*/
private String readContextDiff(List diffs, LineReader reader, String line, String args, String fileName) throws IOException {
@@ -380,7 +381,7 @@ public class Patcher {
}
}
- /**
+ /*
* Creates a List of lines in the unified format from
* two Lists of lines in the 'classic' format.
*/
@@ -502,7 +503,7 @@ public class Patcher {
return result;
}
- /**
+ /*
* Breaks the given string into tab separated substrings.
* Leading and trailing whitespace is removed from each token.
*/
@@ -517,7 +518,7 @@ public class Patcher {
return (String[]) l.toArray(new String[l.size()]);
}
- /**
+ /*
* @return the parsed time/date in milliseconds or -1 on error
*/
private long extractDate(String[] args, int n) {
@@ -537,7 +538,7 @@ public class Patcher {
return -1;
}
- /**
+ /*
* Returns null if file name is "/dev/null".
*/
private IPath extractPath(String[] args, int n, String path2) {
@@ -557,7 +558,7 @@ public class Patcher {
return null;
}
- /**
+ /*
* Tries to extract two integers separated by a comma.
* The parsing of the line starts at the position after
* the first occurrence of the given character start an ends
@@ -592,7 +593,7 @@ public class Patcher {
//---- applying a patch file
- /**
+ /*
* Tries to patch the given lines with the specified Diff.
* Any hunk that couldn't be applied is returned in the list failedHunks.
*/
@@ -607,7 +608,7 @@ public class Patcher {
}
}
- /**
+ /*
* Tries to apply the specified hunk to the given lines.
* If the hunk cannot be applied at the original position
* the methods tries Fuzz lines before and after.
@@ -654,7 +655,7 @@ public class Patcher {
return shift;
}
- /**
+ /*
* Tries to apply the given hunk on the specified lines.
* The parameter shift is added to the line numbers given
* in the hunk.
@@ -846,7 +847,7 @@ public class Patcher {
}
}
- /**
+ /*
* Reads the contents from the given file and returns them as
* a List of lines.
*/
@@ -894,7 +895,7 @@ public class Patcher {
return lines;
}
- /**
+ /*
* Converts the string into bytes and stores them in the given file.
*/
private void store(String contents, IFile file, IProgressMonitor pm) throws CoreException {
@@ -924,7 +925,7 @@ public class Patcher {
}
}
- /**
+ /*
* Concatenates all strings found in the given List.
*/
private String createString(List lines) {
@@ -965,7 +966,7 @@ public class Patcher {
return sb.toString();
}
- /**
+ /*
* Ensures that a file with the given path exists in
* the given container. Folder are created as necessary.
*/
@@ -980,7 +981,7 @@ public class Patcher {
return container.getFile(path);
}
- /**
+ /*
* Returns the given string with all whitespace characters removed.
* Whitespace is defined by <code>Character.isWhitespace(...)</code>.
*/
@@ -995,7 +996,7 @@ public class Patcher {
return sb.toString();
}
- /**
+ /*
* Compares two strings.
* If fIgnoreWhitespace is true whitespace is ignored.
*/
@@ -1012,7 +1013,7 @@ public class Patcher {
return line1.equals(line2);
}
- /**
+ /*
* Returns the length (exluding a line delimiter CR, LF, CR/LF)
* of the given string.
*/
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
index d73579cc7..b4046f039 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/PreviewPatchPage.java
@@ -241,7 +241,7 @@ import org.eclipse.compare.structuremergeviewer.*;
Dialog.applyDialogFont(composite);
}
- /**
+ /*
* Create the group for setting various patch options
*/
private void buildPatchOptionsGroup(Composite parent) {
@@ -530,13 +530,12 @@ import org.eclipse.compare.structuremergeviewer.*;
return null;
}
- /**
+ /*
* Returns true if path completely matches the end of fullpath
*/
private boolean matches(IPath fullpath, IPath path) {
- for (IPath p= fullpath; path.segmentCount() <= p.segmentCount();
- p= p.removeFirstSegments(1)) {
+ for (IPath p= fullpath; path.segmentCount() <= p.segmentCount(); p= p.removeFirstSegments(1)) {
if (p.equals(path))
return true;
}
@@ -633,7 +632,7 @@ import org.eclipse.compare.structuremergeviewer.*;
setPageComplete(updateModel());
}
- /**
+ /*
* Updates the gray state of the given diff and the checked state of its children.
*/
private void updateCheckedState(TreeItem diffItem) {
@@ -658,7 +657,7 @@ import org.eclipse.compare.structuremergeviewer.*;
setPageComplete(updateModel());
}
- /**
+ /*
* Updates the gray state of the given items parent.
*/
private void updateGrayedState(TreeItem hunk) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/DifferencesIterator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/DifferencesIterator.java
index 3c4be7f87..0ad70b4f4 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/DifferencesIterator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/DifferencesIterator.java
@@ -24,7 +24,7 @@ import java.util.List;
RangeDifference[] fArray;
RangeDifference fDifference;
- /**
+ /*
* Creates a differences iterator on an array of <code>RangeDifference</code>s.
*/
DifferencesIterator(RangeDifference[] differenceRanges) {
@@ -38,14 +38,14 @@ import java.util.List;
fDifference= null;
}
- /**
+ /*
* Returns the number of RangeDifferences
*/
int getCount() {
return fRange.size();
}
- /**
+ /*
* Appends the edit to its list and moves to the next <code>RangeDifference</code>.
*/
void next() {
@@ -58,7 +58,7 @@ import java.util.List;
}
}
- /**
+ /*
* Difference iterators are used in pairs.
* This method returns the other iterator.
*/
@@ -68,7 +68,7 @@ import java.util.List;
return right;
}
- /**
+ /*
* Removes all <code>RangeDifference</code>s
*/
void removeAll() {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/LinkedRangeDifference.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/LinkedRangeDifference.java
index cd9ef08e7..0d06930bf 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/LinkedRangeDifference.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/LinkedRangeDifference.java
@@ -17,7 +17,7 @@ package org.eclipse.compare.rangedifferencer;
LinkedRangeDifference fNext;
- /**
+ /*
* Creates a LinkedRangeDifference an initializes it to the error state
*/
LinkedRangeDifference() {
@@ -25,7 +25,7 @@ package org.eclipse.compare.rangedifferencer;
fNext= null;
}
- /**
+ /*
* Constructs and links a LinkeRangeDifference to another LinkedRangeDifference
*/
LinkedRangeDifference(LinkedRangeDifference next, int operation) {
@@ -33,7 +33,7 @@ package org.eclipse.compare.rangedifferencer;
fNext= next;
}
- /**
+ /*
* Follows the next link
*/
LinkedRangeDifference getNext() {
@@ -48,7 +48,7 @@ package org.eclipse.compare.rangedifferencer;
return kind() == INSERT;
}
- /**
+ /*
* Sets the next link of this LinkedRangeDifference
*/
void setNext(LinkedRangeDifference next) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifference.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifference.java
index 9a8b15d50..8d75eae7e 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifference.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifference.java
@@ -71,7 +71,7 @@ public class RangeDifference {
* Creates a new <code>RangeDifference</code> with the given change kind
* and left and right ranges.
*
- * @param changeKind the kind of change
+ * @param kind the kind of change
* @param rightStart start index of entity on right side
* @param rightLength number of entities on right side
* @param leftStart start index of entity on left side
@@ -89,7 +89,7 @@ public class RangeDifference {
* Creates a new <code>RangeDifference</code> with the given change kind
* and left, right, and ancestor ranges.
*
- * @param changeKind the kind of change
+ * @param kind the kind of change
* @param rightStart start index of entity on right side
* @param rightLength number of entities on right side
* @param leftStart start index of entity on left side
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifferencer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
index d3cb46313..31cbc8214 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
@@ -44,7 +44,8 @@ public final class RangeDifferencer {
/* (non Javadoc)
* Non instantiatiable!
*/
- private RangeDifferencer() {
+ private RangeDifferencer() {
+ // nothing to do
}
/**
@@ -93,8 +94,8 @@ public final class RangeDifferencer {
int row, col;
// find common prefix
- for (row= 0; row < rightSize && row < leftSize && rangesEqual(right, row, left, row) == true; ++row)
- ;
+ for (row= 0; row < rightSize && row < leftSize && rangesEqual(right, row, left, row) == true;)
+ row++;
lastDiagonal[origin]= row;
script[origin]= null;
@@ -381,7 +382,7 @@ public final class RangeDifferencer {
//---- private methods
- /**
+ /*
* Creates a Vector of DifferencesRanges out of the LinkedRangeDifference.
* It coalesces adjacent changes.
* In addition, indices are changed such that the ranges are 1) open, i.e,
@@ -445,18 +446,12 @@ public final class RangeDifferencer {
return (RangeDifference[]) result.toArray(EMPTY_RESULT);
}
- /**
+ /*
* Creates a <code>RangeDifference3</code> given the
* state of two DifferenceIterators.
*/
- private static RangeDifference createRangeDifference3(
- DifferencesIterator myIter,
- DifferencesIterator yourIter,
- List diff3,
- IRangeComparator right,
- IRangeComparator left,
- int changeRangeStart,
- int changeRangeEnd) {
+ private static RangeDifference createRangeDifference3(DifferencesIterator myIter, DifferencesIterator yourIter, List diff3,
+ IRangeComparator right, IRangeComparator left, int changeRangeStart, int changeRangeEnd) {
int rightStart, rightEnd;
int leftStart, leftEnd;
@@ -498,14 +493,14 @@ public final class RangeDifferencer {
return new RangeDifference(kind, rightStart, rightEnd - rightStart, leftStart, leftEnd - leftStart, changeRangeStart, changeRangeEnd - changeRangeStart);
}
- /**
+ /*
* Tests if two ranges are equal
*/
private static boolean rangesEqual(IRangeComparator a, int ai, IRangeComparator b, int bi) {
return a.rangesEqual(ai, b, bi);
}
- /**
+ /*
* Tests whether <code>right</code> and <code>left</left> changed in the same way
*/
private static boolean rangeSpansEqual(IRangeComparator right, int rightStart, int rightLen, IRangeComparator left, int leftStart, int leftLen) {
@@ -521,7 +516,7 @@ public final class RangeDifferencer {
return false;
}
- /**
+ /*
* Reverses the range differences
*/
private static LinkedRangeDifference reverseDifferences(LinkedRangeDifference start) {
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffContainer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffContainer.java
index b9066ec68..b74d36e1b 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffContainer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffContainer.java
@@ -60,13 +60,10 @@ public abstract class DiffContainer extends DiffElement implements IDiffContaine
diff.setParent(this);
}
- /**
+ /*
* Removes the given child from this container.
* If the container becomes empty it is removed from its container.
*/
- /* (non Javadoc)
- * see IDiffContainer.removeToRoot
- */
public void removeToRoot(IDiffElement child) {
if (fChildren != null) {
fChildren.remove(child);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffElement.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffElement.java
index 82472ff92..ef1cf5f59 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffElement.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffElement.java
@@ -43,6 +43,7 @@ public abstract class DiffElement implements IDiffElement {
* The <code>DiffElement</code> implementation of this <code>ITypedInput</code>
* method returns <code>null</code>. Subclasses may re-implement to provide
* an image for this element.
+ * @return <code>null</code>.
*/
public Image getImage() {
return null;
@@ -52,6 +53,7 @@ public abstract class DiffElement implements IDiffElement {
* The <code>DiffElement</code> implementation of this <code>ITypedElement</code>
* method returns <code>ITypedElement.UNKNOWN_TYPE</code>. Subclasses may
* re-implement to provide a type for this element.
+ * @return <code>ITypedElement.UNKNOWN_TYPE</code>.
*/
public String getType() {
return ITypedElement.UNKNOWN_TYPE;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
index 3e7d5e059..8e062d273 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java
@@ -180,9 +180,7 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
* Otherwise both names are concatenated (separated with a slash ('/')).
* <p>
* Subclasses may re-implement to provide a different name for this node.
- */
- /* (non Javadoc)
- * see ITypedElement.getName
+ * @return the name of this node.
*/
public String getName() {
String right= null;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
index 9cccaa478..5b6b849f3 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffTreeViewer.java
@@ -57,6 +57,7 @@ public class DiffTreeViewer extends TreeViewer {
class DiffViewerContentProvider implements ITreeContentProvider {
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ // empty implementation
}
public boolean isDeleted(Object element) {
@@ -243,8 +244,9 @@ public class DiffTreeViewer extends TreeViewer {
fillContextMenu(mm2);
if (mm2.isEmpty()) {
if (fEmptyMenuAction == null) {
- fEmptyMenuAction=
- new Action(Utilities.getString(fBundle, "emptyMenuItem")) {}; //$NON-NLS-1$
+ fEmptyMenuAction= new Action(Utilities.getString(fBundle, "emptyMenuItem")) { //$NON-NLS-1$
+ // left empty
+ };
fEmptyMenuAction.setEnabled(false);
}
mm2.add(fEmptyMenuAction);
@@ -289,6 +291,7 @@ public class DiffTreeViewer extends TreeViewer {
* Called on the viewer disposal.
* Unregisters from the compare configuration.
* Clients may extend if they have to do additional cleanup.
+ * @param event dispose event that triggered call to this method
*/
protected void handleDispose(DisposeEvent event) {
@@ -305,8 +308,10 @@ public class DiffTreeViewer extends TreeViewer {
/**
* Tracks property changes of the configuration object.
* Clients may extend to track their own property changes.
+ * @param event property change event that triggered call to this method
*/
protected void propertyChange(PropertyChangeEvent event) {
+ // empty default implementation
}
protected void inputChanged(Object in, Object oldInput) {
@@ -334,6 +339,8 @@ public class DiffTreeViewer extends TreeViewer {
/**
* Overridden to avoid expanding <code>DiffNode</code>s that shouldn't expand.
+ * @param node the node to expand
+ * @param level non-negative level, or <code>ALL_LEVELS</code> to collapse all levels of the tree
*/
protected void internalExpandToLevel(Widget node, int level) {
@@ -491,7 +498,7 @@ public class DiffTreeViewer extends TreeViewer {
* Called to copy one side of the given node to the other.
* This default implementation delegates the call to <code>ICompareInput.copy(...)</code>.
* Clients may override.
- *
+ * @param node the node to copy
* @param leftToRight if <code>true</code> the left side is copied to the right side.
* If <code>false</code> the right side is copied to the left side
*/
@@ -525,6 +532,7 @@ public class DiffTreeViewer extends TreeViewer {
* Clients may override.
*
* @param next if <code>true</code> the next node is selected, otherwise the previous node
+ * @param fireOpen if <code>true</code> an open event is fired.
* @return <code>true</code> if at end (or beginning)
*/
private boolean internalNavigate(boolean next, boolean fireOpen) {
@@ -606,7 +614,7 @@ public class DiffTreeViewer extends TreeViewer {
}
// go up
- return parent;
+ item= parent;
} else {
item.setExpanded(true);
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java
index 047bb2c3d..b90c3c0ef 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/Differencer.java
@@ -112,6 +112,7 @@ public class Differencer {
Object fRight;
Node() {
+ // nothing to do
}
Node(Node parent, Object ancestor, Object left, Object right) {
parent.add(this);
@@ -188,6 +189,7 @@ public class Differencer {
* Creates a new differencing engine.
*/
public Differencer() {
+ // nothing to do
}
/**
@@ -222,7 +224,7 @@ public class Differencer {
return null;
}
- /**
+ /*
* Traverse tree in postorder.
*/
private int traverse(boolean threeWay, Node parent, IProgressMonitor pm, Object ancestor, Object left, Object right) {
@@ -331,7 +333,7 @@ public class Differencer {
return new DiffNode((IDiffContainer) data, result, (ITypedElement)ancestor, (ITypedElement)left, (ITypedElement)right);
}
- /**
+ /*
* Performs a 2-way or 3-way compare of the given leaf elements and returns an integer
* describing the kind of difference.
*/
@@ -377,9 +379,9 @@ public class Differencer {
boolean ay= contentsEqual(ancestor, left);
boolean am= contentsEqual(ancestor, right);
- if (ay && am)
- ;
- else if (ay && !am) {
+ if (ay && am) {
+ // empty
+ } else if (ay && !am) {
description= RIGHT | CHANGE;
} else if (!ay && am) {
description= LEFT | CHANGE;
@@ -470,7 +472,7 @@ public class Differencer {
return false;
}
- /**
+ /*
* Tries to return an InputStream for the given object.
* Returns <code>null</code> if the object not an IStreamContentAccessor
* or an error occured.
@@ -496,6 +498,7 @@ public class Differencer {
* </p>
*
* @param input the object for which to return children
+ * @return the children of the given input or <code>null</code> if there are no children.
*/
protected Object[] getChildren(Object input) {
if (input instanceof IStructureComparator)
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java
index de2c54f44..d35bc457c 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DocumentRangeNode.java
@@ -213,6 +213,8 @@ public class DocumentRangeNode
/**
* Implementation based on <code>getID</code>.
+ * @param other the object to compare this <code>DocumentRangeNode</code> against.
+ * @return <code>true</code> if the <code>DocumentRangeNodes</code>are equal; <code>false</code> otherwise.
*/
public boolean equals(Object other) {
if (other != null && other.getClass() == getClass()) {
@@ -224,12 +226,13 @@ public class DocumentRangeNode
/**
* Implementation based on <code>getID</code>.
+ * @return a hashcode for this object.
*/
public int hashCode() {
return fID.hashCode();
}
- /**
+ /*
* Find corresponding position
*/
private Position findCorrespondingPosition(DocumentRangeNode otherParent, DocumentRangeNode child) {
@@ -342,6 +345,7 @@ public class DocumentRangeNode
* see IEditableContent.setContent
*/
public void setContent(byte[] content) {
+ // empty default implementation
}
/* (non-Javadoc)
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
index 9b91942ef..9dd4f68f8 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/StructureDiffViewer.java
@@ -119,6 +119,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
/**
* Reimplemented to get the descriptive title for this viewer from the <code>IStructureCreator</code>.
+ * @return the viewer's name
*/
public String getTitle() {
if (fStructureCreator != null)
@@ -136,8 +137,9 @@ public class StructureDiffViewer extends DiffTreeViewer {
return fRoot;
}
- /**
- * Overridden to create the comparable structures from the input object
+ /*
+ * (non-Javadoc) Method declared on StructuredViewer.
+ * Overridden to create the comparable structures from the input object
* and to feed them through the differencing engine. Note: for this viewer
* the value from <code>getInput</code> is not identical to <code>getRoot</code>.
*/
@@ -167,6 +169,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
/**
* Recreates the comparable structures for the input sides.
+ * @param input this viewer's new input
*/
protected void compareInputChanged(ICompareInput input) {
ITypedElement t= null;
@@ -226,6 +229,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
/**
* Calls <code>diff</code> whenever the byte contents changes.
+ * @param changed the object that sent out the notification
*/
protected void contentChanged(IContentChangeNotifier changed) {
@@ -321,7 +325,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
// we do nothing here
}
- /**
+ /*
* Performs a byte compare on the given objects.
* Called from the difference engine.
* Returns <code>null</code> if no structure creator has been set.
@@ -342,6 +346,7 @@ public class StructureDiffViewer extends DiffTreeViewer {
* Tracks property changes of the configuration object.
* Clients may override to track their own property changes.
* In this case they must call the inherited method.
+ * @param event the property changed event that triggered the call to this method
*/
protected void propertyChange(PropertyChangeEvent event) {
String key= event.getProperty();

Back to the top