Title: Bring over upstream PRs #1707 (Java 25 syntax) and #1786 (JDK 27 end positions) · Issue #22 · openjavaformat/open-java-format · GitHub
Open Graph Title: Bring over upstream PRs #1707 (Java 25 syntax) and #1786 (JDK 27 end positions) · Issue #22 · openjavaformat/open-java-format
X Title: Bring over upstream PRs #1707 (Java 25 syntax) and #1786 (JDK 27 end positions) · Issue #22 · openjavaformat/open-java-format
Description: 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-ja...
Open Graph Description: 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 ...
X Description: 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 ...
Opengraph URL: https://github.com/openjavaformat/open-java-format/issues/22
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bring over upstream PRs #1707 (Java 25 syntax) and #1786 (JDK 27 end positions)","articleBody":"### What\n\nTwo 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.\n\n| Upstream PR | Author | What it fixes | Size | State upstream |\n| --- | --- | --- | --- | --- |\n| [palantir/palantir-java-format#1707](https://github.com/palantir/palantir-java-format/pull/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 |\n| [palantir/palantir-java-format#1786](https://github.com/palantir/palantir-java-format/pull/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 |\n\nChecked here: `open-java-format` has no handling of `JCModuleImport`, `IMPLICIT_CLASS` or `ANY_PATTERN`, and `Trees.getEndPosition` still reads `endPositions` directly.\n\n### Why here\n\nA 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.\n\n### To decide first\n\n- **The compatibility promise.** The 2.x line promises output identical to the upstream release with the same version number. By their descriptions neither PR changes the output of a file that formats today: #1786 reports identical output on JDK 26 and 27, and #1707 turns errors into output. That has to be shown, not assumed, in particular for the `ImportOrderer` rewrite in #1707, which stops re-synthesising import declarations.\n- **The version number.** So far the fourth number counts rebuilds of an upstream version. A release that carries patches upstream does not have needs a stated rule.\n- **The next upstream sync.** If upstream merges either PR, the carried commits are dropped in favour of upstream's.\n\n### How\n\n- Keep the authorship: cherry-pick with the original authors, or squash with `Co-authored-by`, and name the upstream PR in the commit message.\n- Rewrite the paths while applying. Upstream's modules are `palantir-java-format/…` and `palantir-java-format-native/…`, here they are `open-java-format/…` and `open-java-format-native/…`. The Java packages are the same, so the code itself should apply cleanly.\n- Leave out what only exists upstream: `changelog/@unreleased/*.yml` and the `gradle/jdks/25/**` files. The README changes of #1707 need rewording for this README.\n- #1707 registers `ImportTree#isModule` in the native image's `reachability-metadata.json`. Carry that over to `open-java-format-native`.\n- #1707 adds test data that only a JDK 25 parser accepts, and wires a JDK 25 test run into `build.gradle`. CI tests on JDK 21 today, so that needs a toolchain or a matrix entry.\n\n### Done when\n\n- both changes are on `main` with their authors credited;\n- 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;\n- the new test data passes on JDK 25, and the formatter runs on a JDK 27 early-access build;\n- the native binary formats a file with `import module`.\n","author":{"url":"https://github.com/abashev","@type":"Person","name":"abashev"},"datePublished":"2026-09-21T08:24:12Z","url":"https://github.com/openjavaformat/open-java-format/issues/22"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cb9fcfff-511a-efe9-41d6-03d23a9893a6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A47A:1B697E:910EE:C8479:6AFBB791 |
| html-safe-nonce | a4d0bb2e1eca4b9ad492e2ceee9d55722e685ee7858c6e29a0fab81b0d7ea050 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDdBOjFCNjk3RTo5MTBFRTpDODQ3OTo2QUZCQjc5MSIsInZpc2l0b3JfaWQiOiIzODM4MDg2MTMxNTkzNDkyMzY5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e4ce2ca5f3cdcaf6cb58ea8e2e3ba8afc9231aaf1d1f3850b46d712b810c851a |
| hovercard-subject-tag | issue:5524527655 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openjavaformat/open-java-format/22/issue_layout |
| twitter:image | https://opengraph.githubassets.com/55ff24d524cc024301d4b7c4aa28a9768e5d727a4b7d33ad906f0477003238f1/openjavaformat/open-java-format/issues/22 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/55ff24d524cc024301d4b7c4aa28a9768e5d727a4b7d33ad906f0477003238f1/openjavaformat/open-java-format/issues/22 |
| og:image:alt | 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 ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | abashev |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c |
| turbo-cache-control | no-preview |
| go-import | github.com/openjavaformat/open-java-format git https://github.com/openjavaformat/open-java-format.git |
| octolytics-dimension-user_id | 325177626 |
| octolytics-dimension-user_login | openjavaformat |
| octolytics-dimension-repository_id | 1288055459 |
| octolytics-dimension-repository_nwo | openjavaformat/open-java-format |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 214273098 |
| octolytics-dimension-repository_parent_nwo | palantir/palantir-java-format |
| octolytics-dimension-repository_network_root_id | 214273098 |
| octolytics-dimension-repository_network_root_nwo | palantir/palantir-java-format |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e4cce0e99cf61481a318ff12c2e8580153a6c7c6 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width