Skip to content

Bring over upstream PRs #1707 (Java 25 syntax) and #1786 (JDK 27 end positions) #22

Description

@abashev

What

Two pull requests are open against palantir-java-format and not merged. Both stop the formatter from crashing on newer Java, and this fork has neither change.

Upstream PR Author What it fixes Size State upstream
palantir/palantir-java-format#1707 asm0dey The formatter fails on import module …; (JEP 511), on compact source files with an instance main (JEP 512) and on unnamed patterns such as case Box(_, _) (JEP 456) +981 −67, 40 files Open since 2026-07-03. Reviewed in depth by a community member, several +1s, no maintainer response
palantir/palantir-java-format#1786 slachiewicz NoSuchFieldError on JDK 27, where JDK-8372948 removed EndPosTable and JCCompilationUnit.endPositions, plus the re-ordered ParserFactory.newParser flags +87 −6, 5 files Open since 2026-09-15. Waiting on the CLA, whose signing page returns an error for the author

Checked here: open-java-format has no handling of JCModuleImport, IMPLICIT_CLASS or ANY_PATTERN, and Trees.getEndPosition still reads endPositions directly.

Why here

A fix that waits for months because nobody upstream picks it up is the case manifesto principle 6 describes. People on Java 25 cannot format these files today, and JDK 27 will break every user at once.

To decide first

How

Done when

  • both changes are on main with their authors credited;
  • a corpus formatted by the 2.98.0.1 jar and by the new build gives identical output, through the equivalence gate if it exists by then;
  • the new test data passes on JDK 25, and the formatter runs on a JDK 27 early-access build;
  • the native binary formats a file with import module.

Activity

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 request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions