Replace indexOf calls with String#contains
Change-Id: Ib5f46fb846097d032490a85095669cb37b42c709
This commit is contained in:
@@ -189,6 +189,6 @@ class OAuthWebFilter implements Filter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isGerritLogin(HttpServletRequest request) {
|
private static boolean isGerritLogin(HttpServletRequest request) {
|
||||||
return request.getRequestURI().indexOf(GERRIT_LOGIN) >= 0;
|
return request.getRequestURI().contains(GERRIT_LOGIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -364,6 +364,6 @@ class LoginForm extends HttpServlet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isGerritLogin(HttpServletRequest request) {
|
private static boolean isGerritLogin(HttpServletRequest request) {
|
||||||
return request.getRequestURI().indexOf(OAuthSessionOverOpenID.GERRIT_LOGIN) >= 0;
|
return request.getRequestURI().contains(OAuthSessionOverOpenID.GERRIT_LOGIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,6 +90,6 @@ class OAuthWebFilterOverOpenID implements Filter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isGerritLogin(HttpServletRequest request) {
|
private static boolean isGerritLogin(HttpServletRequest request) {
|
||||||
return request.getRequestURI().indexOf(GERRIT_LOGIN) >= 0;
|
return request.getRequestURI().contains(GERRIT_LOGIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -335,9 +335,9 @@ public class CommitValidators {
|
|||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("ERROR: ").append(errMsg);
|
sb.append("ERROR: ").append(errMsg);
|
||||||
|
|
||||||
if (c.getFullMessage().indexOf(CHANGE_ID_PREFIX) >= 0) {
|
if (c.getFullMessage().contains(CHANGE_ID_PREFIX)) {
|
||||||
String lastLine = Iterables.getLast(Splitter.on('\n').split(c.getFullMessage()), "");
|
String lastLine = Iterables.getLast(Splitter.on('\n').split(c.getFullMessage()), "");
|
||||||
if (lastLine.indexOf(CHANGE_ID_PREFIX) == -1) {
|
if (!lastLine.contains(CHANGE_ID_PREFIX)) {
|
||||||
sb.append('\n');
|
sb.append('\n');
|
||||||
sb.append('\n');
|
sb.append('\n');
|
||||||
sb.append("Hint: A potential ");
|
sb.append("Hint: A potential ");
|
||||||
|
|||||||
Reference in New Issue
Block a user