mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
ExtractSetFromComparisonChainAction: i18n, java9 test, disable in Java 1.4 or lower (as varargs and generics aren't available there)
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import java.util.Set;
|
||||
|
||||
// "Extract Set from comparison chain" "true"
|
||||
public class Test {
|
||||
private static final Set<String> PROPERTIES = Set.of("foo", "bar", "baz");
|
||||
|
||||
void testOr(int i, String property) {
|
||||
if(i > 0 || PROPERTIES.contains(property) || i == -10) {
|
||||
System.out.println("foobarbaz");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// "Extract Set from comparison chain" "true"
|
||||
public class Test {
|
||||
void testOr(int i, String property) {
|
||||
if(i > 0 || "foo"<caret>.equals(property) || "bar".equals(property) || "baz".equals(property) || i == -10) {
|
||||
System.out.println("foobarbaz");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user