GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Multi-resource try-with-resources: break after `(` and drop the stray `; )` · Issue #130 · openjavaformat/open-java-format

Multi-resource try-with-resources: break after ( and drop the stray ; ) #130

New issue
Copy link
New issue
Copy link
Open
Open
Multi-resource try-with-resources: break after ( and drop the stray ; )#130
Copy link
Labels
enhancementNew feature or requestNew feature or request

Description

@abashev
abashev
opened on Oct 16, 2026
Issue body actions

Upstream: google/google-java-format#1454
Kind: idea | Priority: low

Open PR google-java-format#1454 (fixes gjf issue google-java-format#1392): with two or more resources the first resource stays
glued to try (, and a trailing ; in the source yields ...; ) {. The PR forces a break
after ( for multi-resource statements, puts each resource on its own line, and closes
the indent before ) so it renders at the try indentation. Single-resource try is
unchanged. Golden files B21465217/B26159561/TryWithResources change.

Why it matters to us: our visitTry is the same pre-fix code (same plusFour open, same
handling of a trailing ; followed by builder.space() before )), so we produce the
same ; ) artifact. The layout part is a style decision; the trailing-semicolon part is a
plain wart.

Affected files in our repo:

  • open-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java (visitTry, around line 1931-1974)
  • try-with-resources test data under open-java-format/src/test/resources/com/palantir/javaformat/java/testdata/

Suggested action: investigate. At minimum consider dropping the trailing ; / space before
); adopt the full layout change only if it matches what we want for PALANTIR style
(it changes existing output, see README note on output changes). Watch upstream review.


Filed from an upstream-watch ticket after manual review.

Activity

  1. abashev
    added
    enhancementNew feature or requestNew feature or request
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.