René's URL Explorer Experiment


Title: Keep the comment prefix when wrapping a markdown docstring (palantir #1776) by abashev · Pull Request #102 · openjavaformat/open-java-format · GitHub

Open Graph Title: Keep the comment prefix when wrapping a markdown docstring (palantir #1776) by abashev · Pull Request #102 · openjavaformat/open-java-format

X Title: Keep the comment prefix when wrapping a markdown docstring (palantir #1776) by abashev · Pull Request #102 · openjavaformat/open-java-format

Description: Port of palantir#1776 by asm0dey, cherry-picked with the author kept. It fixes palantir#1803: from JDK 23 on, javac hands a run of /// markdown doc lines over as one comment token, every line after the first still carries its source indentation, and JavaCommentsHelper.wrapLineComments read the slash prefix, and the width budget, from that untrimmed line. The prefix came back empty, so the wrapped remainder was written out as bare code. Reproduced on main (2fbf175) The class from palantir#1803, formatted on JDK 25 and 27, comes out exactly as reported: /// @param b Aaaaaaa aaaaaaaaaa aaaaaaaaaaaaa aaaaaa aaaaaaaaaaaaaa aaaaaaaaa, aaaaaa aaaaaaaaa (aaaaaaaa XXXXXXXX aaaaaaa) public record Yyy(String a, String b) {} javac then fails with ';' expected. The default CLI run reports the same errors and exits with 2, because the import pass re-parses the broken result; that is the crash the issue shows in Spotless. On JDK 21 each /// line is its own token and the output is right. It is not only a contrived case: in the JDK 27 sources, jdk.compiler/com/sun/source/tree/VariableTree.java has a 141-column /// line. On JDK 27, main turns its overflow into bare text and the CLI refuses the file with = expected; with this change the overflow wraps as a /// line. The change wrapLineComments trims the line before reading the prefix and measuring it: six lines in JavaCommentsHelper. From the upstream description: a continuation line keeps /// when it wraps; a line at the column limit is no longer wrapped (the indentation was counted twice); an unbreakable token is left long instead of becoming an empty /// followed by bare text; ///foo becomes /// foo on every line of the run, so the same source no longer formats differently depending on whether the running JDK hands the run over as one token or one per line. Tests: JavaCommentsHelperTest builds the multi-line token directly, so the JDK 21 test task covers the bug; four of its six tests fail on main. The end-to-end test in FormatterTest is gated at JDK 23 and runs in the JDK 25, 26 and 27 jobs. Adapted to the fork Style.OJF for Style.PALANTIR. The fork's JavaCommentsHelper takes the JavaInput rather than a line separator, so the test builds one from class T {}. The test class and its methods are package-private and final, as the Picnic rules JUnitClassModifiers and JUnitMethodDeclaration demand. No changelog entry: the fork keeps none. Checks :open-java-format:test on JDK 21 (gated test skipped), 25 and 27 (gated test passes): 1604 tests, 0 failures. The issue's class on JDK 25 and 27: compiles, a second run changes nothing, and the default run agrees with the run that skips the import passes. Corpora formatted with main's jar and this branch's jar on the matching runtime: JDK 21 (15,747 files) and JDK 25 (15,368) identical; JDK 27 (15,310): one file differs, the VariableTree.java above, which main could not format at all.

Open Graph Description: Port of palantir#1776 by asm0dey, cherry-picked with the author kept. It fixes palantir#1803: from JDK 23 on, javac hands a run of /// markdown doc lines over as one comment token, every line after...

X Description: Port of palantir#1776 by asm0dey, cherry-picked with the author kept. It fixes palantir#1803: from JDK 23 on, javac hands a run of /// markdown doc lines over as one comment token, every line after...

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

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:96628312-93df-65a3-00ca-ae902c79193d
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idEC9A:2E1019:9A44FD:D43BBF:6AFBD914
html-safe-nonce08280c590d29ea3f89f88f90ee47a501bce9b01cea2087a62097bfd557446cb1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzlBOjJFMTAxOTo5QTQ0RkQ6RDQzQkJGOjZBRkJEOTE0IiwidmlzaXRvcl9pZCI6IjE1NzA2NzkyNjU3NDgwNDgxNDgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf1c271d7d5ebaabc6c72bb802b1a8b79a3beafe5dcc6081032a2b4c415651e5d
hovercard-subject-tagpull_request:4728672289
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/102/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:altPort of palantir#1776 by asm0dey, cherry-picked with the author kept. It fixes palantir#1803: from JDK 23 on, javac hands a run of /// markdown doc lines over as one comment token, every line after...
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/102/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%2F102%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%2F102%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/102/files
Reloadhttps://redirect.github.com/openjavaformat/open-java-format/pull/102/files
Reloadhttps://redirect.github.com/openjavaformat/open-java-format/pull/102/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
mainhttps://redirect.github.com/openjavaformat/open-java-format/tree/main
port-pjf-1776-markdown-docstring-prefixhttps://redirect.github.com/openjavaformat/open-java-format/tree/port-pjf-1776-markdown-docstring-prefix
Conversation 0 https://redirect.github.com/openjavaformat/open-java-format/pull/102
Commits 2 https://redirect.github.com/openjavaformat/open-java-format/pull/102/commits
Checks 16 https://redirect.github.com/openjavaformat/open-java-format/pull/102/checks
Files changed https://redirect.github.com/openjavaformat/open-java-format/pull/102/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/102/files
Keep the comment prefix when wrapping a markdown docstring (palantir #1776) https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#top
Show all changes 2 commits https://redirect.github.com/openjavaformat/open-java-format/pull/102/files
e127875 fix: keep the comment prefix when wrapping a markdown docstring asm0dey Sep 11, 2026 https://redirect.github.com/openjavaformat/open-java-format/pull/102/commits/e1278751371929691935b3806b5a51d818e5a18d
4561770 Merge branch 'main' into port-pjf-1776-markdown-docstring-prefix abashev Oct 3, 2026 https://redirect.github.com/openjavaformat/open-java-format/pull/102/commits/4561770046e0bad47dad11b0387fc0dad82eb0fa
Clear filters https://redirect.github.com/openjavaformat/open-java-format/pull/102/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/102/files
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/102/files
JavaCommentsHelper.java https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-421ad18fa6b5e59b0bf65aaf7ecf92f4ddacb70c33583d23eaf1d5cd5b7e1323
FormatterTest.java https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-f85983c1d6fc968e83e9d38af248a62d00ebe6502ee2e268ed00928ed0439180
JavaCommentsHelperTest.java https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-d874ff0b117fa1fea06a687673b5402968487a1764f316e9bef6b765fe7b45c9
open-java-format/src/main/java/com/palantir/javaformat/java/JavaCommentsHelper.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-421ad18fa6b5e59b0bf65aaf7ecf92f4ddacb70c33583d23eaf1d5cd5b7e1323
View file https://redirect.github.com/openjavaformat/open-java-format/blob/4561770046e0bad47dad11b0387fc0dad82eb0fa/open-java-format/src/main/java/com/palantir/javaformat/java/JavaCommentsHelper.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/102/{{ revealButtonHref }}
https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-421ad18fa6b5e59b0bf65aaf7ecf92f4ddacb70c33583d23eaf1d5cd5b7e1323
https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-421ad18fa6b5e59b0bf65aaf7ecf92f4ddacb70c33583d23eaf1d5cd5b7e1323
open-java-format/src/test/java/com/palantir/javaformat/java/FormatterTest.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-f85983c1d6fc968e83e9d38af248a62d00ebe6502ee2e268ed00928ed0439180
View file https://redirect.github.com/openjavaformat/open-java-format/blob/4561770046e0bad47dad11b0387fc0dad82eb0fa/open-java-format/src/test/java/com/palantir/javaformat/java/FormatterTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/102/{{ revealButtonHref }}
https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-f85983c1d6fc968e83e9d38af248a62d00ebe6502ee2e268ed00928ed0439180
https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-f85983c1d6fc968e83e9d38af248a62d00ebe6502ee2e268ed00928ed0439180
https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-f85983c1d6fc968e83e9d38af248a62d00ebe6502ee2e268ed00928ed0439180
https://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-f85983c1d6fc968e83e9d38af248a62d00ebe6502ee2e268ed00928ed0439180
open-java-format/src/test/java/com/palantir/javaformat/java/JavaCommentsHelperTest.javahttps://redirect.github.com/openjavaformat/open-java-format/pull/102/files#diff-d874ff0b117fa1fea06a687673b5402968487a1764f316e9bef6b765fe7b45c9
View file https://redirect.github.com/openjavaformat/open-java-format/blob/4561770046e0bad47dad11b0387fc0dad82eb0fa/open-java-format/src/test/java/com/palantir/javaformat/java/JavaCommentsHelperTest.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/openjavaformat/open-java-format/pull/102/{{ revealButtonHref }}
Please reload this pagehttps://redirect.github.com/openjavaformat/open-java-format/pull/102/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.