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 — Leading comment after an opening delimiter is hoisted out of its group · Issue #171 · openjavaformat/open-java-format

Leading comment after an opening delimiter is hoisted out of its group #171

New issue
Copy link
New issue
Copy link
Closed
#175
Closed
Leading comment after an opening delimiter is hoisted out of its group#171
#175
Copy link
Labels
bugSomething isn't workingSomething isn't working

Description

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

Upstream: google/google-java-format#1501
Kind: bug | Priority: low

google-java-format#1501 (merged 2026-10-29, copybara export; groundwork in google-java-format#1500 and baseline tests in google-java-format#1502) fixes comments placed right after an opening token being pulled out of the indented group, leaving the comment and the next line unindented. Cases covered: assert with a detail message, the semicolon after enum constants, for initializers, multi-resource try headers, multi-catch clauses and explicit type argument lists. After the fix such comments stay indented inside the group, for example in a for ( header the comment, int i = 0;, the condition and the update each get their own continuation-indented line.

Why it matters: it is a correctness-of-layout bug class around comments that our engine may share, since both derive from the same original visitor design.

Affected files in our repo:

  • open-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java
  • open-java-format/src/main/java/com/palantir/javaformat/doc (comment handling in the layout builder)

Suggested action: investigate. Put a comment after for ( and after try ( into our formatter and compare the indentation. Examples: not available - the pre-change output is only in the baseline test PR and I did not run our formatter.


Filed from an upstream-watch ticket after manual review.

Activity

  1. abashev
    added
    bugSomething isn't workingSomething isn't working
    on Oct 30, 2026
  2. abashev
    closed this as completedin #175on 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

    bugSomething isn't workingSomething isn't working

    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.