From 3dff2ba4c76c62ffa117efce36ad0db1ac23abd7 Mon Sep 17 00:00:00 2001 From: mmuller Date: Mon, 2 Apr 2018 13:29:00 -0700 Subject: [PATCH] Inline calls to get command from jcommander ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=191338771 --- java/google/registry/tools/RegistryCli.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/java/google/registry/tools/RegistryCli.java b/java/google/registry/tools/RegistryCli.java index c598af4da..ab472529a 100644 --- a/java/google/registry/tools/RegistryCli.java +++ b/java/google/registry/tools/RegistryCli.java @@ -131,8 +131,10 @@ final class RegistryCli implements AutoCloseable, CommandRunner { // JCommander stores sub-commands as nested JCommander objects containing a list of user objects // to be populated. Extract the subcommand by getting the JCommander wrapper and then // retrieving the first (and, by virtue of our usage, only) object from it. - JCommander jcCommand = jcommander.getCommands().get(jcommander.getParsedCommand()); - Command command = (Command) Iterables.getOnlyElement(jcCommand.getObjects()); + Command command = + (Command) + Iterables.getOnlyElement( + jcommander.getCommands().get(jcommander.getParsedCommand()).getObjects()); loggingParams.configureLogging(); // Must be called after parameters are parsed. try {