Skip to content
Permalink
Browse files
Merge pull request #94 from arturobernalg/feature/use_contains
Replace indexOf() with contains()
  • Loading branch information
jochenw committed May 25, 2021
2 parents 5165528 + 7f02be4 commit e7ecf9e2b400f9d2dc7ea333578f171072eeec07
Showing 2 changed files with 3 additions and 3 deletions.
@@ -95,7 +95,7 @@ private MimeUtility() {
public static String decodeText(final String text) throws UnsupportedEncodingException {
// if the text contains any encoded tokens, those tokens will be marked with "=?". If the
// source string doesn't contain that sequent, no decoding is required.
if (text.indexOf(ENCODED_TOKEN_MARKER) < 0) {
if (!text.contains(ENCODED_TOKEN_MARKER)) {
return text;
}

@@ -265,7 +265,7 @@ public void testInvalidFileNameException() throws Exception {
} catch (final InvalidFileNameException e) {
assertEquals(fileName, e.getName());
assertEquals(-1, e.getMessage().indexOf(fileName));
assertTrue(e.getMessage().indexOf("foo.exe\\0.png") != -1);
assertTrue(e.getMessage().contains("foo.exe\\0.png"));
}

try {
@@ -274,7 +274,7 @@ public void testInvalidFileNameException() throws Exception {
} catch (final InvalidFileNameException e) {
assertEquals(fileName, e.getName());
assertEquals(-1, e.getMessage().indexOf(fileName));
assertTrue(e.getMessage().indexOf("foo.exe\\0.png") != -1);
assertTrue(e.getMessage().contains("foo.exe\\0.png"));
}
}

0 comments on commit e7ecf9e

Please sign in to comment.