Merge "Replace 'indexOf()' expression with 'contains()'"
This commit is contained in:
commit
2a2bfa483b
@ -45,13 +45,13 @@ public class UserAgentRule implements Rule {
|
|||||||
|
|
||||||
ua = ua.toLowerCase();
|
ua = ua.toLowerCase();
|
||||||
|
|
||||||
if (ua.indexOf("opera") != -1) {
|
if (ua.contains("opera")) {
|
||||||
return "opera";
|
return "opera";
|
||||||
|
|
||||||
} else if (ua.indexOf("webkit") != -1) {
|
} else if (ua.contains("webkit")) {
|
||||||
return "safari";
|
return "safari";
|
||||||
|
|
||||||
} else if (ua.indexOf("msie") != -1) {
|
} else if (ua.contains("msie")) {
|
||||||
// GWT 2.0 uses document.documentMode here, which we can't do
|
// GWT 2.0 uses document.documentMode here, which we can't do
|
||||||
// on the server side.
|
// on the server side.
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ public class UserAgentRule implements Rule {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
} else if (ua.indexOf("gecko") != -1) {
|
} else if (ua.contains("gecko")) {
|
||||||
Matcher m = gecko.matcher(ua);
|
Matcher m = gecko.matcher(ua);
|
||||||
if (m.matches() && m.groupCount() == 2) {
|
if (m.matches() && m.groupCount() == 2) {
|
||||||
if (makeVersion(m) >= 1008) {
|
if (makeVersion(m) >= 1008) {
|
||||||
|
@ -123,7 +123,7 @@ class GitWebServlet extends HttpServlet {
|
|||||||
|
|
||||||
if (!_env.envMap.containsKey("SystemRoot")) {
|
if (!_env.envMap.containsKey("SystemRoot")) {
|
||||||
String os = System.getProperty("os.name");
|
String os = System.getProperty("os.name");
|
||||||
if (os != null && os.toLowerCase().indexOf("windows") != -1) {
|
if (os != null && os.toLowerCase().contains("windows")) {
|
||||||
String sysroot = System.getenv("SystemRoot");
|
String sysroot = System.getenv("SystemRoot");
|
||||||
if (sysroot == null || sysroot.isEmpty()) {
|
if (sysroot == null || sysroot.isEmpty()) {
|
||||||
sysroot = "C:\\WINDOWS";
|
sysroot = "C:\\WINDOWS";
|
||||||
|
@ -931,7 +931,7 @@ public class RestApiServlet extends HttpServlet {
|
|||||||
private static boolean acceptsGzip(HttpServletRequest req) {
|
private static boolean acceptsGzip(HttpServletRequest req) {
|
||||||
if (req != null) {
|
if (req != null) {
|
||||||
String accepts = req.getHeader(HttpHeaders.ACCEPT_ENCODING);
|
String accepts = req.getHeader(HttpHeaders.ACCEPT_ENCODING);
|
||||||
return accepts != null && accepts.indexOf("gzip") != -1;
|
return accepts != null && accepts.contains("gzip");
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ final class ProxyUtil {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final URL u = new URL((s.indexOf("://") == -1) ? "http://" + s : s);
|
final URL u = new URL((!s.contains("://")) ? "http://" + s : s);
|
||||||
if (!"http".equals(u.getProtocol())) {
|
if (!"http".equals(u.getProtocol())) {
|
||||||
throw new MalformedURLException("Invalid http_proxy: " + s
|
throw new MalformedURLException("Invalid http_proxy: " + s
|
||||||
+ ": Only http supported.");
|
+ ": Only http supported.");
|
||||||
|
@ -80,7 +80,7 @@ public class Schema_81 extends SchemaVersion {
|
|||||||
public boolean accept(File pathname) {
|
public boolean accept(File pathname) {
|
||||||
String n = pathname.getName();
|
String n = pathname.getName();
|
||||||
return (n.endsWith(".jar") || n.endsWith(".jar.disabled"))
|
return (n.endsWith(".jar") || n.endsWith(".jar.disabled"))
|
||||||
&& pathname.isFile() && n.indexOf("replication") >= 0;
|
&& pathname.isFile() && n.contains("replication");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ public final class HostPlatform {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
return osDotName != null
|
return osDotName != null
|
||||||
&& osDotName.toLowerCase().indexOf("windows") != -1;
|
&& osDotName.toLowerCase().contains("windows");
|
||||||
}
|
}
|
||||||
|
|
||||||
private HostPlatform() {
|
private HostPlatform() {
|
||||||
|
Loading…
Reference in New Issue
Block a user