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 — Use Collator when sorting Eclipse JDT members by aKandzior · Pull Request #2920 · diffplug/spotless Conversation
Contributor
SummaryThis updates the Eclipse JDT member sorting comparator to use The Eclipse JDT UI implementation uses a collator for these comparisons. Spotless used MotivationOur team primarily works with Eclipse, but some developers now use VS Code for smaller edits. We use Spotless to make the command line and non-Eclipse editing workflow follow the same formatting rules as Eclipse save actions. Without this patch, member sorting can differ deterministically between Eclipse and Spotless in edge cases. That creates a "ping pong" scenario where method positions shift depending on which editor or formatter was used last. Using the same collator-based comparison as Eclipse avoids that difference and makes Spotless member sorting match Eclipse more closely. Changes
Test./gradlew :lib-extra:test --tests com.diffplug.spotless.extra.java.EclipseJdtFormatterStepSpecialCaseTest --no-daemon --no-configuration-cache --console=plain
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
The Eclipse JDT member sorter compares method names and parameter type signatures with a java.text.Collator. Spotless' DefaultJavaElementComparator used String.compareTo instead, which can produce a different member order than Eclipse save actions for names that differ by case or locale-sensitive collation. Update DefaultJavaElementComparator to use Collator for member name comparison and parameter type signature comparison so Spotless matches Eclipse JDT behavior more closely. Adds a regression fixture which exposes the case-sensitive ordering difference. Test: ./gradlew :lib-extra:test --tests com.diffplug.spotless.extra.java.EclipseJdtFormatterStepSpecialCaseTest --no-daemon --no-configuration-cache --console=plain Uh oh!
There was an error while loading. Please reload this page.
stechio
added a commit
to pdfclown/pdfclown-common
that referenced
this pull request
Applies the new spotless sorting algorithm for Java members (Eclipse JDT's collator-based comparison diffplug/spotless#2920).
stechio
added a commit
to pdfclown/pdfclown-common
that referenced
this pull request
…0 to 3.5.1 (#104) * fix(deps): bump com.diffplug.spotless:spotless-maven-plugin Bumps [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) from 3.4.0 to 3.5.1. - [Release notes](https://github.com/diffplug/spotless/releases) - [Changelog](https://github.com/diffplug/spotless/blob/main/CHANGES.md) - [Commits](diffplug/spotless@maven/3.4.0...maven/3.5.1) --- updated-dependencies: - dependency-name: com.diffplug.spotless:spotless-maven-plugin dependency-version: 3.5.1 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * style: apply new spotless sorting algorithm Applies the new spotless sorting algorithm for Java members (Eclipse JDT's collator-based comparison diffplug/spotless#2920). --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: stechio <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — 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. |