Delete CommonSuppliers, use Guava directly

This commit is contained in:
Alexander Udalov
2014-03-28 19:30:58 +04:00
parent 7c4079fd32
commit d719222bc4
6 changed files with 11 additions and 87 deletions
@@ -21,9 +21,9 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.types.JetType;
import org.jetbrains.jet.lang.types.TypeUtils;
import org.jetbrains.jet.utils.CommonSuppliers;
import java.util.*;
import java.util.Map;
import java.util.Set;
import static org.jetbrains.jet.lang.resolve.calls.autocasts.Nullability.NOT_NULL;
@@ -228,8 +228,7 @@ import static org.jetbrains.jet.lang.resolve.calls.autocasts.Nullability.NOT_NUL
@NotNull
/* package */ static SetMultimap<DataFlowValue, JetType> newTypeInfo() {
return Multimaps.newSetMultimap(Maps.<DataFlowValue, Collection<JetType>>newHashMap(),
CommonSuppliers.<JetType>getLinkedHashSetSupplier());
return LinkedHashMultimap.create();
}
@Override
@@ -16,13 +16,13 @@
package org.jetbrains.jet.lang.types;
import com.google.common.collect.LinkedHashMultimap;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
import org.jetbrains.jet.utils.CommonSuppliers;
import java.util.List;
import java.util.Map;
@@ -58,7 +58,7 @@ public class SubstitutionUtils {
*/
@NotNull
public static Multimap<TypeConstructor, TypeProjection> buildDeepSubstitutionMultimap(@NotNull JetType type) {
Multimap<TypeConstructor, TypeProjection> fullSubstitution = CommonSuppliers.newLinkedHashSetHashSetMultimap();
Multimap<TypeConstructor, TypeProjection> fullSubstitution = LinkedHashMultimap.create();
Map<TypeConstructor, TypeProjection> substitution = Maps.newHashMap();
TypeSubstitutor typeSubstitutor = TypeSubstitutor.create(substitution);
// we use the mutability of the map here
@@ -16,15 +16,13 @@
package org.jetbrains.jet.util.slicedmap;
import com.google.common.collect.ArrayListMultimap;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.utils.CommonSuppliers;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -43,7 +41,7 @@ public class SlicedMapImpl implements MutableSlicedMap {
}
private final Map<SlicedMapKey<?, ?>, Object> map;
private final Multimap<WritableSlice<?, ?>, Object> collectiveSliceKeys = Multimaps.newListMultimap(new HashMap<WritableSlice<?, ?>, Collection<Object>>(), CommonSuppliers.getArrayListSupplier());
private final Multimap<WritableSlice<?, ?>, Object> collectiveSliceKeys = ArrayListMultimap.create();
protected SlicedMapImpl(Map<SlicedMapKey<?, ?>, Object> map) {
this.map = map;