René's URL Explorer Experiment


Title: Keep the rows of a table that follows an operator such as -> or += by abashev · Pull Request #170 · openjavaformat/open-java-format · GitHub

Open Graph Title: Keep the rows of a table that follows an operator such as -> or += by abashev · Pull Request #170 · openjavaformat/open-java-format

X Title: Keep the rows of a table that follows an operator such as -> or += by abashev · Pull Request #170 · openjavaformat/open-java-format

Description: A table of arguments or array elements that the author lays out by hand keeps its rows, but it did not when an operator of more than one character came before it on its line. This stayed a table: return Map.of("one", 1, "two", 2); while this came out as return () -> Map.of("one", 1, "two", 2);, or with one argument per line where that does not fit: return () -> Map.of("one", 1, "two", 2); The same went for an array initializer after mode == 0 ?, where one after mode < 1 ? kept its rows. Why The lexer splits an operator such as ==, -> or += into toks of one character, since >> cannot be told from two > without the parser. For each of those toks it moved the column on by the whole operator, so every tok after == on its line sat two columns too far right, and after >>>= twelve. argumentsAreTabular is the only reader of these columns: it compares the column each row starts at with the first row's, and a first row shifted that way never matched the rows under it. The column now moves on by the tok's own text, a one-word change in JavaInput.buildToks. continueTrailingComment from #169 gave this bug as its reason to read the column of a trailing comment in the text. It still reads it there, together with whether code comes before the comment, and its comment now says only that. Effect Of the 15,747 files of the JDK 21 sources, 4 format differently, each with a call laid out by hand in pairs after += or ->, which now keeps its pairs as it would after =. In sun/awt/geom/Curve.java: - crossings += pointCrossingsForLine(px, py, curx, cury, movx, movy); + crossings += pointCrossingsForLine( + px, py, + curx, cury, + movx, movy); The other three are javax/swing/plaf/basic/BasicTableHeaderUI.java (after +=), com/sun/tools/jdeps/Analyzer.java and jdk/internal/classfile/impl/ClassPrinterImpl.java (after ->). The files that change on a second run are the same 67 as before. The output of these tables changes, so the CLI and the plugins format such files differently. Not in this change The formatter still only keeps a table it finds in the input; it does not make one. A long Map.of(...) written on one line comes out with one argument per line before and after this change, which is what #31 is about (palantir#1731 for palantir#1602). Two other reasons a hand-made table is not kept stay as well, and both reproduce here: pairs whose values are different kinds of expression (palantir#204), and a block of a single row (google/google-java-format#572). Tests The case tablesAfterMultiCharacterOperators, pairs after -> and an array after ==, fails without the fix. FormatterCasesTest 886 → 887. ./gradlew test passes on JDK 21, and the formatter module's 1408 tests on JDK 25 and 27 as well.

Open Graph Description: A table of arguments or array elements that the author lays out by hand keeps its rows, but it did not when an operator of more than one character came before it on its line. This stayed a table: r...

X Description: A table of arguments or array elements that the author lays out by hand keeps its rows, but it did not when an operator of more than one character came before it on its line. This stayed a table: r...

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

X: @github

direct link

Domain: redirect.github.com

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/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:b08d737b-8409-6eab-fdee-0ab4d7a0c278
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9D74:2A6BE9:E0345:137604:6AFBCA13
html-safe-nonce96ced229b9026dbf791459ccf27f2ccc7f936c067dc8e101477666e576ae7750
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDc0OjJBNkJFOTpFMDM0NToxMzc2MDQ6NkFGQkNBMTMiLCJ2aXNpdG9yX2lkIjoiMzA3MDY3MzM4Mzg3Mjc3NjcyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac6adef9e67a3e4d256397b52ac5ee32f76a8af862188a752b8cf5b7df78950c07
hovercard-subject-tagpull_request:5082266982
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/openjavaformat/open-java-format/pull/170/files
twitter:imagehttps://avatars.githubusercontent.com/u/214171?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/214171?s=400&v=4
og:image:altA table of arguments or array elements that the author lays out by hand keeps its rows, but it did not when an operator of more than one character came before it on its line. This stayed a table: r...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Noned440bda0d812801778b27bfe9f7c1ce9ff22420c73f6f95150c4fcbca311c50b
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2c43021aed8695990c86c0eaaedc600bfeffec36
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files#start-of-content
https://redirect.github.com/
Sign inhttps://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fpull%2F170%2Ffiles
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://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fpull%2F170%2Ffiles
Sign uphttps://redirect.github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=openjavaformat%2Fopen-java-format
Reloadhttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files
Reloadhttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files
Reloadhttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files
openjavaformathttps://redirect.github.com/openjavaformat
open-java-formathttps://redirect.github.com/openjavaformat/open-java-format
Codehttps://redirect.github.com/openjavaformat/open-java-format
Issues30 (30)https://redirect.github.com/openjavaformat/open-java-format/issues
Pull requests5 (5)https://redirect.github.com/openjavaformat/open-java-format/pulls
Discussionshttps://redirect.github.com/openjavaformat/open-java-format/discussions
Actionshttps://redirect.github.com/openjavaformat/open-java-format/actions
Security and qualityhttps://redirect.github.com/openjavaformat/open-java-format/security
Insightshttps://redirect.github.com/openjavaformat/open-java-format/pulse
Sign up for GitHub https://redirect.github.com/signup?return_to=%2Fopenjavaformat%2Fopen-java-format%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://redirect.github.com/login?return_to=%2Fopenjavaformat%2Fopen-java-format%2Fissues%2Fnew%2Fchoose
abashevhttps://redirect.github.com/abashev
21.X.Xhttps://redirect.github.com/openjavaformat/open-java-format/tree/21.X.X
fix/column-after-operatorhttps://redirect.github.com/openjavaformat/open-java-format/tree/fix/column-after-operator
Conversation 0 https://redirect.github.com/openjavaformat/open-java-format/pull/170
Commits 1 https://redirect.github.com/openjavaformat/open-java-format/pull/170/commits
Checks 17 https://redirect.github.com/openjavaformat/open-java-format/pull/170/checks
Files changed https://redirect.github.com/openjavaformat/open-java-format/pull/170/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files
Keep the rows of a table that follows an operator such as -> or += https://redirect.github.com/openjavaformat/open-java-format/pull/170/files#top
Show all changes 1 commit https://redirect.github.com/openjavaformat/open-java-format/pull/170/files
5a27e26 Keep the rows of a table that follows an operator such as -> or += abashev Oct 30, 2026 https://redirect.github.com/openjavaformat/open-java-format/pull/170/commits/5a27e260ae919f7c23d0df56cbc6296e4b56b658
Clear filters https://redirect.github.com/openjavaformat/open-java-format/pull/170/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files
JavaInput.java https://redirect.github.com/openjavaformat/open-java-format/pull/170/files#diff-516ea73494b4274aa0b32022b306b43a94f72da3f627989e34ad54ee9827144e
tablesAfterMultiCharacterOperators.case https://redirect.github.com/openjavaformat/open-java-format/pull/170/files#diff-16d484fde6774fc6567e04eac1b20518480adbb8e92a7aa4201722f99eebf3a5
open-java-format/src/main/java/com/palantir/javaformat/java/JavaInput.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files#diff-516ea73494b4274aa0b32022b306b43a94f72da3f627989e34ad54ee9827144e
View file https://redirect.github.com/openjavaformat/open-java-format/blob/5a27e260ae919f7c23d0df56cbc6296e4b56b658/open-java-format/src/main/java/com/palantir/javaformat/java/JavaInput.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/170/{{ revealButtonHref }}
https://redirect.github.com/openjavaformat/open-java-format/pull/170/files#diff-516ea73494b4274aa0b32022b306b43a94f72da3f627989e34ad54ee9827144e
https://redirect.github.com/openjavaformat/open-java-format/pull/170/files#diff-516ea73494b4274aa0b32022b306b43a94f72da3f627989e34ad54ee9827144e
https://redirect.github.com/openjavaformat/open-java-format/pull/170/files#diff-516ea73494b4274aa0b32022b306b43a94f72da3f627989e34ad54ee9827144e
https://redirect.github.com/openjavaformat/open-java-format/pull/170/files#diff-516ea73494b4274aa0b32022b306b43a94f72da3f627989e34ad54ee9827144e
open-java-format/src/test/resources/test-cases/tablesAfterMultiCharacterOperators.casehttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files#diff-16d484fde6774fc6567e04eac1b20518480adbb8e92a7aa4201722f99eebf3a5
View file https://redirect.github.com/openjavaformat/open-java-format/blob/5a27e260ae919f7c23d0df56cbc6296e4b56b658/open-java-format/src/test/resources/test-cases/tablesAfterMultiCharacterOperators.case
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/170/{{ revealButtonHref }}
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/170/files
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.