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

@ -157,7 +157,7 @@ public class HttpCapture {
if (p.matcher(s).find()) {
String f = capFiles.get(i);
File fi;
if (f.indexOf("%d") >= 0) {
if (f.contains("%d")) {
java.util.Random rand = new java.util.Random();
do {
String f2 = f.replace("%d", Integer.toString(rand.nextInt()));

View file

@ -645,7 +645,7 @@ final class HttpsClient extends HttpClient
// ignore
}
if ((cipher != null) && (cipher.indexOf("_anon_") != -1)) {
if ((cipher != null) && (cipher.contains("_anon_"))) {
return;
} else if ((hostnameVerifier != null) &&
(hostnameVerifier.verify(host, session))) {