Use Collator when sorting Eclipse JDT members by aKandzior · Pull Request #2920 · diffplug/spotless (original) (raw)
added 2 commits
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})