Remove useless checks from evil JNA tests
This commit removes some useless empty lines checks from the evil JNA
tests. These empty lines checks are useless because if the lines are
actually empty, the for loop will never be entered and we will hit the
fail condition at the bottom as intended anyway.
@@ -36,7 +36,6 @@ public class EvilJNANativesTests extends ESTestCase {
public void testSetMaximumNumberOfThreads() throws IOException {
if (Constants.LINUX) {
final List<String> lines = Files.readAllLines(PathUtils.get("/proc/self/limits"));
- if (!lines.isEmpty()) {
for (final String line : lines) {
if (line != null && line.startsWith("Max processes")) {
final String[] fields = line.split("\\s+");
@@ -48,7 +47,6 @@ public class EvilJNANativesTests extends ESTestCase {
return;
}
}
- }
fail("should have read max processes from /proc/self/limits");
} else {
assertThat(JNANatives.MAX_NUMBER_OF_THREADS, equalTo(-1L));
@@ -58,7 +56,6 @@ public class EvilJNANativesTests extends ESTestCase {
public void testSetMaxSizeVirtualMemory() throws IOException {
if (Constants.LINUX) {
final List<String> lines = Files.readAllLines(PathUtils.get("/proc/self/limits"));
- if (!lines.isEmpty()) {
for (final String line : lines) {
if (line != null && line.startsWith("Max address space")) {
final String[] fields = line.split("\\s+");
@@ -69,7 +66,6 @@ public class EvilJNANativesTests extends ESTestCase {
return;
}
}
- }
fail("should have read max size virtual memory from /proc/self/limits");
} else if (Constants.MAC_OS_X) {
assertThat(
