palantir / palantir/palantir-java-format

extra indent in comments within switch - jdk 11

Open
#1,320 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
907
Forks
101
Avg merge
1d 3h
Merged PRs (30d)
19

Description

There was an simmilar issue:

  • #1123

was fixed by:

  • #1211 - 2.57.0

But issue still exist if we use JDK 11 as runtime.

When I have a build in matrix for many JDKs, one build will fail.

So code:

 switch (handling) {
                    // comments
                case expand:
...
}

is ok if I use JDK 11 but fail if use JDK 17+

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the switch snippet with comments under JDK 11 and JDK 17 or later, then compare the formatter output and failure. Trace the formatter path handling comments inside switch statements; done means the same valid formatting is produced across the affected JDK versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.