Merge "CmdLineParser: Remove unused prefix argument"

This commit is contained in:
David Pursehouse 2017-09-05 10:02:54 +00:00 committed by Gerrit Code Review
commit 96ff91165c

View File

@ -395,7 +395,7 @@ public class CmdLineParser {
MyParser(Object bean) {
super(bean);
parseAdditionalOptions("", bean, new HashSet<>());
parseAdditionalOptions(bean, new HashSet<>());
ensureOptionsInitialized();
}
@ -433,7 +433,7 @@ public class CmdLineParser {
}
}
private void parseAdditionalOptions(String prefix, Object bean, Set<Object> parsedBeans) {
private void parseAdditionalOptions(Object bean, Set<Object> parsedBeans) {
for (Class<?> c = bean.getClass(); c != null; c = c.getSuperclass()) {
for (Field f : c.getDeclaredFields()) {
if (f.isAnnotationPresent(Options.class)) {
@ -443,8 +443,7 @@ public class CmdLineParser {
} catch (IllegalAccessException e) {
throw new IllegalAnnotationError(e);
}
parseWithPrefix(
prefix + f.getAnnotation(Options.class).prefix(), additionalBean, parsedBeans);
parseWithPrefix(f.getAnnotation(Options.class).prefix(), additionalBean, parsedBeans);
}
}
}