Consistent formatting of multivariable try-with-resource blocks.
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
Research direction
No file or test is named in the issue. Start by reproducing the shown Java input and comparing the current formatter output with the requested multiline try-with-resources layout; done means consistent alignment with multiline parameters or code blocks without changing unrelated formatting.
Written by the indexing model from the issue text.
Description
The current formatting of try-with-resource blocks that manage multiple variables is strange, as it results in inconsistent alignment and doesn't match how multiline parameters or code blocks are formatted.
Current output:
try (var input = Files.newInputStream(Path.of("./input"));
var output = Files.newOutputStream(Path.of("./output")); ) {
output.write(input.read());
} catch (IOException _) {
}
How I think it should be formatted:
try (
var input = Files.newInputStream(Path.of("./input"));
var output = Files.newOutputStream(Path.of("./output"));
) {
output.write(input.read());
} catch (IOException _) {
}
- Dominant language
- Java
- Stars
- 6.2k
- Forks
- 936
- Avg merge
- 6m
- Merged PRs (30d)
- 2
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/google-java-format
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
google/google-java-format#1094 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
google/google-java-format#1439 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
google/google-java-format#1436 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
google/google-java-format#1428 · 4 comments ·
-
Eclipse
Difficulty 3/5 1-2 days Newbie friendliness 55/100
google/google-java-format#1417 ·
All issues in google/google-java-format
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
feature triaged
Difficulty 1/5 Under an hour Newbie friendliness 75/100
Graylog2/graylog2-server#27549 ·
Maintainers usually reply within 1 day
-
component/zeebe kind/bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
UniversalMediaServer/UniversalMediaServer#6356 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
googleapis/google-cloud-java#14533 ·
Maintainers usually reply within 1 day