Procházet zdrojové kódy

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.
Rory Hunter před 5 roky
rodič
revize
01dc110c72

+ 2 - 2
buildSrc/formatterConfig.xml

@@ -47,7 +47,7 @@
         <setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
         <setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="true"/>
         <setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="80"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
         <setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
         <setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
         <setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
@@ -132,7 +132,7 @@
         <setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="48"/>
         <setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
         <setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="48"/>
-        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="64"/>
+        <setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
         <setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
         <setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
         <setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>

+ 1 - 2
buildSrc/src/main/java/org/elasticsearch/gradle/precommit/DependencyLicensesTask.java

@@ -210,8 +210,7 @@ public class DependencyLicensesTask extends DefaultTask {
     }
 
     private void checkDependencies(Map<String, Boolean> licenses, Map<String, Boolean> notices, Set<File> shaFiles)
-        throws NoSuchAlgorithmException,
-        IOException {
+        throws NoSuchAlgorithmException, IOException {
         for (File dependency : dependencies) {
             String jarName = dependency.getName();
             String depName = regex.matcher(jarName).replaceFirst("");

+ 1 - 3
distribution/tools/launchers/src/main/java/org/elasticsearch/tools/launchers/JvmOptionsParser.java

@@ -124,9 +124,7 @@ final class JvmOptionsParser {
     }
 
     private List<String> jvmOptions(final Path config, final String esJavaOpts, final Map<String, String> substitutions)
-        throws InterruptedException,
-        IOException,
-        JvmOptionsFileParserException {
+        throws InterruptedException, IOException, JvmOptionsFileParserException {
 
         final List<String> jvmOptions = readJvmOptionsFiles(config);
 

+ 2 - 5
distribution/tools/plugin-cli/src/main/java/org/elasticsearch/plugins/InstallPluginCommand.java

@@ -330,8 +330,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(
@@ -506,9 +505,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";