René's URL Explorer Experiment


Title: Bring over upstream PR #1731: keep a map factory's key and value on one line · Issue #31 · openjavaformat/open-java-format · GitHub

Open Graph Title: Bring over upstream PR #1731: keep a map factory's key and value on one line · Issue #31 · openjavaformat/open-java-format

X Title: Bring over upstream PR #1731: keep a map factory's key and value on one line · Issue #31 · openjavaformat/open-java-format

Description: A modern, lambda-friendly, 120 character Java formatter. - Bring over upstream PR #1731: keep a map factory's key and value on one line · Issue #31 · openjavaformat/open-java-format

Open Graph Description: A modern, lambda-friendly, 120 character Java formatter. - Bring over upstream PR #1731: keep a map factory's key and value on one line · Issue #31 · openjavaformat/open-java-format

X Description: A modern, lambda-friendly, 120 character Java formatter. - Bring over upstream PR #1731: keep a map factory's key and value on one line · Issue #31 · openjavaformat/open-java-format

Opengraph URL: https://github.com/openjavaformat/open-java-format

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bring over upstream PR #1731: keep a map factory's key and value on one line","articleBody":"### What\n\n[palantir/palantir-java-format#1731](https://github.com/palantir/palantir-java-format/pull/1731) by @ranpy13 keeps the key and the value of a `Map.of`-style call together when the call has to break. Today every argument goes on a line of its own. It closes upstream [#1602](https://github.com/palantir/palantir-java-format/issues/1602), is 3 files and +101 −5, and has been open since 2026-08-01 with no review and an unsigned CLA — where #1707 and #1786 were.\n\nMeasured here, with a jar built from the PR on top of 2.98.0.2:\n\n``` java\n// today\nstatic final Map\u003cString, String> plain = ImmutableMap.of(\n        \"first key\",\n        \"the first value\",\n        \"second key\",\n        \"the second value\");\n\n// with #1731\nstatic final Map\u003cString, String> plain = ImmutableMap.of(\n        \"first key\", \"the first value\",\n        \"second key\", \"the second value\");\n```\n\nIt applies to a call named `of` with an even number of arguments whose receiver's simple name is one of `Map`, `ImmutableMap`, `ImmutableSortedMap`, `ImmutableBiMap`, `SortedMap`, `NavigableMap`, `ConcurrentMap`. A call that fits on one line is unaffected, and so is one the existing tabular heuristic already lays out in pairs.\n\n### Why not in 2.x\n\nIt changes the output, which the 2.x line promises to keep identical to palantir-java-format 2.98.0. A file that is formatted today would fail a format check after the upgrade, which the PR says itself.\n\nHow much: of the 15,747 files of the JDK 21 sources, 54 contain such a call and **6 come out differently**. The formatter's error output over that corpus is unchanged.\n\n### To decide first\n\n- **Do we want this style at all?** One line per pair is easier to read in a long map, and it is what upstream #1602 asked for. Under the manifesto it is decided once for everyone: no option, no flag.\n- **Which release**, and what its number is — the same version-number question #22 raises for carried patches.\n- **Whether to wait for upstream.** If palantir merges it, take theirs at the next sync.\n\n### What the PR still needs\n\nFound while applying it here:\n\n- **Its test does not test it.** `MapOf.input` formatted with 2.98.0.2 already gives exactly `MapOf.output`, so the golden passes without the change. It needs a case that fails today, such as the long call above, whose arguments the tabular heuristic does not recognise.\n- **Only `of`, and only with a receiver.** `Map.ofEntries`, `ImmutableMap.builder()`, a statically imported `of(…)` and `Maps.immutableEntry` are untouched.\n- `SortedMap`, `NavigableMap` and `ConcurrentMap` have no static `of` in the JDK, so those three entries can only ever match a type of your own with that simple name. Matching a receiver by simple name is all a formatter that does not resolve types can do, but that deserves a comment.\n- **The patch is not formatted by this formatter:** `MAP_FACTORY_TYPES =ImmutableSet.of(`. `--dry-run --set-exit-if-changed` exits 1 on the file.\n\n### How\n\n- Cherry-pick with the original author, as in #22: this fork shares history with upstream, so rename detection maps `palantir-java-format/` to `open-java-format/` on its own. Tried here — the visitor hunks apply cleanly, and only the two new testdata files arrive as \"added in a renamed directory\".\n- The `palantir-8` golden here contains such a call; check whether its expected output moves.\n- The [Style page](https://openjavaformat.dev/style/) describes the output, so it changes with this.\n\n### Done when\n\n- a test fails without the change and passes with it;\n- a corpus run shows only map factory calls moving, and the release notes say so;\n- the Style page shows the new layout;\n- it ships in a release that is allowed to change the output.","author":{"url":"https://github.com/abashev","@type":"Person","name":"abashev"},"datePublished":"2026-09-22T17:09:43Z","url":"https://github.com/openjavaformat/open-java-format/issues/31"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:386a4b2d-e01a-25f6-a498-63278c14ee89
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8B24:89D99:138B06:1B0B4B:6AFBBB5C
html-safe-noncea068ea5c7e1bbffd0e3a751739175ddc39dcb1787bc0417bab3e008b0da088ae
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjI0Ojg5RDk5OjEzOEIwNjoxQjBCNEI6NkFGQkJCNUMiLCJ2aXNpdG9yX2lkIjoiODk5MTM1NTI2NzE4Mzg5MDg0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac342ab64f227acc415eb2442ad98d22b604aadafafd68fff32c9a132e04527a47
hovercard-subject-tagrepository:1288055459
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/openjavaformat/open-java-format/issues/31
twitter:imagehttps://opengraph.githubassets.com/d68ef11eccab927066826db7c01d5e5330c9474f93b01c7830ce5a188e5db2ee/openjavaformat/open-java-format
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d68ef11eccab927066826db7c01d5e5330c9474f93b01c7830ce5a188e5db2ee/openjavaformat/open-java-format
og:image:altA modern, lambda-friendly, 120 character Java formatter. - Bring over upstream PR #1731: keep a map factory's key and value on one line · Issue #31 · openjavaformat/open-java-format
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
turbo-cache-controlno-cache
go-importgithub.com/openjavaformat/open-java-format git https://github.com/openjavaformat/open-java-format.git
octolytics-dimension-user_id325177626
octolytics-dimension-user_loginopenjavaformat
octolytics-dimension-repository_id1288055459
octolytics-dimension-repository_nwoopenjavaformat/open-java-format
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id214273098
octolytics-dimension-repository_parent_nwopalantir/palantir-java-format
octolytics-dimension-repository_network_root_id214273098
octolytics-dimension-repository_network_root_nwopalantir/palantir-java-format
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee4cce0e99cf61481a318ff12c2e8580153a6c7c6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/openjavaformat/open-java-format/issues/31#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fissues%2F31
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fissues%2F31
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=openjavaformat%2Fopen-java-format
Reloadhttps://github.com/openjavaformat/open-java-format/issues/31
Reloadhttps://github.com/openjavaformat/open-java-format/issues/31
Reloadhttps://github.com/openjavaformat/open-java-format/issues/31
https://github.com/openjavaformat/open-java-format
New issuehttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/31
New issuehttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/31
Bring over upstream PR #1731: keep a map factory's key and value on one linehttps://github.com/openjavaformat/open-java-format/issues/31#top
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com/abashev
abashevhttps://github.com/abashev
on Sep 22, 2026https://github.com/openjavaformat/open-java-format/issues/31#issue-5542762234
palantir/palantir-java-format#1731https://github.com/palantir/palantir-java-format/pull/1731
@ranpy13https://github.com/ranpy13
#1602https://github.com/palantir/palantir-java-format/issues/1602
palantir#1707https://github.com/palantir/palantir-java-format/pull/1707
palantir#1786https://github.com/palantir/palantir-java-format/pull/1786
Make Map.of() and ImmutableMap.of() more readable palantir/palantir-java-format#1602https://github.com/palantir/palantir-java-format/issues/1602
Bring over upstream PRs #1707 (Java 25 syntax) and #1786 (JDK 27 end positions) #22https://github.com/openjavaformat/open-java-format/issues/22
Bring over upstream PRs #1707 (Java 25 syntax) and #1786 (JDK 27 end positions) #22https://github.com/openjavaformat/open-java-format/issues/22
Style pagehttps://openjavaformat.dev/style/
abashevhttps://github.com/abashev
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
on Sep 22, 2026https://github.com/openjavaformat/open-java-format/issues/31#event-31617556069
Sign up for freehttps://github.com/signup?return_to=https://github.com/openjavaformat/open-java-format/issues/31
Sign in to commenthttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/31
enhancementNew feature or requesthttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22enhancement%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.