From ab86660c654b07c101666c0e9d96fb91a0d85277 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 6 Sep 2016 07:39:23 -0400 Subject: [PATCH] Add finals to RemovePluginCommand This commit marks the RemovePluginCommand class as final, and marks some local variables as final too. --- .../org/elasticsearch/plugins/RemovePluginCommand.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java b/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java index 3a500b6c7ba..808a30b5d4d 100644 --- a/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java +++ b/core/src/main/java/org/elasticsearch/plugins/RemovePluginCommand.java @@ -43,7 +43,7 @@ import static org.elasticsearch.cli.Terminal.Verbosity.VERBOSE; /** * A command for the plugin cli to remove a plugin from elasticsearch. */ -class RemovePluginCommand extends SettingCommand { +final class RemovePluginCommand extends SettingCommand { private final OptionSpec arguments; @@ -64,16 +64,16 @@ class RemovePluginCommand extends SettingCommand { terminal.println("-> Removing " + Strings.coalesceToEmpty(pluginName) + "..."); - Path pluginDir = env.pluginsFile().resolve(pluginName); + final Path pluginDir = env.pluginsFile().resolve(pluginName); if (Files.exists(pluginDir) == false) { throw new UserException( ExitCodes.USAGE, "plugin " + pluginName + " not found; run 'elasticsearch-plugin list' to get list of installed plugins"); } - List pluginPaths = new ArrayList<>(); + final List pluginPaths = new ArrayList<>(); - Path pluginBinDir = env.binFile().resolve(pluginName); + final Path pluginBinDir = env.binFile().resolve(pluginName); if (Files.exists(pluginBinDir)) { if (Files.isDirectory(pluginBinDir) == false) { throw new UserException(ExitCodes.IO_ERROR, "Bin dir for " + pluginName + " is not a directory"); @@ -83,7 +83,7 @@ class RemovePluginCommand extends SettingCommand { } terminal.println(VERBOSE, "Removing: " + pluginDir); - Path tmpPluginDir = env.pluginsFile().resolve(".removing-" + pluginName); + final Path tmpPluginDir = env.pluginsFile().resolve(".removing-" + pluginName); Files.move(pluginDir, tmpPluginDir, StandardCopyOption.ATOMIC_MOVE); pluginPaths.add(tmpPluginDir);