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:10 UTC

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

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);
         }
     }