Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/extractSetFromComparison/beforeGuava.java
Tagir Valeev 93e35b7334 ExtractSetFromComparisonChainAction improvements (IDEA-CR-19606)
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")
2017-03-27 12:35:02 +07:00

18 lines
355 B
Java

// "Extract Set from comparison chain" "true"
package com.google.common.collect;
class ImmutableSet<T> {
public static <T> ImmutableSet<T> of(T... elements) {
return null;
}
}
public class Test {
void testOr(String s) {
if("foo"<caret>.equals(s) || "bar".equals(s) || "baz".equals(s)) {
System.out.println("foobarbaz");
}
}
}