mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
26 lines
557 B
Java
26 lines
557 B
Java
// "Call 'toArray(new String[0])'" "true-preview"
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
|
|
class Test {
|
|
static <T> boolean contains(T needle, T... haystack) {
|
|
for (final T t : haystack) {
|
|
if (Objects.equals(t, needle)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
static <T> boolean contains(String needle, String... haystack) {
|
|
return contains((Object)needle, (Object[])haystack);
|
|
}
|
|
|
|
void use(String s) {
|
|
if (contains(s, getList().toArray(new String[0]))) {
|
|
|
|
}
|
|
}
|
|
|
|
native List<String> getList();
|
|
} |