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.
This commit is contained in:
Rory Hunter 2020-04-03 16:53:46 +01:00 committed by Rory Hunter
parent 8e255337f8
commit 83e900e248
4 changed files with 6 additions and 12 deletions

View File

@ -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"/>

View File

@ -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("");

View File

@ -123,9 +123,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);

View File

@ -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";