Skip to content

Commit 56c0a12

Browse files
committed
Use isEmpty().
1 parent c59862d commit 56c0a12

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ public String colognePhonetic(final String text) {
328328
char lastChar = CHAR_IGNORE;
329329
char chr;
330330

331-
while (input.length() > 0) {
331+
while (!input.isEmpty()) {
332332
chr = input.removeNext();
333333

334-
if (input.length() > 0) {
334+
if (!input.isEmpty()) {
335335
nextChar = input.getNextChar();
336336
} else {
337337
nextChar = CHAR_IGNORE;

src/main/java/org/apache/commons/codec/language/bm/Languages.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public static Languages getInstance(final String languagesResourceName) {
184184
} else {
185185
if (line.startsWith(ResourceConstants.EXT_CMT_START)) {
186186
inExtendedComment = true;
187-
} else if (line.length() > 0) {
187+
} else if (!line.isEmpty()) {
188188
ls.add(line);
189189
}
190190
}

src/test/java/org/apache/commons/codec/language/bm/BeiderMorseEncoderTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public void testOOM() throws EncoderException {
147147
encoder.setMaxPhonemes(10);
148148

149149
final String phonemes = encoder.encode(phrase);
150-
assertTrue(phonemes.length() > 0);
150+
assertFalse(phonemes.isEmpty());
151151

152152
final String[] phonemeArr = phonemes.split("\\|");
153153
assertTrue(phonemeArr.length <= 10);

0 commit comments

Comments
 (0)