Skip to content

Commit 8be1e90

Browse files
committed
Use an import instead of a FQCN
1 parent 1825f01 commit 8be1e90

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

src/main/java/org/apache/commons/codec/language/Caverphone1.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.apache.commons.codec.language;
1919

20+
import java.util.Locale;
21+
2022
/**
2123
* Encodes a string into a Caverphone 1.0 value.
2224
*
@@ -55,7 +57,7 @@ public String encode(final String source) {
5557
}
5658

5759
// 1. Convert to lowercase
58-
txt = txt.toLowerCase(java.util.Locale.ENGLISH);
60+
txt = txt.toLowerCase(Locale.ENGLISH);
5961

6062
// 2. Remove anything not A-Z
6163
txt = txt.replaceAll("[^a-z]", "");

src/main/java/org/apache/commons/codec/language/Caverphone2.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.apache.commons.codec.language;
1919

20+
import java.util.Locale;
21+
2022
/**
2123
* Encodes a string into a Caverphone 2.0 value.
2224
*
@@ -55,7 +57,7 @@ public String encode(final String source) {
5557
}
5658

5759
// 1. Convert to lowercase
58-
txt = txt.toLowerCase(java.util.Locale.ENGLISH);
60+
txt = txt.toLowerCase(Locale.ENGLISH);
5961

6062
// 2. Remove anything not A-Z
6163
txt = txt.replaceAll("[^a-z]", "");

src/main/java/org/apache/commons/codec/language/DoubleMetaphone.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.apache.commons.codec.language;
1919

20+
import java.util.Locale;
21+
2022
import org.apache.commons.codec.EncoderException;
2123
import org.apache.commons.codec.StringEncoder;
2224
import org.apache.commons.codec.binary.StringUtils;
@@ -248,7 +250,7 @@ private String cleanInput(String input) {
248250
if (input.isEmpty()) {
249251
return null;
250252
}
251-
return input.toUpperCase(java.util.Locale.ENGLISH);
253+
return input.toUpperCase(Locale.ENGLISH);
252254
}
253255

254256
/**

src/main/java/org/apache/commons/codec/language/Metaphone.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.apache.commons.codec.language;
1919

20+
import java.util.Locale;
21+
2022
import org.apache.commons.codec.EncoderException;
2123
import org.apache.commons.codec.StringEncoder;
2224

@@ -175,10 +177,10 @@ public String metaphone(final String txt) {
175177
}
176178
// single character is itself
177179
if (txtLength == 1) {
178-
return txt.toUpperCase(java.util.Locale.ENGLISH);
180+
return txt.toUpperCase(Locale.ENGLISH);
179181
}
180182

181-
final char[] inwd = txt.toUpperCase(java.util.Locale.ENGLISH).toCharArray();
183+
final char[] inwd = txt.toUpperCase(Locale.ENGLISH).toCharArray();
182184

183185
final StringBuilder local = new StringBuilder(40); // manipulate
184186
final StringBuilder code = new StringBuilder(10); // output

src/main/java/org/apache/commons/codec/language/SoundexUtils.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717

1818
package org.apache.commons.codec.language;
1919

20+
import java.util.Locale;
21+
2022
import org.apache.commons.codec.EncoderException;
2123
import org.apache.commons.codec.StringEncoder;
2224

@@ -50,9 +52,9 @@ static String clean(final String str) {
5052
}
5153
}
5254
if (count == len) {
53-
return str.toUpperCase(java.util.Locale.ENGLISH);
55+
return str.toUpperCase(Locale.ENGLISH);
5456
}
55-
return new String(chars, 0, count).toUpperCase(java.util.Locale.ENGLISH);
57+
return new String(chars, 0, count).toUpperCase(Locale.ENGLISH);
5658
}
5759

5860
/**

0 commit comments

Comments
 (0)