Merge pull request #11373 from izeye:contains

* pr/11373:
  Replace contains() with indexOf()
pull/11400/merge
Stephane Nicoll 7 years ago
commit 691183a66e

@ -95,8 +95,8 @@ public class AuditEvent implements Serializable {
private static Map<String, Object> convert(String[] data) {
Map<String, Object> result = new HashMap<>();
for (String entry : data) {
if (entry.contains("=")) {
int index = entry.indexOf("=");
int index = entry.indexOf("=");
if (index != -1) {
result.put(entry.substring(0, index), entry.substring(index + 1));
}
else {

@ -39,7 +39,6 @@ public class Link {
public Link(String href) {
this.href = href;
this.templated = href.contains("{");
}
/**

@ -303,8 +303,9 @@ public class ServerProperties {
public String getServletPrefix() {
String result = this.path;
if (result.contains("*")) {
result = result.substring(0, result.indexOf("*"));
int index = result.indexOf("*");
if (index != -1) {
result = result.substring(0, index);
}
if (result.endsWith("/")) {
result = result.substring(0, result.length() - 1);

@ -498,8 +498,8 @@ public class PropertiesLauncher extends Launcher {
// If home dir is same as parent archive, no need to add it twice.
return null;
}
if (root.contains("!")) {
int index = root.indexOf("!");
int index = root.indexOf("!");
if (index != -1) {
File file = new File(this.home, root.substring(0, index));
if (root.startsWith("jar:file:")) {
file = new File(root.substring("jar:file:".length(), index));

@ -109,8 +109,9 @@ class DocumentRoot {
else {
path = location.toURI().getPath();
}
if (path.contains("!/")) {
path = path.substring(0, path.indexOf("!/"));
int index = path.indexOf("!/");
if (index != -1) {
path = path.substring(0, index);
}
return new File(path);
}

Loading…
Cancel
Save