Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2004-08-23 13:08:42 -0400
committerAndre Weinand2004-08-23 13:08:42 -0400
commit70d3f192e8c5ae2129c9a3a12311ac791a9a7c70 (patch)
tree0d05aaa42f511392091012c4d22bc8041b9f5404 /bundles/org.eclipse.compare/compare
parent6184c3e1cc7b6b3029bf6c86fd531231a1d0f81a (diff)
downloadeclipse.platform.team-70d3f192e8c5ae2129c9a3a12311ac791a9a7c70.tar.gz
eclipse.platform.team-70d3f192e8c5ae2129c9a3a12311ac791a9a7c70.tar.xz
eclipse.platform.team-70d3f192e8c5ae2129c9a3a12311ac791a9a7c70.zip
eliminated compiler warnings
Diffstat (limited to 'bundles/org.eclipse.compare/compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java18
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java19
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java1
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ResourceCompareInput.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ViewerSwitchingCancelled.java2
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/patch/LineReader.java5
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/structuremergeviewer/DiffNode.java2
8 files changed, 19 insertions, 38 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
index 0011f2eba..ad767600c 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
@@ -99,8 +99,8 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
addDisposeListener(
new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
- if (fViewer instanceof ISelectionProvider)
- ((ISelectionProvider) fViewer).removeSelectionChangedListener(CompareViewerSwitchingPane.this);
+ if (fViewer != null)
+ fViewer.removeSelectionChangedListener(CompareViewerSwitchingPane.this);
if (fViewer instanceof StructuredViewer) {
StructuredViewer sv= (StructuredViewer) fViewer;
sv.removeDoubleClickListener(CompareViewerSwitchingPane.this);
@@ -132,8 +132,7 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
if (fViewer != null) {
- if (fViewer instanceof ISelectionProvider)
- ((ISelectionProvider) fViewer).removeSelectionChangedListener(this);
+ fViewer.removeSelectionChangedListener(this);
if (fViewer instanceof StructuredViewer) {
StructuredViewer sv= (StructuredViewer) fViewer;
@@ -164,8 +163,7 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
boolean newEmpty= isEmpty();
- if (fViewer instanceof ISelectionProvider)
- ((ISelectionProvider) fViewer).addSelectionChangedListener(this);
+ fViewer.addSelectionChangedListener(this);
if (fViewer instanceof StructuredViewer) {
StructuredViewer sv= (StructuredViewer) fViewer;
@@ -236,14 +234,14 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
}
public ISelection getSelection() {
- if (fViewer instanceof ISelectionProvider)
- return ((ISelectionProvider) fViewer).getSelection();
+ if (fViewer != null)
+ return fViewer.getSelection();
return null;
}
public void setSelection(ISelection s) {
- if (fViewer instanceof ISelectionProvider)
- ((ISelectionProvider) fViewer).setSelection(s);
+ if (fViewer != null)
+ fViewer.setSelection(s);
}
public void selectionChanged(SelectionChangedEvent ev) {
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 3ec22c11a..3c976fb00 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
@@ -771,14 +771,6 @@ public class TextMergeViewer extends ContentMergeViewer {
updateColors(null);
}
- private RGB getForeground(Display display) {
- if (fForeground != null)
- return fForeground;
- if (display == null)
- display= fComposite.getDisplay();
- return display.getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB();
- }
-
private void updateColors(Display display) {
if (display == null)
@@ -1621,12 +1613,9 @@ public class TextMergeViewer extends ContentMergeViewer {
Object input= getInput();
- Position ancestorRange= null;
Position leftRange= null;
Position rightRange= null;
- int dir= 0;
-
// if one side is empty use container
if (FIX_47640 && !emptyInput && (left == null || right == null)) {
if (input instanceof IDiffElement) {
@@ -1638,8 +1627,6 @@ public class TextMergeViewer extends ContentMergeViewer {
|| ci.getLeft() instanceof IDocumentRange
|| ci.getRight() instanceof IDocumentRange) {
- if (ancestor instanceof IDocumentRange)
- ancestorRange= ((IDocumentRange)ancestor).getRange();
if (left instanceof IDocumentRange)
leftRange= ((IDocumentRange)left).getRange();
if (right instanceof IDocumentRange)
@@ -1648,8 +1635,6 @@ public class TextMergeViewer extends ContentMergeViewer {
ancestor= ci.getAncestor();
left= ci.getLeft();
right= ci.getRight();
-
- dir= ((IDiffElement)input).getKind();
}
}
}
@@ -1732,7 +1717,6 @@ public class TextMergeViewer extends ContentMergeViewer {
return null;
if (fChangeDiffs != null) {
- boolean threeWay= isThreeWay();
Iterator iter= fChangeDiffs.iterator();
while (iter.hasNext()) {
Diff diff= (Diff) iter.next();
@@ -2821,9 +2805,8 @@ public class TextMergeViewer extends ContentMergeViewer {
if (d.fDirection == RangeDifference.CONFLICT) {
unresolvedConflicting++;
break; // we can stop here because a conflict has the maximum priority
- } else {
- unresolvedIncoming++;
}
+ unresolvedIncoming++;
}
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java
index a5f28495c..295f4cc7c 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareNavigator.java
@@ -58,8 +58,9 @@ public class CompareNavigator implements ICompareNavigator {
if (navigators[n].gotoDifference(next)) {
// at end of this navigator
continue;
- } else // not at end
- return false;
+ }
+ // not at end
+ return false;
}
return true;
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 bc0263fee..bc62fa3a9 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
@@ -173,7 +173,6 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
// content type
private static final IContentTypeManager fgContentTypeManager= Platform.getContentTypeManager();
- private static final IContentType CT_TEXT= fgContentTypeManager.getContentType(IContentTypeManager.CT_TEXT);
/**
* The plugin singleton.
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 b8f2c6bbb..4e1b7acd0 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
@@ -313,10 +313,9 @@ class ResourceCompareInput extends CompareEditorInput {
String format= Utilities.getString("ResourceCompare.threeWay.tooltip"); //$NON-NLS-1$
String ancestorLabel= fAncestorResource.getFullPath().makeRelative().toString();
return MessageFormat.format(format, new String[] {ancestorLabel, leftLabel, rightLabel});
- } else {
- String format= Utilities.getString("ResourceCompare.twoWay.tooltip"); //$NON-NLS-1$
- return MessageFormat.format(format, new String[] {leftLabel, rightLabel});
}
+ String format= Utilities.getString("ResourceCompare.twoWay.tooltip"); //$NON-NLS-1$
+ return MessageFormat.format(format, new String[] {leftLabel, rightLabel});
}
// fall back
return super.getToolTipText();
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ViewerSwitchingCancelled.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ViewerSwitchingCancelled.java
index e8200049b..0be0b1396 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ViewerSwitchingCancelled.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/ViewerSwitchingCancelled.java
@@ -13,5 +13,7 @@ package org.eclipse.compare.internal;
public class ViewerSwitchingCancelled extends RuntimeException {
+ private static final long serialVersionUID = 1L;
+
}
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 d52929878..02fd97aef 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
@@ -66,10 +66,9 @@ import org.eclipse.jface.util.Assert;
if (fIgnoreSingleCR) {
sb.append((char)c);
continue;
- } else {
- fHaveChar= true;
- fLastChar= c;
}
+ fHaveChar= true;
+ fLastChar= c;
} else
sb.append((char)c);
break;
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 ecd495e55..3e7d5e059 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
@@ -356,7 +356,7 @@ public class DiffNode extends DiffContainer implements ITypedElement, ICompareIn
String[] path= null;
if (el instanceof IDiffContainer) {
IDiffContainer parent= ((IDiffContainer)el).getParent();
- if (parent instanceof ITypedElement)
+ if (parent != null)
path= getPath(parent, level+1);
}
if (path == null)

Back to the top