ExtractSetFromComparisonChainAction: i18n, java9 test, disable in Java 1.4 or lower (as varargs and generics aren't available there)

This commit is contained in:
Tagir Valeev
2017-03-22 18:28:43 +07:00
parent cad495c025
commit d9702d7d8d
5 changed files with 31 additions and 2 deletions

View File

@@ -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");
}
}
}

View File

@@ -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");
}
}
}