diff options
author | David Pursehouse <david.pursehouse@gmail.com> | 2017-01-16 14:39:32 +0900 |
---|---|---|
committer | David Pursehouse <david.pursehouse@gmail.com> | 2017-02-19 20:05:08 -0400 |
commit | 7ac182f4e427e0d5a986b8ca67a56fc22828b1a0 (patch) | |
tree | 7a63f64443cd919e361d7de747ef31ffa5bd6279 /org.eclipse.jgit.pgm/src/org/eclipse/jgit | |
parent | 5e8e2179b218ede7d14b69dc5149b0691b5859cf (diff) | |
download | jgit-7ac182f4e427e0d5a986b8ca67a56fc22828b1a0.tar.gz jgit-7ac182f4e427e0d5a986b8ca67a56fc22828b1a0.zip |
Enable and fix 'Should be tagged with @Override' warning
Set missingOverrideAnnotation=warning in Eclipse compiler preferences
which enables the warning:
The method <method> of type <type> should be tagged with @Override
since it actually overrides a superclass method
Justification for this warning is described in:
http://stackoverflow.com/a/94411/381622
Enabling this causes in excess of 1000 warnings across the entire
code-base. They are very easy to fix automatically with Eclipse's
"Quick Fix" tool.
Fix all of them except 2 which cause compilation failure when the
project is built with mvn; add TODO comments on those for further
investigation.
Change-Id: I5772061041fd361fe93137fd8b0ad356e748a29c
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse/jgit')
6 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java index 2673cc887d..99ba3b4b48 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/CommandCatalog.java @@ -110,6 +110,7 @@ public class CommandCatalog { private static CommandRef[] toSortedArray(final Collection<CommandRef> c) { final CommandRef[] r = c.toArray(new CommandRef[c.size()]); Arrays.sort(r, new Comparator<CommandRef>() { + @Override public int compare(final CommandRef o1, final CommandRef o2) { return o1.getName().compareTo(o2.getName()); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java index f07c3ca8b5..7b715751da 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Glog.java @@ -88,6 +88,7 @@ class Glog extends RevWalkTextBuiltin { final JButton repaint = new JButton(); repaint.setText(CLIText.get().repaint); repaint.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { graphPane.repaint(); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java index 6262ad2469..f35d4fdba8 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/LsRemote.java @@ -76,6 +76,7 @@ class LsRemote extends TextBuiltin { .setTimeout(timeout).setHeads(heads).setTags(tags); TreeSet<Ref> refs = new TreeSet<Ref>(new Comparator<Ref>() { + @Override public int compare(Ref r1, Ref r2) { return r1.getName().compareTo(r2.getName()); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java index 05d094f0de..f8dd461877 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/DiffAlgorithms.java @@ -84,12 +84,14 @@ import org.kohsuke.args4j.Option; class DiffAlgorithms extends TextBuiltin { final Algorithm myers = new Algorithm() { + @Override DiffAlgorithm create() { return MyersDiff.INSTANCE; } }; final Algorithm histogram = new Algorithm() { + @Override DiffAlgorithm create() { HistogramDiff d = new HistogramDiff(); d.setFallbackAlgorithm(null); @@ -98,6 +100,7 @@ class DiffAlgorithms extends TextBuiltin { }; final Algorithm histogram_myers = new Algorithm() { + @Override DiffAlgorithm create() { HistogramDiff d = new HistogramDiff(); d.setFallbackAlgorithm(MyersDiff.INSTANCE); @@ -234,6 +237,7 @@ class DiffAlgorithms extends TextBuiltin { } Collections.sort(all, new Comparator<Test>() { + @Override public int compare(Test a, Test b) { int result = Long.signum(a.runningTimeNanos - b.runningTimeNanos); if (result == 0) { diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java index 52b6d190dd..6817325c54 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/LfsStore.java @@ -219,6 +219,7 @@ class LfsStore extends TextBuiltin { return false; } + @Override protected void run() throws Exception { AppServer server = new AppServer(port); URI baseURI = server.getURI(); diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java index aa258073b6..415c7d320f 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/debug/ShowCommands.java @@ -85,6 +85,7 @@ class ShowCommands extends TextBuiltin { static enum Format { /** */ USAGE { + @Override void print(ThrowingPrintWriter err, final CommandRef c) throws IOException { String usage = c.getUsage(); if (usage != null && usage.length() > 0) @@ -94,6 +95,7 @@ class ShowCommands extends TextBuiltin { /** */ CLASSES { + @Override void print(ThrowingPrintWriter err, final CommandRef c) throws IOException { err.print(c.getImplementationClassName()); } @@ -101,6 +103,7 @@ class ShowCommands extends TextBuiltin { /** */ URLS { + @Override void print(ThrowingPrintWriter err, final CommandRef c) throws IOException { final ClassLoader ldr = c.getImplementationClassLoader(); |