mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
resource bundle editor: use case insensitive comparator to compare property keys in all places (IDEA-148792)
This commit is contained in:
+1
-1
@@ -183,7 +183,7 @@ public class PropertiesImplUtil extends PropertiesUtil {
|
||||
if (key == null) {
|
||||
return false;
|
||||
}
|
||||
if (previousKey != null && previousKey.compareTo(key) > 0) {
|
||||
if (previousKey != null && String.CASE_INSENSITIVE_ORDER.compare(previousKey, key) > 0) {
|
||||
return false;
|
||||
}
|
||||
previousKey = key;
|
||||
|
||||
+1
-1
@@ -166,7 +166,7 @@ public class PropertiesFileImpl extends PsiFileBase implements PropertiesFile {
|
||||
final String k1 = p1.getKey();
|
||||
final String k2 = p2.getKey();
|
||||
LOG.assertTrue(k1 != null && k2 != null);
|
||||
return k1.compareTo(k2);
|
||||
return String.CASE_INSENSITIVE_ORDER.compare(k1, k2);
|
||||
}
|
||||
});
|
||||
return insertIndex == -1 ? null :myProperties.get(insertIndex < 0 ? - insertIndex - 2 : insertIndex);
|
||||
|
||||
+4
-4
@@ -139,7 +139,7 @@ public class ResourceBundlePropertiesUpdateManager {
|
||||
|
||||
@Nullable
|
||||
private static Pair<List<String>, Boolean> keysOrder(final ResourceBundle resourceBundle) {
|
||||
final boolean[] isEdgesProperlyDirection = new boolean[]{true};
|
||||
final boolean[] isAlphaSorted = new boolean[]{true};
|
||||
final GraphGenerator<String> generator = GraphGenerator.create(CachingSemiGraph.create(new GraphGenerator.SemiGraph<String>() {
|
||||
@Override
|
||||
public Collection<String> getNodes() {
|
||||
@@ -167,8 +167,8 @@ public class ResourceBundlePropertiesUpdateManager {
|
||||
if (sibling instanceof IProperty) {
|
||||
final String key = ((IProperty)sibling).getKey();
|
||||
if (key != null) {
|
||||
if (isEdgesProperlyDirection[0] && n.compareTo(key) > 0) {
|
||||
isEdgesProperlyDirection[0] = false;
|
||||
if (isAlphaSorted[0] && String.CASE_INSENSITIVE_ORDER.compare(n, key) > 0) {
|
||||
isAlphaSorted[0] = false;
|
||||
}
|
||||
siblings.add(key);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ public class ResourceBundlePropertiesUpdateManager {
|
||||
DFSTBuilder<String> dfstBuilder = new DFSTBuilder<String>(generator);
|
||||
final boolean acyclic = dfstBuilder.isAcyclic();
|
||||
if (acyclic) {
|
||||
if (isEdgesProperlyDirection[0]) {
|
||||
if (isAlphaSorted[0]) {
|
||||
final List<String> sortedNodes = new ArrayList<String>(generator.getNodes());
|
||||
Collections.sort(sortedNodes, String.CASE_INSENSITIVE_ORDER);
|
||||
return Pair.create(sortedNodes, true);
|
||||
|
||||
Reference in New Issue
Block a user