Use String.contains

This commit is contained in:
SiboVG 2024-08-09 05:20:51 +02:00
parent fd3f2e167c
commit 4952320030
2 changed files with 4 additions and 4 deletions

View File

@ -28,9 +28,9 @@ public class SystemInfo {
public static Platform getPlatform() {
String os = System.getProperty("os.name").toLowerCase(Locale.ENGLISH);
if (os.indexOf("win") >= 0) {
if (os.contains("win")) {
return Platform.WINDOWS;
} else if (os.indexOf("mac") >= 0) {
} else if (os.contains("mac")) {
return Platform.MAC_OS;
} else {
/*

View File

@ -44,8 +44,8 @@ public class BugReportTest {
check(connection);
String msg = connection.getOutputStreamString();
assertTrue(msg.indexOf("version=" + BuildProperties.getVersion()) >= 0);
assertTrue(msg.indexOf(Communicator.encode(message)) >= 0);
assertTrue(msg.contains("version=" + BuildProperties.getVersion()));
assertTrue(msg.contains(Communicator.encode(message)));
}
@Test