From 5a8e2130dfb516a88db29d69f55d9cd2be01b506 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 30 May 2018 09:31:08 +0200 Subject: [PATCH] Migrated code to Java 8. --- src/fr/devinsy/util/strings/StringList.java | 6 +++--- src/fr/devinsy/util/strings/demo/StringsDemo.java | 1 - test/fr/devinsy/util/strings/StringListTest.java | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/fr/devinsy/util/strings/StringList.java b/src/fr/devinsy/util/strings/StringList.java index 0ef2112..0f2fb26 100644 --- a/src/fr/devinsy/util/strings/StringList.java +++ b/src/fr/devinsy/util/strings/StringList.java @@ -1626,7 +1626,7 @@ public class StringList extends ArrayList implements CharSequence, Appen { StringList result; - Collections.sort(this, Collator.getInstance()); + sort(Collator.getInstance()); // result = this; @@ -1640,11 +1640,11 @@ public class StringList extends ArrayList implements CharSequence, Appen * * @return This List. */ - public StringList sort(final Comparator comparator) + public StringList sortBy(final Comparator comparator) { StringList result; - Collections.sort(this, comparator); + sort(comparator); // result = this; diff --git a/src/fr/devinsy/util/strings/demo/StringsDemo.java b/src/fr/devinsy/util/strings/demo/StringsDemo.java index b192c32..39d8481 100644 --- a/src/fr/devinsy/util/strings/demo/StringsDemo.java +++ b/src/fr/devinsy/util/strings/demo/StringsDemo.java @@ -29,7 +29,6 @@ import fr.devinsy.util.strings.StringsUtils; */ public class StringsDemo { - /** * The main method. * diff --git a/test/fr/devinsy/util/strings/StringListTest.java b/test/fr/devinsy/util/strings/StringListTest.java index c9b2b37..e43974a 100644 --- a/test/fr/devinsy/util/strings/StringListTest.java +++ b/test/fr/devinsy/util/strings/StringListTest.java @@ -369,7 +369,7 @@ public class StringListTest buffer.append("ghi"); Assert.assertTrue(buffer.containsAnyIgnoreCase("aaa", "bbb", "abc")); - Assert.assertTrue(buffer.containsAnyIgnoreCase("aaa", "bbb", "dbf")); + Assert.assertFalse(buffer.containsAnyIgnoreCase("aaa", "bbb", "dbf")); Assert.assertTrue(buffer.containsAnyIgnoreCase("aaa", "bbb", "ghi")); Assert.assertTrue(buffer.containsAnyIgnoreCase("aaa", "bbb", "Abc")); Assert.assertTrue(buffer.containsAnyIgnoreCase("aaa", "bbb", "dEf"));