Title: Recognize the `value` modifier (Project Valhalla value classes and records) · Issue #131 · openjavaformat/open-java-format · GitHub
Open Graph Title: Recognize the `value` modifier (Project Valhalla value classes and records) · Issue #131 · openjavaformat/open-java-format
X Title: Recognize the `value` modifier (Project Valhalla value classes and records) · Issue #131 · openjavaformat/open-java-format
Description: Upstream: google/google-java-format@1959806 Kind: port | Priority: medium Upstream landed support for the contextual modifier value on classes and records, in the AST visitor and in the modifier orderer, so value classes format correctly...
Open Graph Description: Upstream: google/google-java-format@1959806 Kind: port | Priority: medium Upstream landed support for the contextual modifier value on classes and records, in the AST visitor and in the modifier or...
X Description: Upstream: google/google-java-format@1959806 Kind: port | Priority: medium Upstream landed support for the contextual modifier value on classes and records, in the AST visitor and in the modifier or...
Opengraph URL: https://github.com/openjavaformat/open-java-format/issues/131
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Recognize the `value` modifier (Project Valhalla value classes and records)","articleBody":"**Upstream:** https://github.com/google/google-java-format/commit/1959806b3ccb44f851d42e9ef3cc0d79d2e81123 \n**Kind:** port | **Priority:** medium\n\nUpstream landed support for the contextual modifier `value` on classes and records, in the AST visitor and in the modifier orderer, so value classes format correctly on JDKs that accept them. The first attempt ([google-java-format#1479](https://github.com/google/google-java-format/issues/1479), 5f7a569) was rolled back the same day ([google-java-format#1481](https://github.com/google/google-java-format/issues/1481), because of an internal Google test failure, not a design problem) and re-landed the next day (1959806, +92/-20 lines instead of +52/-2, same four files), so the commit that stuck is the one to read, not the first.\n\nWhy it matters: our modifier lists know `sealed` and `non-sealed` but not `value`, so on a Valhalla-enabled JDK the modifier would likely be treated as an ordinary identifier, mis-ordered, or break the line oddly. This is new-syntax support, relevant once we run tests on JDK 27 early-access builds (see our #29, #30).\n\nAffected files in our repo:\n- open-java-format/src/main/java/com/palantir/javaformat/java/JavaInputAstVisitor.java (`nextIsModifier`, modifier handling for class and record declarations)\n- open-java-format/src/main/java/com/palantir/javaformat/java/ModifierOrderer.java (the token-to-modifier mapping)\n\nSuggested action: port. Add `value` to both places, with tests for `value class` and `value record` that are skipped when the running JDK cannot parse them. Check that a field or variable named `value` is not affected.\n\n---\n_Filed from an upstream-watch ticket after manual review._","author":{"url":"https://github.com/abashev","@type":"Person","name":"abashev"},"datePublished":"2026-10-16T21:08:20Z","url":"https://github.com/openjavaformat/open-java-format/issues/131"}
| 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:5d6ac323-d6e3-08eb-496c-2b637570832f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D758:1B1794:2CB250:3B0D90:6AFBB794 |
| html-safe-nonce | 63e8246f8271db8816a332d9ef067fb43de4fe08e8e11fa3c638dfbaf0ae9bf1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzU4OjFCMTc5NDoyQ0IyNTA6M0IwRDkwOjZBRkJCNzk0IiwidmlzaXRvcl9pZCI6IjY0OTg4OTY2MzQzNTk1NjAwODQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 8a6f495e6299564a57792f9b413223ecc20c59563bd4eaaa551fe6ad7f709e04 |
| hovercard-subject-tag | issue:5891216799 |
| 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/131/issue_layout |
| twitter:image | https://opengraph.githubassets.com/edc9dd568146e8972c51eddbe99d48fd2d7544c2bd3cff7c78e5adebed23a8ec/openjavaformat/open-java-format/issues/131 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/edc9dd568146e8972c51eddbe99d48fd2d7544c2bd3cff7c78e5adebed23a8ec/openjavaformat/open-java-format/issues/131 |
| og:image:alt | Upstream: google/google-java-format@1959806 Kind: port | Priority: medium Upstream landed support for the contextual modifier value on classes and records, in the AST visitor and in the modifier or... |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width