René's URL Explorer Experiment


Title: Keep //$NON-NLS-n$ markers valid: no inserted space, each marker on the line of its string · Issue #23 · openjavaformat/open-java-format · GitHub

Open Graph Title: Keep //$NON-NLS-n$ markers valid: no inserted space, each marker on the line of its string · Issue #23 · openjavaformat/open-java-format

X Title: Keep //$NON-NLS-n$ markers valid: no inserted space, each marker on the line of its string · Issue #23 · openjavaformat/open-java-format

Description: Background Eclipse marks a string literal that is deliberately not externalised with a trailing //$NON-NLS-n$ comment, where n is the position of the literal on that line. The marker has to keep its exact spelling and has to stay on the ...

Open Graph Description: Background Eclipse marks a string literal that is deliberately not externalised with a trailing //$NON-NLS-n$ comment, where n is the position of the literal on that line. The marker has to keep it...

X Description: Background Eclipse marks a string literal that is deliberately not externalised with a trailing //$NON-NLS-n$ comment, where n is the position of the literal on that line. The marker has to keep it...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Keep //$NON-NLS-n$ markers valid: no inserted space, each marker on the line of its string","articleBody":"### Background\n\nEclipse marks a string literal that is deliberately not externalised with a trailing `//$NON-NLS-n$` comment, where `n` is the position of the literal **on that line**. The marker has to keep its exact spelling and has to stay on the line of its string. [This answer](https://stackoverflow.com/a/40266605) explains the convention. The item comes from the \"Future work\" list of the old README.\n\nChains of string concatenation already work: `OpsBuilder` keeps each marker with its string, and `NON-NLS.input` / `NON-NLS.output` cover that. Three other cases break. All of them reproduce with 2.98.0.1, with the jar and the native binary alike, in every style.\n\n### 1. A space is inserted into the marker\n\n```java\nString a = \"x\"; //$NON-NLS-1$\n```\n\nbecomes\n\n```java\nString a = \"x\"; // $NON-NLS-1$\n```\n\nand Eclipse no longer recognises it. This is the most common case, because it hits every statement that fits on one line.\n\nCause: `doc/Comment.computeFlat()` prefixes `// ` to any line comment that does not start with it. For a statement that fits on one line `commentsHelper.rewrite` is never called, so the exemption that `JavaCommentsHelper.LINE_COMMENT_MISSING_SPACE_PREFIX` already has for `//noinspection` and `//$NON-NLS-n$` is bypassed. `computeWidth()` carries the matching `+ 1`. A trailing `//noinspection` gets the same space; on a line of its own it is left alone.\n\n### 2. Wrapped arguments leave their markers behind\n\n```java\nString message = Messages.format(\"first argument that is long enough to matter\", \"second argument that is also rather long\", \"third one\"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n```\n\nbecomes\n\n```java\nString message = Messages.format(\n        \"first argument that is long enough to matter\",\n        \"second argument that is also rather long\",\n        \"third one\"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$\n```\n\nThe first two literals are now on lines without a marker, and the last line has one literal and three markers.\n\n### 3. A reflowed literal ends up partly unmarked\n\n```java\nString reflowed = \"a single string literal that is far too long to fit into one hundred and twenty columns, so the formatter reflows it\"; //$NON-NLS-1$\n```\n\nbecomes\n\n```java\nString reflowed =\n        \"a single string literal that is far too long to fit into one hundred and twenty columns, so the\"\n                + \" formatter reflows it\"; //$NON-NLS-1$\n```\n\nThe first piece has no marker. `--skip-reflowing-long-strings` avoids this case only.\n\n### Proposal\n\n- **Case 1** is small: apply the existing exemption in `Comment.computeFlat()` and `Comment.computeWidth()`, sharing the pattern with `JavaCommentsHelper` instead of repeating it.\n- **Cases 2 and 3** need a design. When a statement with markers is wrapped, each marker has to move to the line of its literal and be renumbered for that line. When a literal is split, every piece needs a marker of its own.\n\n### Compatibility\n\nAll three fixes change the output of files that format today, so they differ from palantir-java-format 2.98.0. The promise for 2.x says output changes wait for 3.0. Case 1 is a bug that makes the formatter corrupt a marker another tool depends on, so it is worth deciding whether it counts as a fix or as a style change.\n\n### Prior reports\n\ngoogle-java-format shares this code path and has had it reported: google/google-java-format#221 (closed, 2017) and google/google-java-format#361 (open since 2019). No report was found in palantir-java-format.\n\n","author":{"url":"https://github.com/abashev","@type":"Person","name":"abashev"},"datePublished":"2026-09-21T13:39:20Z","url":"https://github.com/openjavaformat/open-java-format/issues/23"}

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/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:33ad0ed4-ea52-3be5-ec75-d5adff632b87
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB454:1EA667:1390C9:1B133B:6AFBBB59
html-safe-nonceb891f0c14c5520e5d17f2ff37ced19bcdc5cdf19478709612d3e3750f47dc224
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNDU0OjFFQTY2NzoxMzkwQzk6MUIxMzNCOjZBRkJCQjU5IiwidmlzaXRvcl9pZCI6IjI2MDAxMzEyMzY2Njc4MzMxNzciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac878cfbb2fb5cd4b2e961dad79939c65337fb1c71ce92b180128b3c73b5223186
hovercard-subject-tagissue:5527762633
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/openjavaformat/open-java-format/23/issue_layout
twitter:imagehttps://opengraph.githubassets.com/1ee3a5609e0650eb61f49641e9431741edc26699add0eaa13d3e19ebb3d92d85/openjavaformat/open-java-format/issues/23
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/1ee3a5609e0650eb61f49641e9431741edc26699add0eaa13d3e19ebb3d92d85/openjavaformat/open-java-format/issues/23
og:image:altBackground Eclipse marks a string literal that is deliberately not externalised with a trailing //$NON-NLS-n$ comment, where n is the position of the literal on that line. The marker has to keep it...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameabashev
hostnamegithub.com
expected-hostnamegithub.com
None2b2ef9c1578c18d8ed27027940544c958743213cf4461659f14d3ccdf51e162c
turbo-cache-controlno-preview
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/23#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopenjavaformat%2Fopen-java-format%2Fissues%2F23
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%2F23
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=openjavaformat%2Fopen-java-format
Reloadhttps://github.com/openjavaformat/open-java-format/issues/23
Reloadhttps://github.com/openjavaformat/open-java-format/issues/23
Reloadhttps://github.com/openjavaformat/open-java-format/issues/23
openjavaformathttps://github.com/openjavaformat
open-java-formathttps://github.com/openjavaformat/open-java-format
Codehttps://github.com/openjavaformat/open-java-format
Issues30 (30)https://github.com/openjavaformat/open-java-format/issues
Pull requests5 (5)https://github.com/openjavaformat/open-java-format/pulls
Discussionshttps://github.com/openjavaformat/open-java-format/discussions
Actionshttps://github.com/openjavaformat/open-java-format/actions
Security and qualityhttps://github.com/openjavaformat/open-java-format/security
Insightshttps://github.com/openjavaformat/open-java-format/pulse
https://github.com/openjavaformat/open-java-format
New issuehttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/23
New issuehttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/23
#150https://github.com/openjavaformat/open-java-format/pull/150
Keep //$NON-NLS-n$ markers valid: no inserted space, each marker on the line of its stringhttps://github.com/openjavaformat/open-java-format/issues/23#top
#150https://github.com/openjavaformat/open-java-format/pull/150
bugSomething isn't workinghttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22bug%22
https://github.com/abashev
abashevhttps://github.com/abashev
on Sep 21, 2026https://github.com/openjavaformat/open-java-format/issues/23#issue-5527762633
This answerhttps://stackoverflow.com/a/40266605
google/google-java-format#221https://github.com/google/google-java-format/issues/221
google/google-java-format#361https://github.com/google/google-java-format/issues/361
abashevhttps://github.com/abashev
bugSomething isn't workinghttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22bug%22
on Sep 21, 2026https://github.com/openjavaformat/open-java-format/issues/23#event-31532111900
abashevhttps://github.com/abashev
completedhttps://github.com/openjavaformat/open-java-format/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#150https://github.com/openjavaformat/open-java-format/pull/150
on Oct 25, 2026https://github.com/openjavaformat/open-java-format/issues/23#event-34198911522
Sign up for freehttps://github.com/signup?return_to=https://github.com/openjavaformat/open-java-format/issues/23
Sign in to commenthttps://github.com/login?return_to=https://github.com/openjavaformat/open-java-format/issues/23
bugSomething isn't workinghttps://github.com/openjavaformat/open-java-format/issues?q=state%3Aopen%20label%3A%22bug%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.