mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
InspectionsConfigTreeComparator: use NaturalComparator in downstream to properly order Java 9 and Java 10
This commit is contained in:
+3
-1
@@ -2,12 +2,14 @@
|
||||
|
||||
package com.intellij.profile.codeInspection.ui.inspectionsTree;
|
||||
|
||||
import com.intellij.openapi.util.text.NaturalComparator;
|
||||
|
||||
import java.util.Comparator;
|
||||
|
||||
public class InspectionsConfigTreeComparator {
|
||||
public static final Comparator<InspectionConfigTreeNode> INSTANCE =
|
||||
Comparator.<InspectionConfigTreeNode>comparingInt(n -> n instanceof InspectionConfigTreeNode.Group ? 0 : 1)
|
||||
.thenComparing(n -> getDisplayTextToSort(n.getText()), String.CASE_INSENSITIVE_ORDER);
|
||||
.thenComparing(n -> getDisplayTextToSort(n.getText()), NaturalComparator.INSTANCE);
|
||||
|
||||
public static String getDisplayTextToSort(String s) {
|
||||
if (s.length() == 0) {
|
||||
|
||||
Reference in New Issue
Block a user