mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-26 19:06:24 +07:00
StreamToLoop: unwrap negation and ternary; minor refactoring
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// "Replace Stream API chain with loop" "true"
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Main {
|
||||
boolean test(String[] strings) {
|
||||
for (String s : strings) {
|
||||
if (Objects.nonNull(s)) {
|
||||
if (!s.startsWith("xyz")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user