doNotSendActsAsWhitelist not works properly as expected
shikendon opened this issue ยท 2 comments
In whitelist case, it means the line
need to contain all phrases of the array.
Example:
Boolean doNotSendActsAsWhitelist = true;
String line = "shikendon lost connection: Timed out";
String[] phrases = new String[]{"Timed out", "Whatever"};
for (String phrase : phrases)
if (line.contains(phrase) == !doNotSendActsAsWhitelist) return;
System.out.println(line); // Unreachable
Expected:
// import java.util.Arrays;
Boolean doNotSendActsAsWhitelist = true;
String line = "shikendon lost connection: Timed out";
String[] phrases = new String[]{"Timed out", "Whatever"};
if (Arrays.stream(phrases).parallel().anyMatch(line::contains) == !doNotSendActsAsWhitelist) return;
System.out.println(line); // shikendon lost connection: Timed out
Message should be send when line
contains any phrases of whitelist.