Use unmodifiableSet in Analysis#getColumnReferences
Previously a copy of set was made that used
equality instead of identity for comparisons.
@@ -39,7 +39,6 @@ import com.google.common.base.Preconditions;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
import com.google.common.collect.ListMultimap;
import javax.annotation.concurrent.Immutable;
@@ -54,6 +53,7 @@ import java.util.Set;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Collections.newSetFromMap;
+import static java.util.Collections.unmodifiableSet;
import static java.util.Objects.requireNonNull;
public class Analysis
@@ -398,7 +398,7 @@ public class Analysis
public Set<Expression> getColumnReferences()
{
- return ImmutableSet.copyOf(columnReferences);
+ return unmodifiableSet(columnReferences);
}
public void addTypes(IdentityLinkedHashMap<Expression, Type> types)
