Skip to content

Review do PR upstream #1454 - #4

Open
caioradtke wants to merge 4 commits into
masterfrom
pr-1454
Open

caioradtke wants to merge 4 commits into
masterfrom
pr-1454

Conversation

@caioradtke

@caioradtke caioradtke commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Cópia de google#1454

Summary by CodeRabbit

  • Formatting
    • Try-with-resources statements containing multiple resources are now formatted across multiple lines, with the closing parenthesis following the resource list. Single-resource statements retain their existing layout.

@caioradtke

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The formatter now places multiple resources in a try-with-resources statement on separate lines, with a separate line for the closing parenthesis. Tests and expected outputs reflect this layout.

Changes: Try-with-resources formatting

Layer / File(s) Summary
Format and verify multiple resources
core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java, core/src/test/java/com/google/googlejavaformat/java/FormatterTest.java, core/src/test/resources/com/google/googlejavaformat/java/testdata/*
visitTry forces breaks before and after the resources list when it contains multiple entries. The test and expected outputs cover the multiline layout. The TryWithResources fixture class name is corrected.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: cushon

Merge Risk: Minimal · up to 1fac4

This changes how try-with-resources statements with several resources are formatted: each resource goes on its own line, and the closing parenthesis goes on a separate line. Single-resource statements keep their layout. No actionable merge-blocking risk is evident.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Inconclusive The title "Review do PR upstream #1454" is generic. It names a review action and an upstream PR number, but not the change itself. The changeset fixes try-with-resources formatting: multi-resource dec… Replace the title with a short description of the main change. For example: "Format multi-resource try-with-resources statements one resource per line". Include the upstream PR reference in the description if needed.
Passed Passed checks: 3 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "Review do PR upstream #1454" is generic. It names a review action and an upstream PR number, but not the change itself. The changeset fixes try-with-resources formatting: multi-resource declarations are split across lines, a closing-parenthesis placement is changed, and a test and test fixtures are added. A reader scanning history cannot tell the primary change from the title. The title is also not in English, which is a separate concern for the team.

Resolution

Replace the title with a short description of the main change. For example: "Format multi-resource try-with-resources statements one resource per line". Include the upstream PR reference in the description if needed.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fdf10a54-8dc5-43bc-84e5-830aca254c73
Commits

Reviewing files that changed from the base of the PR and between 35bf6ff and 1fac4a4.

Files selected for processing: 6

  • core/src/main/java/com/google/googlejavaformat/java/JavaInputAstVisitor.java
  • core/src/test/java/com/google/googlejavaformat/java/FormatterTest.java
  • core/src/test/resources/com/google/googlejavaformat/java/testdata/B21465217.output
  • core/src/test/resources/com/google/googlejavaformat/java/testdata/B26159561.output
  • core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.input
  • core/src/test/resources/com/google/googlejavaformat/java/testdata/TryWithResources.output

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants