mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-17 18:50:49 +07:00
93e35b7334
1. Fixed modifiers for interfaces
2. Replacement wrapped with Collections.unmodifiableSet
3. Supported Java 1.4 and lower
4. Supported Guava ImmutableSet
5. Supported comparisons like s.equals("xyz"), Objects.equals(s, "xyz")
13 lines
346 B
Java
13 lines
346 B
Java
// "Extract Set from comparison chain" "true"
|
|
import java.util.*;
|
|
|
|
public class Test {
|
|
private static final Set<String> S = Collections.unmodifiableSet(new HashSet<>(Arrays.asList("foo", "bar", "baz", "quz")));
|
|
|
|
void testOr(String s) {
|
|
if(Objects.equals(s, null) || S.contains(s)) {
|
|
System.out.println("foobarbaz");
|
|
}
|
|
}
|
|
}
|