From 83e900e24839189babda1bbcc56eae47ee4ff7ce Mon Sep 17 00:00:00 2001 From: Rory Hunter Date: Fri, 3 Apr 2020 16:53:46 +0100 Subject: [PATCH] Tweak formatting config for exception lists (#54710) Change how we format exceptions to only wrap them as necessary. While the config's overall philosophy is to put items one-per-line when wrapping, in practice this is a little cumbersome for exception lists. --- buildSrc/formatterConfig.xml | 4 ++-- .../gradle/precommit/DependencyLicensesTask.java | 3 +-- .../elasticsearch/tools/launchers/JvmOptionsParser.java | 4 +--- .../org/elasticsearch/plugins/InstallPluginCommand.java | 7 ++----- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/buildSrc/formatterConfig.xml b/buildSrc/formatterConfig.xml index 19ac64cbb45..b1d4729a483 100644 --- a/buildSrc/formatterConfig.xml +++ b/buildSrc/formatterConfig.xml @@ -47,7 +47,7 @@ - + @@ -132,7 +132,7 @@ - + diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java index e6d147b8ee6..c5a6fe10feb 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java @@ -210,8 +210,7 @@ public class DependencyLicensesTask extends DefaultTask { } private void checkDependencies(Map licenses, Map notices, Set shaFiles) - throws NoSuchAlgorithmException, - IOException { + throws NoSuchAlgorithmException, IOException { for (File dependency : dependencies) { String jarName = dependency.getName(); String depName = regex.matcher(jarName).replaceFirst(""); diff --git a/distribution/tools/launchers/src/main/java/org/elasticsearch/tools/launchers/JvmOptionsParser.java b/distribution/tools/launchers/src/main/java/org/elasticsearch/tools/launchers/JvmOptionsParser.java index d59fe5fd0a2..74e98255469 100644 --- a/distribution/tools/launchers/src/main/java/org/elasticsearch/tools/launchers/JvmOptionsParser.java +++ b/distribution/tools/launchers/src/main/java/org/elasticsearch/tools/launchers/JvmOptionsParser.java @@ -123,9 +123,7 @@ final class JvmOptionsParser { } private List jvmOptions(final Path config, final String esJavaOpts, final Map substitutions) - throws InterruptedException, - IOException, - JvmOptionsFileParserException { + throws InterruptedException, IOException, JvmOptionsFileParserException { final List jvmOptions = readJvmOptionsFiles(config); diff --git a/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java b/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java index 0aef8294b8b..1f09cafb55e 100644 --- a/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java +++ b/distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java @@ -346,8 +346,7 @@ class InstallPluginCommand extends EnvironmentAwareCommand { final boolean isSnapshot, final String pluginId, final String platform - ) throws IOException, - UserException { + ) throws IOException, UserException { final String baseUrl; if (isSnapshot && stagingHash == null) { throw new UserException( @@ -522,9 +521,7 @@ class InstallPluginCommand extends EnvironmentAwareCommand { final Path tmpDir, final boolean officialPlugin, boolean isBatch - ) throws IOException, - PGPException, - UserException { + ) throws IOException, PGPException, UserException { Path zip = downloadZip(terminal, urlString, tmpDir, isBatch); pathsToDeleteOnShutdown.add(zip); String checksumUrlString = urlString + ".sha512";