8274949: Use String.contains() instead of String.indexOf() in java.base

Reviewed-by: weijun, dfuchs, vtewari, lancea
This commit is contained in:
Andrey Turbanov 2021-11-19 18:48:06 +00:00 committed by Roger Riggs
parent 09e8c8c64a
commit 6677554374
17 changed files with 35 additions and 38 deletions

View file

@ -1473,10 +1473,10 @@ public final class Main {
if (s == null) break;
// OpenSSL does not use NEW
//if (s.startsWith("-----BEGIN NEW CERTIFICATE REQUEST-----")) {
if (s.startsWith("-----BEGIN") && s.indexOf("REQUEST") >= 0) {
if (s.startsWith("-----BEGIN") && s.contains("REQUEST")) {
canRead = true;
//} else if (s.startsWith("-----END NEW CERTIFICATE REQUEST-----")) {
} else if (s.startsWith("-----END") && s.indexOf("REQUEST") >= 0) {
} else if (s.startsWith("-----END") && s.contains("REQUEST")) {
break;
} else if (canRead) {
sb.append(s);