GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Keep //$NON-NLS-n$ markers valid: no inserted space, each marker on the line of its string · Issue #23 · openjavaformat/open-java-format Closed Labels bugSomething isn't workingSomething isn't working DescriptionBackgroundEclipse marks a string literal that is deliberately not externalised with a trailing Chains of string concatenation already work: 1. A space is inserted into the markerString a = "x"; //$NON-NLS-1$ becomes String a = "x"; // $NON-NLS-1$ and Eclipse no longer recognises it. This is the most common case, because it hits every statement that fits on one line. Cause: 2. Wrapped arguments leave their markers behindString 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$ becomes String 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$ The first two literals are now on lines without a marker, and the last line has one literal and three markers. 3. A reflowed literal ends up partly unmarkedString 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$ becomes String 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$ The first piece has no marker. Proposal
CompatibilityAll 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. Prior reportsgoogle-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. ActivityMetadataMetadataAssigneesLabelsbugSomething isn't workingSomething isn't working TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |