Minor: Replace a number of trivial Guava usages with constructor calls and kotlin-stdlib function calls

This commit is contained in:
Yan Zhulanow
2018-06-01 18:03:19 +03:00
parent 61ffde54fd
commit ab5614eaac
44 changed files with 100 additions and 144 deletions
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.types;
import com.google.common.collect.Sets;
import com.intellij.openapi.project.Project;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.analyzer.AnalysisResult;
@@ -488,7 +487,7 @@ public class KotlinTypeCheckerTest extends KotlinTestWithEnvironment {
private void assertSupertypes(String typeStr, String... supertypeStrs) {
Set<KotlinType> allSupertypes = TypeUtils.getAllSupertypes(makeType(scopeWithImports, typeStr));
Set<KotlinType> expected = Sets.newHashSet();
Set<KotlinType> expected = new HashSet<>();
for (String supertypeStr : supertypeStrs) {
KotlinType supertype = makeType(scopeWithImports, supertypeStr);
expected.add(supertype);
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.types;
import com.google.common.collect.Maps;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
@@ -50,6 +49,7 @@ import org.jetbrains.kotlin.tests.di.InjectionKt;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@SuppressWarnings("unchecked")
@@ -127,7 +127,7 @@ public class TypeSubstitutorTest extends KotlinTestWithEnvironment {
}
private Map<TypeConstructor, TypeProjection> stringsToSubstitutionMap(Pair<String, String>[] substitutionStrs) {
Map<TypeConstructor, TypeProjection> map = Maps.newHashMap();
Map<TypeConstructor, TypeProjection> map = new HashMap();
for (Pair<String, String> pair : substitutionStrs) {
String typeParameterName = pair.first;
String replacementProjectionString = pair.second;
@@ -16,7 +16,6 @@
package org.jetbrains.kotlin.types;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
@@ -42,6 +41,7 @@ import org.jetbrains.kotlin.test.ConfigurationKind;
import org.jetbrains.kotlin.test.KotlinTestUtils;
import org.jetbrains.kotlin.test.KotlinTestWithEnvironment;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
@@ -163,7 +163,7 @@ public class TypeUnifierTest extends KotlinTestWithEnvironment {
}
private static Map<String, String> expect(boolean success, String... strs) {
Map<String, String> map = Maps.newHashMap();
Map<String, String> map = new HashMap<>();
putResult(map, success);
for (int i = 0; i < strs.length; i += 2) {
String key = strs[i];
@@ -180,7 +180,7 @@ public class TypeUnifierTest extends KotlinTestWithEnvironment {
@Nullable
private static Map<String, String> toStrings(TypeUnifier.UnificationResult map) {
Map<String, String> result = Maps.newHashMap();
Map<String, String> result = new HashMap<>();
putResult(result, map.isSuccess());
for (Map.Entry<TypeConstructor, TypeProjection> entry : map.getSubstitution().entrySet()) {
result.put(entry.getKey().toString(), entry.getValue().toString());