René's URL Explorer Experiment


Title: Reflow only the long strings in the code that formatting the ranges rewrites by abashev · Pull Request #233 · openjavaformat/open-java-format · GitHub

Open Graph Title: Reflow only the long strings in the code that formatting the ranges rewrites by abashev · Pull Request #233 · openjavaformat/open-java-format

X Title: Reflow only the long strings in the code that formatting the ranges rewrites by abashev · Pull Request #233 · openjavaformat/open-java-format

Description: Builds on #232; merge that first. Part of #219. Formatting a part of a file reflows only the long strings in the code that formatting it rewrites. Before, once one line in the ranges needed reflowing, every long string in the file was reflowed, on lines nobody touched. This is what IntelliJ IDEA, formatDiff and every other caller of --output-replacements or FormatterService.getFormatReplacements get, alike. StringWrapper.wrap with ranges reflows only the literals and text blocks that overlap them, and moves the ranges along with each of its passes (moveRanges). Without ranges it runs as before. Formatter.getFormatAndReflowReplacements hands it the ranges of the code that formatting rewrote, which also decide whether to reflow at all; that check used to hold the ranges of the input against the formatted text. The SPI says it: FormatterService.getFormatReplacements formats the ranges and reflows the long strings in the code it rewrites; the imports, and the strings elsewhere, stay. What changes for users Whole files: nothing. The command line, the GitHub Action, the pre-commit hook and the build plugins write what 21.0.2 wrote: 1,499 real files byte for byte the same as the 21.0.2 native binary's output. Ranges leave long strings outside the code they rewrite. They reflow more often than 21.0.2 did inside it, since the check now looks at the rewritten code: over every line with a string literal and more than 90 characters in 600 real files, one line at a time, 28 results reflowed, all inside the rewritten code; 21.0.2 reflowed 11, 2 of them outside it. Tests StringWrapperTest: wrapping in ranges, and how ranges move with the replacements. FormatterServiceImplTest (new, one test): a long string on a changed line reflows and one on another line stays, through Main and the in-process service; it fails on the code of #232. FormatterServicesTest and FormatDiffTest: the same file through the in-process, bootstrapping and native formatters. JDK 21: ./gradlew check passes; 1,422 tests in :open-java-format. JDK 25 and JDK 28 (28+23-ea): :open-java-format:test passes. -PnativeImage=true (macOS aarch64, GraalVM 25): FormatterServicesTest 14 of 14, FormatDiffTest 10 of 10.

Open Graph Description: Builds on #232; merge that first. Part of #219. Formatting a part of a file reflows only the long strings in the code that formatting it rewrites. Before, once one line in the ranges needed reflowi...

X Description: Builds on #232; merge that first. Part of #219. Formatting a part of a file reflows only the long strings in the code that formatting it rewrites. Before, once one line in the ranges needed reflowi...

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

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:c3634e40-f476-219e-b9d7-f3a1ee2f002b
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idA0C0:19D62B:786AF7:A153A2:6AFBD1AF
html-safe-nonce3f24c3f599350a8dd3117abee8d897c0eea0ea948f58ffe2e74671c4d6c29018
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMEMwOjE5RDYyQjo3ODZBRjc6QTE1M0EyOjZBRkJEMUFGIiwidmlzaXRvcl9pZCI6Ijc5MjUzOTk5NDUwMzk1NjUyMzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf3aa88c15c5cac4925417ced8b8083cb0d6b13c223872b7eb2ebc60c3c350e0a
hovercard-subject-tagpull_request:5316046882
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/233/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:altBuilds on #232; merge that first. Part of #219. Formatting a part of a file reflows only the long strings in the code that formatting it rewrites. Before, once one line in the ranges needed reflowi...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None18742cb872ec73544356e60359266b67aafece70c4ce008042e06227924cdd07
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
release820be804f18e1ef3940bd74a00d41d73d02e2b91
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/openjavaformat/open-java-format/pull/233/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%2F233%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%2F233%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/233/files
Reloadhttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files
Reloadhttps://redirect.github.com/openjavaformat/open-java-format/pull/233/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
abashev/Range-reflow-in-processhttps://redirect.github.com/openjavaformat/open-java-format/tree/abashev/Range-reflow-in-process
abashev/Range-reflow-insidehttps://redirect.github.com/openjavaformat/open-java-format/tree/abashev/Range-reflow-inside
Conversation 0 https://redirect.github.com/openjavaformat/open-java-format/pull/233
Commits 2 https://redirect.github.com/openjavaformat/open-java-format/pull/233/commits
Checks 13 https://redirect.github.com/openjavaformat/open-java-format/pull/233/checks
Files changed https://redirect.github.com/openjavaformat/open-java-format/pull/233/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files
Reflow only the long strings in the code that formatting the ranges rewrites https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#top
Show all changes 2 commits https://redirect.github.com/openjavaformat/open-java-format/pull/233/files
a740c20 Reflow only the strings in the code that formatting the ranges rewrites abashev Nov 14, 2026 https://redirect.github.com/openjavaformat/open-java-format/pull/233/commits/a740c203e9871f7f4c8b31535ef51c77d240a340
3c36af2 Leave long strings outside the changed lines in the service tests abashev Nov 14, 2026 https://redirect.github.com/openjavaformat/open-java-format/pull/233/commits/3c36af28eeb476e3166b054a0c92bd450ce1b25e
Clear filters https://redirect.github.com/openjavaformat/open-java-format/pull/233/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files
FormatDiffTest.java https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-b10c300cf3e9d91e6627e36b29c66d7a670beac2e79dda14481e48787f75d85b
FormatterServicesTest.java https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-124f2692d8cf2b1114341e748c10142cb70d873610f7fb86fe1497251f1442e7
FormatterService.java https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-b9e02d4462cdc40044a9fc2c50898e20fc08240b8bc6a6b762a8d9a211f20f5b
Formatter.java https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-fd61ca102fae096ccb3dcee9925025bec1ea7d5ab586817c56f186ffe2b705f0
StringWrapper.java https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-e1a3ba2697d8a173c2a21309f93db0dd44e1d34a557cb37877fdafae42b26cd6
FormatterServiceImplTest.java https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-eef6bc8b456c8cb652f6a7a08cde50a88ee65ad8cc5c98c35aa70635552d7da9
StringWrapperTest.java https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-4926d092f45f488968ac0a53834fbd91c63a7b549c07b7af40def14dc37a3283
gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/FormatDiffTest.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-b10c300cf3e9d91e6627e36b29c66d7a670beac2e79dda14481e48787f75d85b
View file https://redirect.github.com/openjavaformat/open-java-format/blob/3c36af28eeb476e3166b054a0c92bd450ce1b25e/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/FormatDiffTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/233/{{ revealButtonHref }}
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-b10c300cf3e9d91e6627e36b29c66d7a670beac2e79dda14481e48787f75d85b
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-b10c300cf3e9d91e6627e36b29c66d7a670beac2e79dda14481e48787f75d85b
...-jdk-bootstrap/src/test/java/com/palantir/javaformat/bootstrap/FormatterServicesTest.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-124f2692d8cf2b1114341e748c10142cb70d873610f7fb86fe1497251f1442e7
View file https://redirect.github.com/openjavaformat/open-java-format/blob/3c36af28eeb476e3166b054a0c92bd450ce1b25e/open-java-format-jdk-bootstrap/src/test/java/com/palantir/javaformat/bootstrap/FormatterServicesTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/233/{{ revealButtonHref }}
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-124f2692d8cf2b1114341e748c10142cb70d873610f7fb86fe1497251f1442e7
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-124f2692d8cf2b1114341e748c10142cb70d873610f7fb86fe1497251f1442e7
open-java-format-spi/src/main/java/com/palantir/javaformat/java/FormatterService.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-b9e02d4462cdc40044a9fc2c50898e20fc08240b8bc6a6b762a8d9a211f20f5b
View file https://redirect.github.com/openjavaformat/open-java-format/blob/3c36af28eeb476e3166b054a0c92bd450ce1b25e/open-java-format-spi/src/main/java/com/palantir/javaformat/java/FormatterService.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/233/{{ revealButtonHref }}
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-b9e02d4462cdc40044a9fc2c50898e20fc08240b8bc6a6b762a8d9a211f20f5b
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-b9e02d4462cdc40044a9fc2c50898e20fc08240b8bc6a6b762a8d9a211f20f5b
open-java-format/src/main/java/com/palantir/javaformat/java/Formatter.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-fd61ca102fae096ccb3dcee9925025bec1ea7d5ab586817c56f186ffe2b705f0
View file https://redirect.github.com/openjavaformat/open-java-format/blob/3c36af28eeb476e3166b054a0c92bd450ce1b25e/open-java-format/src/main/java/com/palantir/javaformat/java/Formatter.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/233/{{ revealButtonHref }}
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-fd61ca102fae096ccb3dcee9925025bec1ea7d5ab586817c56f186ffe2b705f0
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-fd61ca102fae096ccb3dcee9925025bec1ea7d5ab586817c56f186ffe2b705f0
open-java-format/src/main/java/com/palantir/javaformat/java/StringWrapper.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-e1a3ba2697d8a173c2a21309f93db0dd44e1d34a557cb37877fdafae42b26cd6
View file https://redirect.github.com/openjavaformat/open-java-format/blob/3c36af28eeb476e3166b054a0c92bd450ce1b25e/open-java-format/src/main/java/com/palantir/javaformat/java/StringWrapper.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/233/{{ revealButtonHref }}
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-e1a3ba2697d8a173c2a21309f93db0dd44e1d34a557cb37877fdafae42b26cd6
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-e1a3ba2697d8a173c2a21309f93db0dd44e1d34a557cb37877fdafae42b26cd6
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-e1a3ba2697d8a173c2a21309f93db0dd44e1d34a557cb37877fdafae42b26cd6
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-e1a3ba2697d8a173c2a21309f93db0dd44e1d34a557cb37877fdafae42b26cd6
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-e1a3ba2697d8a173c2a21309f93db0dd44e1d34a557cb37877fdafae42b26cd6
https://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-e1a3ba2697d8a173c2a21309f93db0dd44e1d34a557cb37877fdafae42b26cd6
open-java-format/src/test/java/com/palantir/javaformat/java/FormatterServiceImplTest.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files#diff-eef6bc8b456c8cb652f6a7a08cde50a88ee65ad8cc5c98c35aa70635552d7da9
View file https://redirect.github.com/openjavaformat/open-java-format/blob/3c36af28eeb476e3166b054a0c92bd450ce1b25e/open-java-format/src/test/java/com/palantir/javaformat/java/FormatterServiceImplTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/233/{{ revealButtonHref }}
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/233/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/233/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.