Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Vogel2016-10-25 13:18:28 -0400
committerSergey Prigogin2016-10-29 14:06:43 -0400
commit0184c987caf65aef45ba64d52d73953f59fce02f (patch)
tree68c305a8d9c6883d3f32c27e3a0b9810b983cf14
parent766d0c7fb4f68d718956006332af34b3ea01ee70 (diff)
downloadeclipse.platform.team-0184c987caf65aef45ba64d52d73953f59fce02f.tar.gz
eclipse.platform.team-0184c987caf65aef45ba64d52d73953f59fce02f.tar.xz
eclipse.platform.team-0184c987caf65aef45ba64d52d73953f59fce02f.zip
Bug 506518 - Add @Override to org.eclipse.compare.core.
Change-Id: I5f15a0d84360ca5a4a62fa349b1fc27d22b12262 Signed-off-by: Lars Vogel <Lars.Vogel@vogella.com>
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java2
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java6
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/IHunk.java1
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java1
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java6
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java3
-rw-r--r--bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java1
7 files changed, 20 insertions, 0 deletions
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java
index f8fd36179..916ebb7f4 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/ComparePlugin.java
@@ -39,6 +39,7 @@ public class ComparePlugin extends Plugin {
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
@@ -48,6 +49,7 @@ public class ComparePlugin extends Plugin {
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java
index 6e7c55b94..63a394a29 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/internal/core/TextLineLCS.java
@@ -38,23 +38,28 @@ public class TextLineLCS extends LCS {
return result;
}
+ @Override
protected int getLength2() {
return this.lines2.length;
}
+ @Override
protected int getLength1() {
return this.lines1.length;
}
+ @Override
protected boolean isRangeEqual(int i1, int i2) {
return this.lines1[i1].sameText(this.lines2[i2]);
}
+ @Override
protected void setLcs(int sl1, int sl2) {
this.lcs[0][sl1] = this.lines1[sl1];
this.lcs[1][sl1] = this.lines2[sl2];
}
+ @Override
protected void initializeLcs(int length) {
this.lcs = new TextLine[2][length];
}
@@ -200,6 +205,7 @@ public class TextLineLCS extends LCS {
return this.number;
}
+ @Override
public String toString() {
return "" + this.number + " " + this.text + "\n"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/IHunk.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/IHunk.java
index d5edeb179..41560d3a7 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/IHunk.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/IHunk.java
@@ -92,6 +92,7 @@ public interface IHunk {
* {@link IFilePatchResult#getCharset()} as a proper way to
* obtain charset.
*/
+ @Deprecated
public String getCharset() throws CoreException;
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java
index c7ff44aaa..3dadf0836 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/patch/PatchBuilder.java
@@ -235,6 +235,7 @@ public class PatchBuilder {
}
static class HunkComparator implements Comparator {
+ @Override
public int compare(Object arg0, Object arg1) {
if ((arg0 != null && arg0 instanceof Hunk)
&& (arg1 != null && arg1 instanceof Hunk)) {
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java
index 2cf00732e..c4cd87844 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeComparatorLCS.java
@@ -41,22 +41,27 @@ import org.eclipse.core.runtime.SubMonitor;
this.comparator2 = comparator2;
}
+ @Override
protected int getLength1() {
return this.comparator1.getRangeCount();
}
+ @Override
protected int getLength2() {
return this.comparator2.getRangeCount();
}
+ @Override
protected void initializeLcs(int lcsLength) {
this.lcs = new int[2][lcsLength];
}
+ @Override
protected boolean isRangeEqual(int i1, int i2) {
return this.comparator1.rangesEqual(i1, this.comparator2, i2);
}
+ @Override
protected void setLcs(int sl1, int sl2) {
// Add one to the values so that 0 can mean that the slot is empty
this.lcs[0][sl1] = sl1 + 1;
@@ -182,6 +187,7 @@ import org.eclipse.core.runtime.SubMonitor;
/* (non-Javadoc)
* @see org.eclipse.compare.internal.LCS#longestCommonSubsequence(org.eclipse.core.runtime.SubMonitor)
*/
+ @Override
public void longestCommonSubsequence(SubMonitor subMonitor) {
super.longestCommonSubsequence(subMonitor);
if (this.lcs != null) { // The LCS can be null if one of the sides is empty
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java
index 05584b816..24bd5f46f 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifference.java
@@ -257,6 +257,7 @@ public class RangeDifference {
return Math.max(this.rightLength, Math.max(this.leftLength, this.ancestorLength));
}
+ @Override
public boolean equals(Object obj) {
if (obj instanceof RangeDifference) {
RangeDifference other = (RangeDifference) obj;
@@ -271,6 +272,7 @@ public class RangeDifference {
return super.equals(obj);
}
+ @Override
public int hashCode() {
final int prime = 31;
int result = 1;
@@ -284,6 +286,7 @@ public class RangeDifference {
return result;
}
+ @Override
public String toString() {
StringBuffer buf = new StringBuffer("RangeDifference {"); //$NON-NLS-1$
switch (this.kind) {
diff --git a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
index a4984cf23..e91a8b4bc 100644
--- a/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
+++ b/bundles/org.eclipse.compare.core/src/org/eclipse/compare/rangedifferencer/RangeDifferencer.java
@@ -42,6 +42,7 @@ public final class RangeDifferencer {
private static final RangeDifference[] EMPTY_RESULT= new RangeDifference[0];
private static final AbstractRangeDifferenceFactory defaultFactory = new AbstractRangeDifferenceFactory() {
+ @Override
protected RangeDifference createRangeDifference() {
return new RangeDifference(RangeDifference.NOCHANGE);
}

Back to the top