diff --git a/lib/annotations/guava/com/google/common/collect/annotations.xml b/lib/annotations/guava/com/google/common/collect/annotations.xml index 0196e87fae46..40f3cf819dd3 100644 --- a/lib/annotations/guava/com/google/common/collect/annotations.xml +++ b/lib/annotations/guava/com/google/common/collect/annotations.xml @@ -15,4 +15,13 @@ name='com.google.common.collect.Lists java.util.concurrent.CopyOnWriteArrayList<E> newCopyOnWriteArrayList(java.lang.Iterable<? extends E>)'> + + + + + + + + + \ No newline at end of file diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java index 442f579b162a..bdd3b680d711 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/PostfixLiveTemplate.java @@ -1,7 +1,6 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.codeInsight.template.postfix.templates; -import com.google.common.collect.Sets; import com.intellij.codeInsight.CodeInsightBundle; import com.intellij.codeInsight.completion.OffsetTranslator; import com.intellij.codeInsight.template.CustomLiveTemplateBase; @@ -47,7 +46,7 @@ public class PostfixLiveTemplate extends CustomLiveTemplateBase { @NotNull public Set getAllTemplateKeys(PsiFile file, int offset) { - Set keys = Sets.newHashSet(); + Set keys = new HashSet(); Language language = PsiUtilCore.getLanguageAtOffset(file, offset); for (PostfixTemplateProvider provider : LanguagePostfixTemplate.LANG_EP.allForLanguage(language)) { ProgressManager.checkCanceled(); diff --git a/platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java b/platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java index 7a553ce8643c..0309da3b232a 100644 --- a/platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java +++ b/platform/lang-impl/src/com/intellij/lang/javascript/boilerplate/GithubProjectGeneratorPeer.java @@ -1,7 +1,6 @@ // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.lang.javascript.boilerplate; -import com.google.common.collect.Sets; import com.intellij.BundleBase; import com.intellij.CommonBundle; import com.intellij.ide.IdeBundle; @@ -19,10 +18,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Set; +import java.util.*; /** * @author Sergey Simonchik @@ -71,7 +67,7 @@ public class GithubProjectGeneratorPeer implements WebProjectGenerator.Generator return true; } int count = myComboBox.getItemCount(); - Set oldTags = Sets.newHashSet(); + Set oldTags = new HashSet(); for (int i = 1; i < count; i++) { GithubTagInfo item = ObjectUtils.tryCast(myComboBox.getItemAt(i), GithubTagInfo.class); if (item != null) { diff --git a/platform/platform-impl/src/com/intellij/remote/RemoteSdkPropertiesHolder.java b/platform/platform-impl/src/com/intellij/remote/RemoteSdkPropertiesHolder.java index 3444cc4d550e..ee526a17987e 100644 --- a/platform/platform-impl/src/com/intellij/remote/RemoteSdkPropertiesHolder.java +++ b/platform/platform-impl/src/com/intellij/remote/RemoteSdkPropertiesHolder.java @@ -1,7 +1,6 @@ // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.remote; -import com.google.common.collect.Sets; import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.PathMappingSettings; import org.jdom.Element; @@ -9,6 +8,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Set; +import java.util.TreeSet; public class RemoteSdkPropertiesHolder implements RemoteSdkProperties { private static final String INTERPRETER_PATH = "INTERPRETER_PATH"; @@ -29,7 +29,7 @@ public class RemoteSdkPropertiesHolder implements RemoteSdkProperties { private boolean myHelpersVersionChecked = false; - private Set myRemoteRoots = Sets.newTreeSet(); + private Set myRemoteRoots = new TreeSet(); private boolean myInitialized = false; diff --git a/python/pydevSrc/com/jetbrains/python/debugger/pydev/MultiProcessDebugger.java b/python/pydevSrc/com/jetbrains/python/debugger/pydev/MultiProcessDebugger.java index 4ebe60b3d202..c2dc65031f69 100644 --- a/python/pydevSrc/com/jetbrains/python/debugger/pydev/MultiProcessDebugger.java +++ b/python/pydevSrc/com/jetbrains/python/debugger/pydev/MultiProcessDebugger.java @@ -4,7 +4,6 @@ package com.jetbrains.python.debugger.pydev; import com.google.common.collect.Collections2; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import com.google.common.collect.Sets; import com.intellij.execution.ExecutionException; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.diagnostic.Logger; @@ -502,7 +501,7 @@ public class MultiProcessDebugger implements ProcessDebugger { } private Set collectThreads(RemoteDebugger debugger) { - Set result = Sets.newHashSet(); + Set result = new HashSet(); for (Map.Entry entry : myMultiProcessDebugger.myThreadRegistry.myThreadIdToDebugger.entrySet()) { if (entry.getValue() == debugger) { result.add(entry.getKey()); diff --git a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/completion/PyStructuralTypeAttributesCompletionContributor.java b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/completion/PyStructuralTypeAttributesCompletionContributor.java index 6c998062355c..c39708449592 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/completion/PyStructuralTypeAttributesCompletionContributor.java +++ b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/completion/PyStructuralTypeAttributesCompletionContributor.java @@ -20,10 +20,7 @@ import com.jetbrains.python.psi.stubs.PyClassAttributesIndex; import com.jetbrains.python.psi.types.*; import org.jetbrains.annotations.NotNull; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; -import java.util.Set; +import java.util.*; import static com.intellij.patterns.PlatformPatterns.psiElement; import static com.jetbrains.python.psi.PyUtil.as; @@ -103,7 +100,7 @@ public class PyStructuralTypeAttributesCompletionContributor extends CompletionC private Set suggestClassesFromUsedAttributes(@NotNull PsiElement anchor, @NotNull Set seenAttrs, @NotNull TypeEvalContext context) { - final Set candidates = Sets.newHashSet(); + final Set candidates = new HashSet(); final Map> ancestorsCache = Maps.newHashMap(); for (String attribute : seenAttrs) { // Search for some of these attributes like __init__ may produce thousands of candidates in average SDK @@ -120,7 +117,7 @@ public class PyStructuralTypeAttributesCompletionContributor extends CompletionC } } - final Set suitableClasses = Sets.newHashSet(); + final Set suitableClasses = new HashSet(); for (PyClass candidate : candidates) { if (PyUserSkeletonsUtil.isUnderUserSkeletonsDirectory(candidate.getContainingFile())) { continue; @@ -162,7 +159,7 @@ public class PyStructuralTypeAttributesCompletionContributor extends CompletionC } // Sentinel value to prevent infinite recursion ancestorsCache.put(pyClass, Collections.emptySet()); - final Set result = Sets.newHashSet(); + final Set result = new HashSet(); try { for (final PyClassLikeType baseType : pyClass.getSuperClassTypes(context)) { if (!(baseType instanceof PyClassType)) { @@ -180,7 +177,7 @@ public class PyStructuralTypeAttributesCompletionContributor extends CompletionC } return result; } - + @NotNull private static String debugClassCoordinates(PyClass cls) { return cls.getQualifiedName() + " (" + cls.getContainingFile().getVirtualFile().getPath() + ")"; diff --git a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/dataflow/scope/impl/ScopeImpl.java b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/dataflow/scope/impl/ScopeImpl.java index 98559c61e844..963e3f1210b2 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/dataflow/scope/impl/ScopeImpl.java +++ b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/dataflow/scope/impl/ScopeImpl.java @@ -3,7 +3,6 @@ // found in the LICENSE file. package com.jetbrains.python.codeInsight.dataflow.scope.impl; -import com.google.common.collect.Sets; import com.intellij.codeInsight.controlflow.Instruction; import com.intellij.codeInsight.dataflow.DFALimitExceededException; import com.intellij.codeInsight.dataflow.map.DFAMap; @@ -301,7 +300,7 @@ public class ScopeImpl implements Scope { } private void processNamedElement(@NotNull PsiNamedElement element) { - namedElements.computeIfAbsent(element.getName(), __ -> Sets.newLinkedHashSet()).add(element); + namedElements.computeIfAbsent(element.getName(), __ -> new LinkedHashSet()).add(element); } }); diff --git a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/typing/PyTypingTypeProvider.java b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/typing/PyTypingTypeProvider.java index b3f049436e76..80e951d79c4a 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/codeInsight/typing/PyTypingTypeProvider.java +++ b/python/python-psi-impl/src/com/jetbrains/python/codeInsight/typing/PyTypingTypeProvider.java @@ -3,7 +3,6 @@ package com.jetbrains.python.codeInsight.typing; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.Ref; import com.intellij.openapi.util.TextRange; @@ -1363,7 +1362,7 @@ public class PyTypingTypeProvider extends PyTypeProviderBase { @NotNull public static Collection resolveToQualifiedNames(@NotNull PyExpression expression, @NotNull TypeEvalContext context) { - final Set names = Sets.newLinkedHashSet(); + final Set names = new LinkedHashSet(); for (PsiElement resolved : tryResolving(expression, context)) { final String name = getQualifiedName(resolved); if (name != null) { diff --git a/python/python-psi-impl/src/com/jetbrains/python/documentation/docstrings/PyDocstringGenerator.java b/python/python-psi-impl/src/com/jetbrains/python/documentation/docstrings/PyDocstringGenerator.java index 6643b1ad289d..19979d5403eb 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/documentation/docstrings/PyDocstringGenerator.java +++ b/python/python-psi-impl/src/com/jetbrains/python/documentation/docstrings/PyDocstringGenerator.java @@ -17,7 +17,6 @@ package com.jetbrains.python.documentation.docstrings; import com.google.common.base.Preconditions; import com.google.common.collect.Maps; -import com.google.common.collect.Sets; import com.intellij.openapi.project.Project; import com.intellij.openapi.util.Pair; import com.intellij.openapi.util.TextRange; @@ -32,10 +31,7 @@ import com.jetbrains.python.psi.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; public class PyDocstringGenerator { public static final String TRIPLE_DOUBLE_QUOTES = "\"\"\""; @@ -221,7 +217,7 @@ public class PyDocstringGenerator { if (myParametersPrepared) { return; } - final Set> withoutType = Sets.newHashSet(); + final Set> withoutType = new HashSet>(); final Map, String> paramTypes = Maps.newHashMap(); for (DocstringParam param : myAddedParams) { if (param.getType() == null) { @@ -241,7 +237,7 @@ public class PyDocstringGenerator { //} final DocStringFormat format = myDocStringFormat; final ArrayList filtered = new ArrayList<>(); - final Set> processed = Sets.newHashSet(); + final Set> processed = new HashSet>(); for (DocstringParam param : myAddedParams) { final Pair paramCoordinates = Pair.create(param.getName(), param.isReturnValue()); if (processed.contains(paramCoordinates)) { diff --git a/python/python-psi-impl/src/com/jetbrains/python/parsing/console/PythonConsoleData.java b/python/python-psi-impl/src/com/jetbrains/python/parsing/console/PythonConsoleData.java index 4c2203c0b1bc..1fde52ab3b86 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/parsing/console/PythonConsoleData.java +++ b/python/python-psi-impl/src/com/jetbrains/python/parsing/console/PythonConsoleData.java @@ -15,15 +15,14 @@ */ package com.jetbrains.python.parsing.console; -import com.google.common.collect.Sets; - +import java.util.HashSet; import java.util.List; import java.util.Set; public class PythonConsoleData { private boolean myIPythonEnabled; private boolean myIPythonAutomagic = true; - private final Set myIPythonMagicCommands = Sets.newHashSet(); + private final Set myIPythonMagicCommands = new HashSet(); private int myIndentSize = -1; public boolean isIPythonEnabled() { diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/blockEvaluator/PyBlockEvaluator.java b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/blockEvaluator/PyBlockEvaluator.java index 17bda29c161a..5163ac3287b8 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/impl/blockEvaluator/PyBlockEvaluator.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/impl/blockEvaluator/PyBlockEvaluator.java @@ -15,7 +15,6 @@ */ package com.jetbrains.python.psi.impl.blockEvaluator; -import com.google.common.collect.Sets; import com.intellij.openapi.vfs.VirtualFile; import com.intellij.psi.PsiElement; import com.intellij.psi.util.QualifiedName; @@ -49,7 +48,7 @@ public class PyBlockEvaluator { * @see PyEvaluationContext */ public PyBlockEvaluator(@NotNull final PyEvaluationContext evaluationContext) { - this(Sets.newHashSet(), evaluationContext); + this(new HashSet(), evaluationContext); } /** diff --git a/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyModuleType.java b/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyModuleType.java index 60bbedfe1608..c7f7bb406661 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyModuleType.java +++ b/python/python-psi-impl/src/com/jetbrains/python/psi/types/PyModuleType.java @@ -2,7 +2,6 @@ package com.jetbrains.python.psi.types; import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.codeInsight.lookup.LookupElementBuilder; import com.intellij.openapi.roots.FileIndexFacade; @@ -32,10 +31,7 @@ import com.jetbrains.python.psi.resolve.*; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Set; +import java.util.*; import java.util.function.Predicate; import static com.jetbrains.python.psi.PyUtil.inSameFile; @@ -151,7 +147,7 @@ public class PyModuleType implements PyType { // Modules don't descend from obje return; } - final Set seen = Sets.newHashSet(); + final Set seen = new HashSet(); if (!processImplicitlyImportedByImportElements(anchor, footHold, importElements, name -> filter.test(name) && seen.add(name), resultProcessor)) { diff --git a/python/python-psi-impl/src/com/jetbrains/python/refactoring/PyDefUseUtil.java b/python/python-psi-impl/src/com/jetbrains/python/refactoring/PyDefUseUtil.java index db91003b2ea9..c2edcde17e79 100644 --- a/python/python-psi-impl/src/com/jetbrains/python/refactoring/PyDefUseUtil.java +++ b/python/python-psi-impl/src/com/jetbrains/python/refactoring/PyDefUseUtil.java @@ -15,7 +15,6 @@ */ package com.jetbrains.python.refactoring; -import com.google.common.collect.Sets; import com.intellij.codeInsight.controlflow.ControlFlow; import com.intellij.codeInsight.controlflow.ControlFlowUtil; import com.intellij.codeInsight.controlflow.Instruction; @@ -121,7 +120,7 @@ public class PyDefUseUtil { return PyElement.EMPTY_ARRAY; } final boolean[] visited = new boolean[instructions.length]; - final Collection result = Sets.newHashSet(); + final Collection result = new HashSet(); for (Instruction instruction : instructions[instr].allSucc()) { getPostRefs(var, instructions, instruction.num(), visited, result); } diff --git a/python/python-sdk/src/com/jetbrains/python/sdk/PythonSdkAdditionalData.java b/python/python-sdk/src/com/jetbrains/python/sdk/PythonSdkAdditionalData.java index ced09b26f7d6..a204c7eea7da 100644 --- a/python/python-sdk/src/com/jetbrains/python/sdk/PythonSdkAdditionalData.java +++ b/python/python-sdk/src/com/jetbrains/python/sdk/PythonSdkAdditionalData.java @@ -1,7 +1,6 @@ // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.sdk; -import com.google.common.collect.Sets; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.module.Module; import com.intellij.openapi.projectRoots.Sdk; @@ -21,6 +20,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.Collections; +import java.util.HashSet; import java.util.List; import java.util.Set; @@ -148,7 +148,7 @@ public class PythonSdkAdditionalData implements SdkAdditionalData { } private static Set getPathsAsVirtualFiles(VirtualFilePointerContainer paths) { - Set ret = Sets.newHashSet(); + Set ret = new HashSet(); Collections.addAll(ret, paths.getFiles()); return ret; } diff --git a/python/rest/src/com/jetbrains/rest/RestUtil.java b/python/rest/src/com/jetbrains/rest/RestUtil.java index 21226412f465..9f2fc9c9e876 100644 --- a/python/rest/src/com/jetbrains/rest/RestUtil.java +++ b/python/rest/src/com/jetbrains/rest/RestUtil.java @@ -1,23 +1,9 @@ -/* - * Copyright 2000-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.rest; import com.google.common.collect.Maps; -import com.google.common.collect.Sets; +import java.util.HashSet; import java.util.Map; import java.util.Set; @@ -38,8 +24,8 @@ public class RestUtil { }; - public static final Set PREDEFINED_ROLES = Sets.newHashSet(); - public static final Set SPHINX_ROLES = Sets.newHashSet(); + public static final Set PREDEFINED_ROLES = new HashSet(); + public static final Set SPHINX_ROLES = new HashSet(); private static final Map DIRECTIVES = Maps.newHashMap(); static { diff --git a/python/src/com/jetbrains/python/configuration/PythonPathEditor.java b/python/src/com/jetbrains/python/configuration/PythonPathEditor.java index 980965f15294..0c6646b71be3 100644 --- a/python/src/com/jetbrains/python/configuration/PythonPathEditor.java +++ b/python/src/com/jetbrains/python/configuration/PythonPathEditor.java @@ -34,6 +34,7 @@ import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Set; @@ -127,13 +128,13 @@ public class PythonPathEditor extends SdkPathEditor { protected void onReloadButtonClicked() { } private static class PathListModel { - private Set myAdded = Sets.newHashSet(); - private Set myExcluded = Sets.newHashSet(); - private final Set myFoundFiles = Sets.newHashSet(); + private Set myAdded = new HashSet(); + private Set myExcluded = new HashSet(); + private final Set myFoundFiles = new HashSet(); private final List myFilteredOut = new ArrayList<>(); private final DefaultListModel myListModel; private final OrderRootType myOrderRootType; - private final Set myUserAddedToRemove = Sets.newHashSet(); + private final Set myUserAddedToRemove = new HashSet(); PathListModel(OrderRootType orderRootType, DefaultListModel listModel) { myOrderRootType = orderRootType; diff --git a/python/src/com/jetbrains/python/debugger/smartstepinto/PySmartStepIntoVariantVisitor.java b/python/src/com/jetbrains/python/debugger/smartstepinto/PySmartStepIntoVariantVisitor.java index 17a829e7d69e..612f53a93dbf 100644 --- a/python/src/com/jetbrains/python/debugger/smartstepinto/PySmartStepIntoVariantVisitor.java +++ b/python/src/com/jetbrains/python/debugger/smartstepinto/PySmartStepIntoVariantVisitor.java @@ -3,7 +3,6 @@ package com.jetbrains.python.debugger.smartstepinto; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; -import com.google.common.collect.Sets; import com.intellij.openapi.util.Pair; import com.intellij.psi.PsiElement; import com.jetbrains.python.PyTokenTypes; @@ -14,19 +13,20 @@ import com.jetbrains.python.pyi.PyiFile; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; public class PySmartStepIntoVariantVisitor extends PyRecursiveElementVisitor { @NotNull @NonNls private static final ImmutableSet BUILTINS_MODULES = ImmutableSet.of("builtins.py", "__builtin__.py"); - + int myVariantIndex = -1; @NotNull private final List myCollector; @NotNull private final List> myVariantsFromPython; @NotNull private final PySmartStepIntoContext myContext; @NotNull private final Map mySeenVariants = Maps.newHashMap(); - @NotNull private final Set alreadyVisited = Sets.newHashSet(); + @NotNull private final Set alreadyVisited = new HashSet(); public PySmartStepIntoVariantVisitor(@NotNull List collector, @NotNull List> variantsFromPython, diff --git a/python/src/com/jetbrains/python/run/PythonCommandLineState.java b/python/src/com/jetbrains/python/run/PythonCommandLineState.java index d457ac7a710c..547790b62e1c 100644 --- a/python/src/com/jetbrains/python/run/PythonCommandLineState.java +++ b/python/src/com/jetbrains/python/run/PythonCommandLineState.java @@ -524,7 +524,7 @@ public abstract class PythonCommandLineState extends CommandLineState { @NotNull public static Collection collectPythonPath(@Nullable Module module, boolean addContentRoots, boolean addSourceRoots) { - Collection pythonPathList = Sets.newLinkedHashSet(); + Collection pythonPathList = new LinkedHashSet(); if (module != null) { Set dependencies = new HashSet<>(); ModuleUtilCore.getDependencies(module, dependencies); diff --git a/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java b/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java index 0dd7edf23bd8..8cb134f76337 100644 --- a/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java +++ b/python/src/com/jetbrains/python/sdk/PythonSdkUpdater.java @@ -60,7 +60,7 @@ public class PythonSdkUpdater implements StartupActivity.Background { private static final Logger LOG = Logger.getInstance(PythonSdkUpdater.class); private static final Object ourLock = new Object(); - private static final Set ourScheduledToRefresh = Sets.newHashSet(); + private static final Set ourScheduledToRefresh = new HashSet(); private static final BlockingSet ourUnderRefresh = new BlockingSet<>(); private static final NotificationGroup NOTIFICATION_GROUP = NotificationGroup.balloonGroup( @@ -501,7 +501,7 @@ public class PythonSdkUpdater implements StartupActivity.Background { */ @NotNull private static Set getPythonSdks(@NotNull Project project) { - final Set pythonSdks = Sets.newLinkedHashSet(); + final Set pythonSdks = new LinkedHashSet(); for (Module module : ModuleManager.getInstance(project).getModules()) { final Sdk sdk = PythonSdkUtil.findPythonSdk(module); if (sdk != null && sdk.getSdkType() instanceof PythonSdkType) { diff --git a/python/src/com/jetbrains/python/testing/PythonTestLegacyConfigurationProducer.java b/python/src/com/jetbrains/python/testing/PythonTestLegacyConfigurationProducer.java index 71fbd5306a11..7b8d4644254d 100644 --- a/python/src/com/jetbrains/python/testing/PythonTestLegacyConfigurationProducer.java +++ b/python/src/com/jetbrains/python/testing/PythonTestLegacyConfigurationProducer.java @@ -1,7 +1,6 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.testing; -import com.google.common.collect.Sets; import com.intellij.execution.Location; import com.intellij.execution.actions.ConfigurationContext; import com.intellij.execution.configurations.ConfigurationFactory; @@ -218,7 +217,7 @@ abstract public class PythonTestLegacyConfigurationProducer roots = Sets.newHashSet(); + final HashSet roots = new HashSet(); final Module[] modules = ModuleManager.getInstance(project).getModules(); for (Module module : modules) { roots.addAll(PyUtil.getSourceRoots(module)); diff --git a/python/testSrc/com/jetbrains/env/PyEnvSufficiencyTest.java b/python/testSrc/com/jetbrains/env/PyEnvSufficiencyTest.java index b46fdf41c05a..94d97c2586cc 100644 --- a/python/testSrc/com/jetbrains/env/PyEnvSufficiencyTest.java +++ b/python/testSrc/com/jetbrains/env/PyEnvSufficiencyTest.java @@ -2,16 +2,12 @@ package com.jetbrains.env; import com.google.common.collect.ImmutableList; -import com.google.common.collect.Sets; import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.text.StringUtil; import com.intellij.testFramework.UsefulTestCase; import org.junit.Test; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Set; +import java.util.*; import static com.intellij.testFramework.UsefulTestCase.assertEmpty; @@ -24,7 +20,7 @@ public class PyEnvSufficiencyTest extends PyEnvTestCase { if (UsefulTestCase.IS_UNDER_TEAMCITY && SETTINGS.isEnvConfiguration()) { checkStaging(); - Set tags = Sets.newHashSet(); + Set tags = new HashSet(); List roots = getPythonRoots(); if (roots.size() == 0) { return; // not on env agent diff --git a/python/testSrc/com/jetbrains/env/PyTestTask.java b/python/testSrc/com/jetbrains/env/PyTestTask.java index 514381b6caec..73e0f55bd365 100644 --- a/python/testSrc/com/jetbrains/env/PyTestTask.java +++ b/python/testSrc/com/jetbrains/env/PyTestTask.java @@ -1,7 +1,6 @@ // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.env; -import com.google.common.collect.Sets; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.util.Ref; @@ -10,6 +9,7 @@ import com.jetbrains.python.psi.LanguageLevel; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.HashSet; import java.util.Set; public abstract class PyTestTask { @@ -86,7 +86,7 @@ public abstract class PyTestTask { */ @NotNull public Set getTags() { - return Sets.newHashSet(); + return new HashSet(); } /** diff --git a/python/testSrc/com/jetbrains/env/python/debug/PyBaseDebuggerTask.java b/python/testSrc/com/jetbrains/env/python/debug/PyBaseDebuggerTask.java index 9eea2b416967..3257f9e05940 100644 --- a/python/testSrc/com/jetbrains/env/python/debug/PyBaseDebuggerTask.java +++ b/python/testSrc/com/jetbrains/env/python/debug/PyBaseDebuggerTask.java @@ -1,7 +1,6 @@ // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.env.python.debug; -import com.google.common.collect.Sets; import com.intellij.execution.ExecutionResult; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ModalityState; @@ -37,13 +36,14 @@ import org.junit.Assert; import java.io.PrintWriter; import java.util.ArrayList; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; public abstract class PyBaseDebuggerTask extends PyExecutionFixtureTestTask { - private final Set> myBreakpoints = Sets.newHashSet(); + private final Set> myBreakpoints = new HashSet>(); protected PyDebugProcess myDebugProcess; protected XDebugSession mySession; protected Semaphore myPausedSemaphore; diff --git a/python/testSrc/com/jetbrains/env/python/testing/PyUnitTestLikeProcessWithConsoleTestTask.kt b/python/testSrc/com/jetbrains/env/python/testing/PyUnitTestLikeProcessWithConsoleTestTask.kt index 693809d70524..232289170553 100644 --- a/python/testSrc/com/jetbrains/env/python/testing/PyUnitTestLikeProcessWithConsoleTestTask.kt +++ b/python/testSrc/com/jetbrains/env/python/testing/PyUnitTestLikeProcessWithConsoleTestTask.kt @@ -1,21 +1,6 @@ -/* - * Copyright 2000-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.env.python.testing -import com.google.common.collect.Sets import com.jetbrains.env.PyProcessWithConsoleTestTask import com.jetbrains.env.ut.PyScriptTestProcessRunner import com.jetbrains.env.ut.PyUnitTestProcessRunner @@ -35,8 +20,8 @@ PyScriptTestProcessRunner<*>> @JvmOverloads constructor(relativePathToTestData: protected val processRunnerCreator: Function) : PyProcessWithConsoleTestTask(relativePathToTestData, SdkCreationType.SDK_PACKAGES_ONLY) { - override fun getTagsToCover(): Set = Sets.newHashSet("python2.6", "python2.7", "python3.5", "python3.6", "jython", "pypy", - "IronPython") + override fun getTagsToCover(): Set = hashSetOf("python2.6", "python2.7", "python3.5", "python3.6", "jython", "pypy", + "IronPython") @Throws(Exception::class)