You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2020/06/22 13:33:07 UTC

[commons-lang] branch master updated (b7b4ae3 -> 5ffe008)

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git.


    from b7b4ae3  Formatting.
     new 64b2f90  Fix bug in test.
     new 91dafbc  Fix typos.
     new 5ffe008  Undo "fix", @DefaultLocale is used in this test.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../apache/commons/lang3/StringUtilsContainsTest.java | 19 ++++++-------------
 .../org/apache/commons/lang3/StringUtilsTest.java     |  8 ++++----
 2 files changed, 10 insertions(+), 17 deletions(-)


[commons-lang] 01/03: Fix bug in test.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit 64b2f90d20a20faab6e3cdbf6009475562740a87
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jun 22 09:28:58 2020 -0400

    Fix bug in test.
---
 .../apache/commons/lang3/StringUtilsContainsTest.java | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
index b543bf7..fb1db99 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
@@ -244,16 +244,21 @@ public class StringUtilsContainsTest  {
             { "\u00DF", "SS" },
         };
 
-        for (final Locale testLocale : locales) {
-            Locale.setDefault(testLocale);
-            for (int j = 0; j < tdata.length; j++) {
-                assertTrue(StringUtils.containsIgnoreCase(tdata[j][0], tdata[j][1]),
+        final Locale defaultLocale = Locale.getDefault();
+        try {
+            for (final Locale testLocale : locales) {
+                Locale.setDefault(testLocale);
+                for (int j = 0; j < tdata.length; j++) {
+                    assertTrue(StringUtils.containsIgnoreCase(tdata[j][0], tdata[j][1]),
                         Locale.getDefault() + ": " + j + " " + tdata[j][0] + " " + tdata[j][1]);
-            }
-            for (int j = 0; j < fdata.length; j++) {
-                assertFalse(StringUtils.containsIgnoreCase(fdata[j][0], fdata[j][1]),
+                }
+                for (int j = 0; j < fdata.length; j++) {
+                    assertFalse(StringUtils.containsIgnoreCase(fdata[j][0], fdata[j][1]),
                         Locale.getDefault() + ": " + j + " " + fdata[j][0] + " " + fdata[j][1]);
+                }
             }
+        } finally {
+            Locale.setDefault(defaultLocale);
         }
     }
 


[commons-lang] 02/03: Fix typos.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit 91dafbcea8fe66127d5fbab5bb06d7712701feba
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jun 22 09:29:31 2020 -0400

    Fix typos.
---
 src/test/java/org/apache/commons/lang3/StringUtilsTest.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
index 3230aa0..622cad5 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsTest.java
@@ -3279,12 +3279,12 @@ public class StringUtilsTest {
         assertEquals("title", "TITLE".toLowerCase(Locale.ROOT));
         assertEquals("title", StringUtils.toRootLowerCase("TITLE"));
         // Make sure we are not using the default Locale:
-        final Locale defaultLocales = Locale.getDefault();
+        final Locale defaultLocale = Locale.getDefault();
         try {
             Locale.setDefault(TURKISH);
             assertEquals("title", StringUtils.toRootLowerCase("TITLE"));
         } finally {
-            Locale.setDefault(defaultLocales);
+            Locale.setDefault(defaultLocale);
         }
     }
 
@@ -3299,12 +3299,12 @@ public class StringUtilsTest {
         assertEquals("TITLE", "title".toUpperCase(Locale.ROOT));
         assertEquals("TITLE", StringUtils.toRootUpperCase("title"));
         // Make sure we are not using the default Locale:
-        final Locale defaultLocales = Locale.getDefault();
+        final Locale defaultLocale = Locale.getDefault();
         try {
             Locale.setDefault(TURKISH);
             assertEquals("TITLE", StringUtils.toRootUpperCase("title"));
         } finally {
-            Locale.setDefault(defaultLocales);
+            Locale.setDefault(defaultLocale);
         }
     }
 


[commons-lang] 03/03: Undo "fix", @DefaultLocale is used in this test.

Posted by gg...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git

commit 5ffe0080744ba6ed2707767653a673d51d2c0c23
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Jun 22 09:32:10 2020 -0400

    Undo "fix", @DefaultLocale is used in this test.
---
 .../commons/lang3/StringUtilsContainsTest.java     | 40 ++++++++--------------
 1 file changed, 14 insertions(+), 26 deletions(-)

diff --git a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
index fb1db99..4a0a4cc 100644
--- a/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
+++ b/src/test/java/org/apache/commons/lang3/StringUtilsContainsTest.java
@@ -232,33 +232,21 @@ public class StringUtilsContainsTest  {
     public void testContainsIgnoreCase_LocaleIndependence() {
         final Locale[] locales = { Locale.ENGLISH, new Locale("tr"), Locale.getDefault() };
 
-        final String[][] tdata = {
-            { "i", "I" },
-            { "I", "i" },
-            { "\u03C2", "\u03C3" },
-            { "\u03A3", "\u03C2" },
-            { "\u03A3", "\u03C3" },
-        };
-
-        final String[][] fdata = {
-            { "\u00DF", "SS" },
-        };
-
-        final Locale defaultLocale = Locale.getDefault();
-        try {
-            for (final Locale testLocale : locales) {
-                Locale.setDefault(testLocale);
-                for (int j = 0; j < tdata.length; j++) {
-                    assertTrue(StringUtils.containsIgnoreCase(tdata[j][0], tdata[j][1]),
-                        Locale.getDefault() + ": " + j + " " + tdata[j][0] + " " + tdata[j][1]);
-                }
-                for (int j = 0; j < fdata.length; j++) {
-                    assertFalse(StringUtils.containsIgnoreCase(fdata[j][0], fdata[j][1]),
-                        Locale.getDefault() + ": " + j + " " + fdata[j][0] + " " + fdata[j][1]);
-                }
+        final String[][] tdata = { { "i", "I" }, { "I", "i" }, { "\u03C2", "\u03C3" }, { "\u03A3", "\u03C2" },
+            { "\u03A3", "\u03C3" }, };
+
+        final String[][] fdata = { { "\u00DF", "SS" }, };
+
+        for (final Locale testLocale : locales) {
+            Locale.setDefault(testLocale);
+            for (int j = 0; j < tdata.length; j++) {
+                assertTrue(StringUtils.containsIgnoreCase(tdata[j][0], tdata[j][1]),
+                    Locale.getDefault() + ": " + j + " " + tdata[j][0] + " " + tdata[j][1]);
+            }
+            for (int j = 0; j < fdata.length; j++) {
+                assertFalse(StringUtils.containsIgnoreCase(fdata[j][0], fdata[j][1]),
+                    Locale.getDefault() + ": " + j + " " + fdata[j][0] + " " + fdata[j][1]);
             }
-        } finally {
-            Locale.setDefault(defaultLocale);
         }
     }