diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/viewers/ColumnViewerSorter.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/viewers/ColumnViewerSorter.java index 81bb181f0b..781f205029 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/viewers/ColumnViewerSorter.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/util/viewers/ColumnViewerSorter.java @@ -140,7 +140,7 @@ else if (attribute2 == null) switch (type) { case 1: - return ((String) attribute1).compareTo((String) attribute2); + return ((String) attribute1).compareToIgnoreCase((String) attribute2); case 2: return ((Enum) attribute2).name().compareTo(((Enum) attribute2).name()); case 3: diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/taxonomy/TaxonomyModel.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/taxonomy/TaxonomyModel.java index 999f548aac..89350e8340 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/taxonomy/TaxonomyModel.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/views/taxonomy/TaxonomyModel.java @@ -162,7 +162,7 @@ public void visit(TaxonomyNode node) @Override public int compare(Assignment o1, Assignment o2) { - return o1.getInvestmentVehicle().toString().compareTo(o2.getInvestmentVehicle().toString()); + return o1.getInvestmentVehicle().toString().compareToIgnoreCase(o2.getInvestmentVehicle().toString()); } }); diff --git a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/wizards/datatransfer/CSVImportDefinitionPage.java b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/wizards/datatransfer/CSVImportDefinitionPage.java index e09c21fdeb..06707b7442 100644 --- a/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/wizards/datatransfer/CSVImportDefinitionPage.java +++ b/name.abuchen.portfolio.ui/src/name/abuchen/portfolio/ui/wizards/datatransfer/CSVImportDefinitionPage.java @@ -8,7 +8,6 @@ import java.text.ParseException; import java.util.ArrayList; import java.util.Collections; -import java.util.Comparator; import java.util.EnumMap; import java.util.HashSet; import java.util.List; @@ -767,14 +766,7 @@ public Object[] getElements(Object inputElement) for (Enum entry : mapFormat.map().keySet()) elements.add(new Entry(mapFormat.map(), entry)); - Collections.sort(elements, new Comparator>() - { - @Override - public int compare(Entry e1, Entry e2) - { - return e1.key.name().compareTo(e2.key.name()); - } - }); + Collections.sort(elements, (e1, e2) -> e1.key.name().compareToIgnoreCase(e2.key.name())); return elements.toArray(); } diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/model/AttributeType.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/model/AttributeType.java index 142f4a68fd..bb28b978ce 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/model/AttributeType.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/model/AttributeType.java @@ -315,7 +315,7 @@ else if (o2 == null) else if (type == Double.class) return ((Double) o1).compareTo((Double) o2); else if (type == String.class) - return ((String) o1).compareTo((String) o2); + return ((String) o1).compareToIgnoreCase((String) o2); else return ((Comparable) o1).compareTo((Comparable) o2); } diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/model/Named.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/model/Named.java index a3c0e3436c..1b02f377b2 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/model/Named.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/model/Named.java @@ -17,7 +17,7 @@ public int compare(Named n1, Named n2) { if (n1 == null) return n2 == null ? 0 : -1; - return n1.getName().compareTo(n2.getName()); + return n1.getName().compareToIgnoreCase(n2.getName()); } } diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/model/Security.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/model/Security.java index 89b4902a91..c7a2c0c4c6 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/model/Security.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/model/Security.java @@ -23,7 +23,7 @@ public int compare(Security s1, Security s2) { if (s1 == null) return s2 == null ? 0 : -1; - return s1.name.compareTo(s2.name); + return s1.name.compareToIgnoreCase(s2.name); } } diff --git a/name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ClientPerformanceSnapshot.java b/name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ClientPerformanceSnapshot.java index 80b2578c7c..85d7fa4400 100644 --- a/name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ClientPerformanceSnapshot.java +++ b/name.abuchen.portfolio/src/name/abuchen/portfolio/snapshot/ClientPerformanceSnapshot.java @@ -269,7 +269,7 @@ private void addCapitalGains() capitalGains.positions = valuation.entrySet().stream() // .filter(entry -> !entry.getValue().isZero()) .map(entry -> new Position(entry.getKey(), entry.getValue().toMoney())) - .sorted((p1, p2) -> p1.getLabel().compareTo(p2.getLabel())) // + .sorted((p1, p2) -> p1.getLabel().compareToIgnoreCase(p2.getLabel())) // .collect(Collectors.toList()); // total capital gains -> sum it up @@ -375,7 +375,7 @@ private void addEarnings() // .filter(entry -> !entry.getValue().isZero()) .map(entry -> new Position(entry.getKey(), entry.getValue().toMoney())) - .sorted((p1, p2) -> p1.getLabel().compareTo(p2.getLabel())) // + .sorted((p1, p2) -> p1.getLabel().compareToIgnoreCase(p2.getLabel())) // .collect(Collectors.toList()); if (!otherEarnings.isZero())