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);