From a67ee815ccb28cefabe564bdc152e558dbc9db4f Mon Sep 17 00:00:00 2001 From: David Ostrovsky Date: Thu, 6 Apr 2017 23:46:01 +0200 Subject: [PATCH] Fix compiler warnings introduced in recent commits Change-Id: I30dd5a617bafc10406fc9699d7447e4acc423aa0 --- .../gerrit/extensions/annotations/Exports.java | 2 +- .../com/google/gerrit/util/cli/CmdLineParser.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/annotations/Exports.java b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/annotations/Exports.java index 6d0f2ba591..1295ea0efa 100644 --- a/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/annotations/Exports.java +++ b/gerrit-extension-api/src/main/java/com/google/gerrit/extensions/annotations/Exports.java @@ -22,7 +22,7 @@ public final class Exports { } /** Create an annotation to export based on a cannonical class name. */ - public static Export named(Class clazz) { + public static Export named(Class clazz) { return named(clazz.getCanonicalName()); } diff --git a/gerrit-util-cli/src/main/java/com/google/gerrit/util/cli/CmdLineParser.java b/gerrit-util-cli/src/main/java/com/google/gerrit/util/cli/CmdLineParser.java index fcc0451a2c..8aa5b9e2ea 100644 --- a/gerrit-util-cli/src/main/java/com/google/gerrit/util/cli/CmdLineParser.java +++ b/gerrit-util-cli/src/main/java/com/google/gerrit/util/cli/CmdLineParser.java @@ -330,10 +330,12 @@ public class CmdLineParser { this.o = o; } + @Override public String name() { return getPrefixedName(prefix, o.name()); } + @Override public String[] aliases() { String[] prefixedAliases = new String[o.aliases().length]; for (int i = 0; i < prefixedAliases.length; i++) { @@ -342,30 +344,38 @@ public class CmdLineParser { return prefixedAliases; } + @Override public String usage() { return o.usage(); } + @Override public String metaVar() { return o.metaVar(); } + @Override public boolean required() { return o.required(); } + @Override public boolean hidden() { return o.hidden(); } + @SuppressWarnings("rawtypes") + @Override public Class handler() { return o.handler(); } + @Override public String[] depends() { return o.depends(); } + @Override public Class annotationType() { return o.annotationType(); } @@ -389,7 +399,7 @@ public class CmdLineParser { // NOTE: Argument annotations on bean are ignored. public void parseWithPrefix(String prefix, Object bean) { // recursively process all the methods/fields. - for (Class c = bean.getClass(); c != null; c = c.getSuperclass()) { + for (Class c = bean.getClass(); c != null; c = c.getSuperclass()) { for (Method m : c.getDeclaredMethods()) { Option o = m.getAnnotation(Option.class); if (o != null) {