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 — The routes format the same file differently: formatDiff on the JVM, ranges, and the order of fixing imports · Issue #219 · openjavaformat/open-java-format Open Labels bugSomething isn't workingSomething isn't working DescriptionWhat happensThe same file comes out differently depending on the route that formats it. Found by running every route on the same input with 21.0.2 on JDK 21, the native binary for macOS aarch64 included, over 3,865 real files: 3,000 from a set of local repositories and 865 from 1. String s = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; becomes, without String s = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."; and with it String s = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et" + " dolore magna aliqua."; The first fails the check of the GitHub Action and the pre-commit hook ( 2. Formatting a range reflows long strings outside it. IntelliJ IDEA, with the Java-based formatter and the native one alike, and class S {
- String outside = "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat sed.";
+ String outside = "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo"
+ + " consequat sed.";
- String changed = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna.";
+ String changed =
+ "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et"
+ + " dolore magna.";
}Over every line with a string literal and more than 90 characters in 600 of the files, formatted one line at a time, the reflow changed 11 results, and in 2 of them it changed strings outside the code that formatting the line rewrote. 3. The Maven plugin and the Spotless step fix the imports before formatting; the command line, the native binary, the GitHub Action, the pre-commit hook and the playground fix them after it. The result differs when an import that is removed has a comment. From A comment right under a removed import gets a blank line between it and the class before, and stays on the class after. And This is rare: 1 of the 3,865 files, as they are and with an unused import added to each. Each order passes its check on what the other wrote, so no build fails on it; it decides what a file looks like after it is first formatted. Why
No test runs the in-process service against the others: Proposal
Not here
Activity
MetadataMetadataAssigneesLabelsbugSomething isn't workingSomething isn't working TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — 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. |