Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace indexOf() with contains() #94

Merged
merged 1 commit into from May 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -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;
}

Expand Down
Expand Up @@ -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 {
Expand All @@ -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"));
}
}

Expand Down