Skip to content

Commit

Permalink
Use String.contains instead of indexOf
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <fbricon@gmail.com>
  • Loading branch information
fbricon authored and datho7561 committed May 26, 2021
1 parent 7ce8901 commit a309a17
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Expand Up @@ -224,7 +224,7 @@ private static String getEntityName(Diagnostic diagnostic, DOMDocument doc) thro
Range range = diagnostic.getRange();
String name = doc.getText().substring(doc.offsetAt(range.getStart()), doc.offsetAt(range.getEnd()));
String removedAmpAndSemiColon = name.substring(1, name.length() - 1);
if (diagnostic.getMessage().indexOf("\"" + removedAmpAndSemiColon + "\"") < 0) {
if (!diagnostic.getMessage().contains("\"" + removedAmpAndSemiColon + "\"")) {
return null;
}
return removedAmpAndSemiColon;
Expand Down
Expand Up @@ -26,7 +26,7 @@ public OS() {
this.name = Platform.getSystemProperty("os.name");
this.version = Platform.getSystemProperty("os.version");
this.arch = Platform.getSystemProperty("os.arch");
isWindows = name != null && name.toLowerCase().indexOf("win") >= 0;
isWindows = name != null && name.toLowerCase().contains("win");
}

/**
Expand Down

0 comments on commit a309a17

Please sign in to comment.