<SOURCES />
</library>
</orderEntry>
- <orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="library" name="netty-buffer" level="project" />
<orderEntry type="library" name="caffeine" level="project" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="module" module-name="intellij.platform.codeStyle.impl" />
+ <orderEntry type="library" name="fastutil-min" level="project" />
</component>
</module>
\ No newline at end of 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.
+// Copyright 2000-2021 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.lang.dart;
import com.intellij.openapi.application.ApplicationManager;
import com.jetbrains.lang.dart.sdk.DartSdk;
import com.jetbrains.lang.dart.sdk.DartSdkLibUtil;
import com.jetbrains.lang.dart.util.DotPackagesFileUtil;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Override
public void afterVfsChange() {
- Set<Project> projectsToUpdate = new THashSet<>();
- Set<Project> projectsToUpdateVisibleFiles = new THashSet<>();
+ Set<Project> projectsToUpdate = new HashSet<>();
+ Set<Project> projectsToUpdateVisibleFiles = new HashSet<>();
for (Project project : ProjectManager.getInstance().getOpenProjects()) {
if (DartSdk.getDartSdk(project) == null) continue;
-// 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.
+// Copyright 2000-2021 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.lang.dart;
import com.intellij.openapi.module.Module;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.containers.ContainerUtil;
import com.jetbrains.lang.dart.sdk.DartSdk;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
+import java.util.HashSet;
import java.util.Set;
import static com.jetbrains.lang.dart.util.PubspecYamlUtil.PUBSPEC_YAML;
* @see DartFileListener
* @see DartModuleRootListener
*/
-public class DartStartupActivity implements StartupActivity {
+public final class DartStartupActivity implements StartupActivity {
@Override
public void runActivity(@NotNull Project project) {
final Collection<VirtualFile> pubspecYamlFiles =
private static Set<String> collectFolderUrlsToExclude(@NotNull final Module module,
@NotNull final VirtualFile pubspecYamlFile) {
- final THashSet<String> newExcludedPackagesUrls = new THashSet<>();
+ final Set<String> newExcludedPackagesUrls = new HashSet<>();
final VirtualFile root = pubspecYamlFile.getParent();
final DartSdk sdk = DartSdk.getDartSdk(module.getProject());
-// 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.
+// Copyright 2000-2021 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.lang.dart.analyzer;
import com.google.common.collect.EvictingQueue;
import com.jetbrains.lang.dart.sdk.DartSdkUpdateChecker;
import com.jetbrains.lang.dart.sdk.DartSdkUtil;
import com.jetbrains.lang.dart.util.PubspecYamlUtil;
-import gnu.trove.THashMap;
-import gnu.trove.THashSet;
-import gnu.trove.TObjectIntHashMap;
+import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import org.dartlang.analysis.server.protocol.*;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NonNls;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import static com.google.dart.server.internal.remote.RemoteAnalysisServerImpl.DART_FIX_INFO_NON_NULLABLE;
-
public final class DartAnalysisServerService implements Disposable {
public static final String MIN_SDK_VERSION = "1.12";
private static final String MIN_MOVE_FILE_SDK_VERSION = "2.3.2";
@Nullable private String mySdkHome;
private final DartServerRootsHandler myRootsHandler;
- private final Map<String, Long> myFilePathWithOverlaidContentToTimestamp = new THashMap<>();
+ private final Map<String, Long> myFilePathWithOverlaidContentToTimestamp = new HashMap<>();
private final List<String> myVisibleFiles = new ArrayList<>();
- private final Set<Document> myChangedDocuments = new THashSet<>();
+ private final Set<Document> myChangedDocuments = new HashSet<>();
private final Alarm myUpdateFilesAlarm;
@NotNull private final Queue<CompletionInfo> myCompletionInfos = new LinkedList<>();
private boolean mySentAnalysisBusy;
// files with red squiggles in Project View. This field is also used as a lock to access these 3 collections
- @NotNull private final Set<String> myFilePathsWithErrors = new THashSet<>();
+ @NotNull private final Set<String> myFilePathsWithErrors = new HashSet<>();
// how many files with errors are in this folder (recursively)
- @NotNull private final TObjectIntHashMap<String> myFolderPathsWithErrors = new TObjectIntHashMap<>();
+ @NotNull private final Object2IntOpenHashMap<String> myFolderPathsWithErrors = new Object2IntOpenHashMap<>();
// errors hash is tracked to optimize error notification listener: do not handle equal notifications more than once
- @NotNull private final TObjectIntHashMap<String> myFilePathToErrorsHash = new TObjectIntHashMap<>();
+ @NotNull private final Object2IntOpenHashMap<String> myFilePathToErrorsHash = new Object2IntOpenHashMap<>();
@NotNull private final EvictingQueue<String> myDebugLog = EvictingQueue.create(DEBUG_LOG_CAPACITY);
final int oldHash;
synchronized (myFilePathsWithErrors) {
// TObjectIntHashMap returns 0 if there's no such entry, it's equivalent to empty error set for this file
- oldHash = myFilePathToErrorsHash.get(filePathSI);
+ oldHash = myFilePathToErrorsHash.getInt(filePathSI);
}
final int newHash = errorsWithoutTodo.isEmpty() ? 0 : ensureNotZero(errorsWithoutTodo.hashCode());
myUpdateFilesAlarm.cancelAllRequests();
- final Map<String, Object> filesToUpdate = new THashMap<>();
+ final Map<String, Object> filesToUpdate = new HashMap<>();
ApplicationManager.getApplication().assertReadAccessAllowed();
synchronized (myLock) {
- final Set<String> oldTrackedFiles = new THashSet<>(myFilePathWithOverlaidContentToTimestamp.keySet());
+ final Set<String> oldTrackedFiles = new HashSet<>(myFilePathWithOverlaidContentToTimestamp.keySet());
final FileDocumentManager fileDocumentManager = FileDocumentManager.getInstance();
// some documents in myChangedDocuments may be updated by external change, such as switch branch, that's why we track them,
// getUnsavedDocuments() is not enough, we must make sure that overlaid content is sent for for myChangedDocuments as well (to trigger DAS notifications)
- final Set<Document> documents = new THashSet<>(myChangedDocuments);
+ final Set<Document> documents = new HashSet<>(myChangedDocuments);
myChangedDocuments.clear();
ContainerUtil.addAll(documents, fileDocumentManager.getUnsavedDocuments());
}
if (LOG.isDebugEnabled()) {
- final Set<String> overlaid = new THashSet<>(filesToUpdate.keySet());
+ final Set<String> overlaid = new HashSet<>(filesToUpdate.keySet());
for (String removeOverlaid : oldTrackedFiles) {
overlaid.remove(FileUtil.toSystemDependentName(removeOverlaid));
}
synchronized (myFilePathsWithErrors) {
if (errorsHash == 0) {
// no errors
- myFilePathToErrorsHash.remove(filePath);
+ myFilePathToErrorsHash.removeInt(filePath);
}
else {
myFilePathToErrorsHash.put(filePath, errorsHash);
if (myFilePathsWithErrors.add(filePath)) {
String parentPath = PathUtil.getParentPath(filePath);
while (!parentPath.isEmpty()) {
- final int count = myFolderPathsWithErrors.get(parentPath); // returns zero if there were no path in the map
+ final int count = myFolderPathsWithErrors.getInt(parentPath); // returns zero if there were no path in the map
myFolderPathsWithErrors.put(parentPath, count + 1);
parentPath = PathUtil.getParentPath(parentPath);
}
if (myFilePathsWithErrors.remove(filePath)) {
String parentPath = PathUtil.getParentPath(filePath);
while (!parentPath.isEmpty()) {
- final int count = myFolderPathsWithErrors.remove(parentPath); // returns zero if there was no path in the map
+ final int count = myFolderPathsWithErrors.removeInt(parentPath); // returns zero if there was no path in the map
if (count > 1) {
myFolderPathsWithErrors.put(parentPath, count - 1);
}
@Nullable
public List<SourceFileEdit> edit_dartfixNNBD(final @NotNull List<? extends VirtualFile> files) {
- return edit_dartfix(files, Collections.singletonList(DART_FIX_INFO_NON_NULLABLE));
+ return edit_dartfix(files, Collections.singletonList(RemoteAnalysisServerImpl.DART_FIX_INFO_NON_NULLABLE));
}
@Nullable
synchronized (myLock) {
if (myServer == null) return;
- final Map<String, List<String>> subscriptions = new THashMap<>();
+ final Map<String, List<String>> subscriptions = new HashMap<>();
subscriptions.put(AnalysisService.HIGHLIGHTS, myVisibleFiles);
subscriptions.put(AnalysisService.NAVIGATION, myVisibleFiles);
subscriptions.put(AnalysisService.OVERRIDES, myVisibleFiles);
@NotNull List<RuntimeCompletionExpression> expressions) {
final AnalysisServer server = myServer;
if (server == null) {
- return new Pair(new ArrayList<CompletionSuggestion>(), new ArrayList<RuntimeCompletionExpression>());
+ return new Pair<>(new ArrayList<CompletionSuggestion>(), new ArrayList<RuntimeCompletionExpression>());
}
final String contextFilePath = FileUtil.toSystemDependentName(contextFile.getPath());
new GetRuntimeCompletionConsumer() {
@Override
public void computedResult(List<CompletionSuggestion> suggestions, List<RuntimeCompletionExpression> expressions) {
- refResult.set(new Pair(suggestions, expressions));
+ refResult.set(new Pair<>(suggestions, expressions));
latch.countDown();
}
public boolean isFileWithErrors(@NotNull final VirtualFile file) {
synchronized (myFilePathsWithErrors) {
- return file.isDirectory() ? myFolderPathsWithErrors.get(file.getPath()) > 0 : myFilePathsWithErrors.contains(file.getPath());
+ return file.isDirectory() ? myFolderPathsWithErrors.getInt(file.getPath()) > 0 : myFilePathsWithErrors.contains(file.getPath());
}
}
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide;
import com.intellij.navigation.ChooseByNameContributorEx;
import com.intellij.util.indexing.FindSymbolParameters;
import com.intellij.util.indexing.ID;
import com.intellij.util.indexing.IdFilter;
+import com.jetbrains.lang.dart.ide.index.DartClassIndex;
import com.jetbrains.lang.dart.psi.DartComponent;
import com.jetbrains.lang.dart.psi.DartFile;
import com.jetbrains.lang.dart.util.DartResolveUtil;
import java.util.Collections;
import java.util.Objects;
-import static com.jetbrains.lang.dart.ide.index.DartClassIndex.DART_CLASS_INDEX;
-
-/**
- * @author: Fedor.Korotkov
- */
-public class DartClassContributor implements ChooseByNameContributorEx {
+public final class DartClassContributor implements ChooseByNameContributorEx {
@Override
public void processNames(@NotNull Processor<? super String> processor, @NotNull GlobalSearchScope scope, @Nullable IdFilter filter) {
- FileBasedIndex.getInstance().processAllKeys(DART_CLASS_INDEX, processor, scope, filter);
+ FileBasedIndex.getInstance().processAllKeys(DartClassIndex.DART_CLASS_INDEX, processor, scope, filter);
}
@Override
public void processElementsWithName(@NotNull String name,
@NotNull Processor<? super NavigationItem> processor,
@NotNull FindSymbolParameters parameters) {
- doProcessElements(DART_CLASS_INDEX, DartResolveUtil::getClassDeclarations, name, processor, parameters);
+ doProcessElements(DartClassIndex.DART_CLASS_INDEX, DartResolveUtil::getClassDeclarations, name, processor, parameters);
}
static void doProcessElements(@NotNull ID<String, Void> index,
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.actions;
import com.intellij.openapi.application.ApplicationManager;
import com.jetbrains.lang.dart.psi.DartComponent;
import com.jetbrains.lang.dart.psi.DartComponentName;
import com.jetbrains.lang.dart.util.DartResolveUtil;
-import gnu.trove.THashSet;
import org.dartlang.analysis.server.protocol.Element;
import org.dartlang.analysis.server.protocol.Location;
import org.dartlang.analysis.server.protocol.TypeHierarchyItem;
import java.util.List;
import java.util.Set;
-public class DartInheritorsSearcher extends QueryExecutorBase<PsiElement, DefinitionsScopedSearch.SearchParameters> {
+public final class DartInheritorsSearcher extends QueryExecutorBase<PsiElement, DefinitionsScopedSearch.SearchParameters> {
private static final class HierarchyInfo {
@NotNull final String filePath;
final int offset;
@NotNull final List<TypeHierarchyItem> hierarchyItems) {
if (hierarchyItems.isEmpty()) return Collections.emptySet();
- final Set<DartComponent> result = new THashSet<>(hierarchyItems.size());
+ final Set<DartComponent> result = new HashSet<>(hierarchyItems.size());
addSubClasses(project, scope, new HashSet<>(), hierarchyItems, result, hierarchyItems.get(0), false);
return result;
}
@NotNull final List<TypeHierarchyItem> hierarchyItems) {
if (hierarchyItems.isEmpty()) return Collections.emptySet();
- final Set<DartComponent> result = new THashSet<>(hierarchyItems.size());
+ final Set<DartComponent> result = new HashSet<>(hierarchyItems.size());
addSubMembers(project, scope, new HashSet<>(), hierarchyItems, result, hierarchyItems.get(0), false);
return result;
}
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.actions;
import com.intellij.CommonBundle;
import com.jetbrains.lang.dart.DartBundle;
import com.jetbrains.lang.dart.DartLanguage;
import com.jetbrains.lang.dart.analyzer.DartAnalysisServerService;
-import gnu.trove.THashMap;
import org.dartlang.analysis.server.protocol.SourceEdit;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
// keep public to be accessible in 3rd party plugins
public static void runDartfmt(@NotNull final Project project, @NotNull final List<? extends VirtualFile> dartFiles) {
- final Map<VirtualFile, String> fileToNewContentMap = new THashMap<>();
+ final Map<VirtualFile, String> fileToNewContentMap = new HashMap<>();
final int lineLength = getRightMargin(project);
final Runnable runnable = () -> {
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.annotator;
import com.intellij.codeInspection.ProblemHighlightType;
import com.jetbrains.lang.dart.psi.DartSymbolLiteralExpression;
import com.jetbrains.lang.dart.psi.DartTernaryExpression;
import com.jetbrains.lang.dart.sdk.DartSdk;
-import gnu.trove.THashMap;
import org.dartlang.analysis.server.protocol.AnalysisErrorSeverity;
import org.dartlang.analysis.server.protocol.HighlightRegionType;
import org.jetbrains.annotations.Contract;
import java.util.*;
-public class DartAnnotator implements Annotator {
-
+public final class DartAnnotator implements Annotator {
private static final Key<List<DartServerData.DartError>> DART_ERRORS = Key.create("DART_ERRORS");
private static final Key<List<DartServerData.DartHighlightRegion>> DART_HIGHLIGHTING = Key.create("DART_HIGHLIGHTING");
- private static final Map<String, String> HIGHLIGHTING_TYPE_MAP = new THashMap<>();
+ private static final Map<String, String> HIGHLIGHTING_TYPE_MAP = new HashMap<>();
static {
HIGHLIGHTING_TYPE_MAP.put(HighlightRegionType.ANNOTATION, DartSyntaxHighlighterColors.DART_ANNOTATION);
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.generation;
import com.intellij.openapi.util.Pair;
import com.jetbrains.lang.dart.psi.DartClass;
import com.jetbrains.lang.dart.psi.DartComponent;
import com.jetbrains.lang.dart.util.DartResolveUtil;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-public class DartImplementMethodHandler extends BaseDartGenerateHandler {
+public final class DartImplementMethodHandler extends BaseDartGenerateHandler {
@Override
@NotNull
protected String getTitle() {
@Override
protected void collectCandidates(@NotNull final DartClass dartClass, @NotNull final List<DartComponent> candidates) {
- Map<Pair<String, Boolean>, DartComponent> result =
- new THashMap<>(computeSuperInterfacesMembersMap(dartClass));
- Map<Pair<String, Boolean>, DartComponent> superClassesMemberMap =
- new THashMap<>(computeSuperClassesMemberMap(dartClass));
+ Map<Pair<String, Boolean>, DartComponent> result = new HashMap<>(computeSuperInterfacesMembersMap(dartClass));
+ Map<Pair<String, Boolean>, DartComponent> superClassesMemberMap = new HashMap<>(computeSuperClassesMemberMap(dartClass));
result.keySet().removeAll(superClassesMemberMap.keySet());
for (Map.Entry<Pair<String, Boolean>, DartComponent> entry : superClassesMemberMap.entrySet()) {
final DartComponent component = entry.getValue();
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.generation;
import com.intellij.openapi.util.Pair;
import com.jetbrains.lang.dart.psi.DartClass;
import com.jetbrains.lang.dart.psi.DartComponent;
import com.jetbrains.lang.dart.util.DartResolveUtil;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-public class DartOverrideMethodHandler extends BaseDartGenerateHandler {
+public final class DartOverrideMethodHandler extends BaseDartGenerateHandler {
@Override
@NotNull
protected String getTitle() {
@Override
protected void collectCandidates(@NotNull final DartClass dartClass, @NotNull final List<DartComponent> candidates) {
- Map<Pair<String, Boolean>, DartComponent> result =
- new THashMap<>(computeSuperClassesMemberMap(dartClass));
+ Map<Pair<String, Boolean>, DartComponent> result = new HashMap<>(computeSuperClassesMemberMap(dartClass));
result.keySet().removeAll(computeClassMembersMap(dartClass, false).keySet());
candidates.addAll(ContainerUtil.findAll(result.values(), component -> DartComponentType.typeOf(component) != DartComponentType.FIELD &&
(component.isPublic() ||
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.index;
import com.intellij.util.indexing.*;
import com.intellij.util.io.EnumeratorStringDescriptor;
import com.intellij.util.io.KeyDescriptor;
import com.jetbrains.lang.dart.DartFileType;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
+import java.util.HashMap;
import java.util.Map;
-public class DartClassIndex extends ScalarIndexExtension<String> {
+public final class DartClassIndex extends ScalarIndexExtension<String> {
public static final ID<String, Void> DART_CLASS_INDEX = ID.create("DartClassIndex");
private final DataIndexer<String, Void, FileContent> myDataIndexer = new MyDataIndexer();
return true;
}
- private static class MyDataIndexer implements DataIndexer<String, Void, FileContent> {
+ private static final class MyDataIndexer implements DataIndexer<String, Void, FileContent> {
@Override
@NotNull
public Map<String, Void> map(@NotNull final FileContent inputData) {
DartFileIndexData indexData = DartIndexUtil.indexFile(inputData);
- final Map<String, Void> result = new THashMap<>();
+ final Map<String, Void> result = new HashMap<>();
for (String componentName : indexData.getClassNames()) {
result.put(componentName, null);
}
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.index;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-public class DartFileIndexData {
+public final class DartFileIndexData {
private final List<String> myClassNames = new ArrayList<>();
private final List<DartImportOrExportInfo> myImportAndExportInfos = new ArrayList<>();
- private final Map<String, DartComponentInfo> myComponentInfoMap = new THashMap<>();
+ private final Map<String, DartComponentInfo> myComponentInfoMap = new HashMap<>();
@Nullable private String myLibraryName;
private final List<String> myPartUris = new ArrayList<>();
private final List<String> mySymbols = new ArrayList<>();
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.index;
import com.intellij.openapi.project.Project;
import com.intellij.util.io.DataInputOutputUtil;
import com.intellij.util.io.IOUtil;
import com.jetbrains.lang.dart.DartFileType;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.util.*;
-public class DartImportAndExportIndex extends SingleEntryFileBasedIndexExtension<List<DartImportOrExportInfo>> {
+public final class DartImportAndExportIndex extends SingleEntryFileBasedIndexExtension<List<DartImportOrExportInfo>> {
private static final ID<Integer, List<DartImportOrExportInfo>> DART_IMPORT_EXPORT_INDEX = ID.create("DartImportIndex");
@NotNull
final String uri = IOUtil.readUTF(in);
final String prefix = IOUtil.readUTF(in);
final int showSize = DataInputOutputUtil.readINT(in);
- final Set<String> showComponentNames = showSize == 0 ? Collections.emptySet() : new THashSet<>(showSize);
+ final Set<String> showComponentNames = showSize == 0 ? Collections.emptySet() : new HashSet<>(showSize);
for (int j = 0; j < showSize; j++) {
showComponentNames.add(IOUtil.readUTF(in));
}
final int hideSize = DataInputOutputUtil.readINT(in);
- final Set<String> hideComponentNames = hideSize == 0 ? Collections.emptySet() : new THashSet<>(hideSize);
+ final Set<String> hideComponentNames = hideSize == 0 ? Collections.emptySet() : new HashSet<>(hideSize);
for (int j = 0; j < hideSize; j++) {
hideComponentNames.add(IOUtil.readUTF(in));
}
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.index;
import com.intellij.openapi.util.Key;
import com.jetbrains.lang.dart.psi.*;
import com.jetbrains.lang.dart.util.DartControlFlowUtil;
import com.jetbrains.lang.dart.util.DartResolveUtil;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
+import java.util.HashSet;
import java.util.Set;
import static com.jetbrains.lang.dart.ide.index.DartImportOrExportInfo.Kind;
final @NotNull DartImportOrExportStatement importOrExportStatement) {
final String uri = importOrExportStatement.getUriString();
- final Set<String> showComponentNames = new THashSet<>();
+ final Set<String> showComponentNames = new HashSet<>();
for (DartShowCombinator showCombinator : importOrExportStatement.getShowCombinatorList()) {
final DartLibraryReferenceList libraryReferenceList = showCombinator.getLibraryReferenceList();
if (libraryReferenceList != null) {
}
}
- final Set<String> hideComponentNames = new THashSet<>();
+ final Set<String> hideComponentNames = new HashSet<>();
for (DartHideCombinator hideCombinator : importOrExportStatement.getHideCombinatorList()) {
final DartLibraryReferenceList libraryReferenceList = hideCombinator.getLibraryReferenceList();
if (libraryReferenceList != null) {
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.index;
import com.intellij.util.indexing.*;
import com.intellij.util.io.EnumeratorStringDescriptor;
import com.intellij.util.io.KeyDescriptor;
import com.jetbrains.lang.dart.DartFileType;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
-public class DartSymbolIndex extends ScalarIndexExtension<String> {
+public final class DartSymbolIndex extends ScalarIndexExtension<String> {
public static final ID<String, Void> DART_SYMBOL_INDEX = ID.create("DartSymbolIndex");
private final DataIndexer<String, Void, FileContent> myDataIndexer = new MyDataIndexer();
@NotNull
public Map<String, Void> map(@NotNull final FileContent inputData) {
List<String> symbols = DartIndexUtil.indexFile(inputData).getSymbols();
- final Map<String, Void> result = new THashMap<>();
+ final Map<String, Void> result = new HashMap<>();
for (String symbol : symbols) {
result.put(symbol, null);
}
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.inspections;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.jetbrains.lang.dart.util.DartResolveUtil;
import com.jetbrains.lang.dart.util.DotPackagesFileUtil;
import com.jetbrains.lang.dart.util.PubspecYamlUtil;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.HashSet;
import java.util.Set;
-public class DartOutdatedDependenciesInspection extends LocalInspectionTool {
- private final Set<String> myIgnoredPubspecPaths = new THashSet<>(); // remember for the current session only, do not serialize
+public final class DartOutdatedDependenciesInspection extends LocalInspectionTool {
+ private final Set<String> myIgnoredPubspecPaths = new HashSet<>(); // remember for the current session only, do not serialize
@Override
public ProblemDescriptor @Nullable [] checkFile(@NotNull final PsiFile psiFile,
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.refactoring;
import com.intellij.find.findUsages.PsiElement2UsageTargetAdapter;
import com.jetbrains.lang.dart.analyzer.DartAnalysisServerService;
import com.jetbrains.lang.dart.assists.AssistUtils;
import com.jetbrains.lang.dart.ide.findUsages.DartServerFindUsagesHandler;
-import gnu.trove.THashMap;
-import gnu.trove.THashSet;
import org.dartlang.analysis.server.protocol.SourceChange;
import org.dartlang.analysis.server.protocol.SourceEdit;
import org.dartlang.analysis.server.protocol.SourceFileEdit;
import javax.swing.*;
import java.awt.*;
import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
-class DartRenameDialog extends ServerRefactoringDialog<ServerRenameRefactoring> {
+final class DartRenameDialog extends ServerRefactoringDialog<ServerRenameRefactoring> {
private final JLabel myNewNamePrefix = new JLabel("");
private NameSuggestionsField myNameSuggestionsField;
presentation.setUsageTypeFilteringAvailable(false);
final List<UsageTarget> usageTargets = new SmartList<>();
- final Map<Usage, String> usageToEditIdMap = new THashMap<>();
+ final Map<Usage, String> usageToEditIdMap = new HashMap<>();
fillTargetsAndUsageToEditIdMap(usageTargets, usageToEditIdMap);
final UsageTarget[] targets = usageTargets.toArray(UsageTarget.EMPTY_ARRAY);
@NotNull
private Runnable createRefactoringRunnable(@NotNull final UsageView usageView, @NotNull final Map<Usage, String> usageToEditIdMap) {
return () -> {
- final Set<String> excludedIds = new THashSet<>();
+ final Set<String> excludedIds = new HashSet<>();
// usageView.getExcludedUsages() and usageView.getUsages() doesn't contain deleted usages, that's why we need to start with full set usageToEditIdMap.keySet()
- final Set<Usage> excludedUsages = new THashSet<>(usageToEditIdMap.keySet());
+ final Set<Usage> excludedUsages = new HashSet<>(usageToEditIdMap.keySet());
excludedUsages.removeAll(usageView.getUsages());
excludedUsages.addAll(usageView.getExcludedUsages());
-// Copyright 2000-2018 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-2021 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.lang.dart.ide.runner.server.vmService;
import com.intellij.xdebugger.breakpoints.XBreakpointHandler;
import com.intellij.xdebugger.breakpoints.XBreakpointProperties;
import com.intellij.xdebugger.breakpoints.XLineBreakpoint;
import com.jetbrains.lang.dart.ide.runner.DartLineBreakpointType;
-import gnu.trove.THashMap;
-import gnu.trove.THashSet;
import org.dartlang.vm.service.element.Breakpoint;
import org.jetbrains.annotations.NotNull;
import java.util.*;
-public class DartVmServiceBreakpointHandler extends XBreakpointHandler<XLineBreakpoint<XBreakpointProperties>> {
-
+public final class DartVmServiceBreakpointHandler extends XBreakpointHandler<XLineBreakpoint<XBreakpointProperties>> {
private final DartVmServiceDebugProcess myDebugProcess;
- private final Set<XLineBreakpoint<XBreakpointProperties>> myXBreakpoints = new THashSet<>();
- private final Map<String, IsolateBreakpointInfo> myIsolateInfo = new THashMap<>();
- private final Map<String, XLineBreakpoint<XBreakpointProperties>> myVmBreakpointIdToXBreakpointMap = new THashMap<>();
+ private final Set<XLineBreakpoint<XBreakpointProperties>> myXBreakpoints = new HashSet<>();
+ private final Map<String, IsolateBreakpointInfo> myIsolateInfo = new HashMap<>();
+ private final Map<String, XLineBreakpoint<XBreakpointProperties>> myVmBreakpointIdToXBreakpointMap = new HashMap<>();
public DartVmServiceBreakpointHandler(@NotNull final DartVmServiceDebugProcess debugProcess) {
super(DartLineBreakpointType.class);
private final String myIsolateId;
private final DartVmServiceDebugProcess myDebugProcess;
private final List<String> myTemporaryVmBreakpointIds = new ArrayList<>();
- private final Map<XLineBreakpoint<XBreakpointProperties>, Set<String>> myXBreakpointToVmBreakpointIdsMap = new THashMap<>();
+ private final Map<XLineBreakpoint<XBreakpointProperties>, Set<String>> myXBreakpointToVmBreakpointIdsMap = new HashMap<>();
IsolateBreakpointInfo(@NotNull String isolateId, @NotNull DartVmServiceDebugProcess debugProcess) {
this.myIsolateId = isolateId;
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.runner.server.vmService;
import com.google.common.base.Charsets;
import com.jetbrains.lang.dart.util.DartBazelFileUtil;
import com.jetbrains.lang.dart.util.DartResolveUtil;
import com.jetbrains.lang.dart.util.DartUrlResolver;
-import gnu.trove.THashMap;
-import gnu.trove.THashSet;
-import gnu.trove.TIntObjectHashMap;
+import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import org.dartlang.vm.service.VmService;
import org.dartlang.vm.service.element.*;
import org.dartlang.vm.service.logging.Logging;
import java.io.IOException;
import java.util.*;
-public class DartVmServiceDebugProcess extends XDebugProcess {
+public final class DartVmServiceDebugProcess extends XDebugProcess {
private static final Logger LOG = Logger.getInstance(DartVmServiceDebugProcess.class.getName());
private static final String ORG_DARTLANG_APP_PREFIX = "org-dartlang-app://";
private final IsolatesInfo myIsolatesInfo;
private VmServiceWrapper myVmServiceWrapper;
- private final @NotNull Set<String> mySuspendedIsolateIds = Collections.synchronizedSet(new THashSet<>());
+ private final @NotNull Set<String> mySuspendedIsolateIds = Collections.synchronizedSet(new HashSet<>());
private String myLatestCurrentIsolateId;
- private final Map<String, LightVirtualFile> myScriptIdToContentMap = new THashMap<>();
- private final Map<String, TIntObjectHashMap<Pair<Integer, Integer>>> myScriptIdToLinesAndColumnsMap =
- new THashMap<>();
+ private final Map<String, LightVirtualFile> myScriptIdToContentMap = new HashMap<>();
+ private final Map<String, Int2ObjectOpenHashMap<Pair<Integer, Integer>>> myScriptIdToLinesAndColumnsMap = new HashMap<>();
private final @Nullable String myDASExecutionContextId;
private final @NotNull DebugType myDebugType;
private final int myTimeout;
private final @Nullable VirtualFile myCurrentWorkingDirectory;
- protected @Nullable String myRemoteProjectRootUri;
+ @Nullable String myRemoteProjectRootUri;
private @Nullable String myBazelWorkspacePath;
private final @NotNull OpenDartObservatoryUrlAction myOpenObservatoryAction =
});
}
- protected void scheduleConnect(@NotNull String url) {
+ void scheduleConnect(@NotNull String url) {
ApplicationManager.getApplication().executeOnPooledThread(() -> {
long startTime = System.currentTimeMillis();
}
}
catch (IOException e) {
- StringBuilder message = new StringBuilder("Failed to connect to the VM observatory service: " + e.toString() + "\n");
+ StringBuilder message = new StringBuilder("Failed to connect to the VM observatory service: " + e + "\n");
Throwable cause = e.getCause();
while (cause != null) {
- message.append("Caused by: ").append(cause.toString()).append("\n");
+ message.append("Caused by: ").append(cause).append("\n");
final Throwable cause1 = cause.getCause();
if (cause1 != cause) {
cause = cause1;
file = myScriptIdToContentMap.get(scriptRef.getId());
}
- TIntObjectHashMap<Pair<Integer, Integer>> tokenPosToLineAndColumn = myScriptIdToLinesAndColumnsMap.get(scriptRef.getId());
+ Int2ObjectOpenHashMap<Pair<Integer, Integer>> tokenPosToLineAndColumn = myScriptIdToLinesAndColumnsMap.get(scriptRef.getId());
if (file != null && tokenPosToLineAndColumn != null) {
final Pair<Integer, Integer> lineAndColumn = tokenPosToLineAndColumn.get(tokenPos);
return uri.startsWith("dart:_") || uri.startsWith("dart:") && uri.contains("-patch/");
}
- private static @NotNull TIntObjectHashMap<Pair<Integer, Integer>> createTokenPosToLineAndColumnMap(@NotNull List<List<Integer>> tokenPosTable) {
+ private static @NotNull Int2ObjectOpenHashMap<Pair<Integer, Integer>> createTokenPosToLineAndColumnMap(@NotNull List<List<Integer>> tokenPosTable) {
// Each subarray consists of a line number followed by (tokenPos, columnNumber) pairs
// see https://github.com/dart-lang/vm_service_drivers/blob/master/dart/tool/service.md#script
- final TIntObjectHashMap<Pair<Integer, Integer>> result = new TIntObjectHashMap<>();
+ final Int2ObjectOpenHashMap<Pair<Integer, Integer>> result = new Int2ObjectOpenHashMap<>();
for (List<Integer> lineAndPairs : tokenPosTable) {
final Iterator<Integer> iterator = lineAndPairs.iterator();
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.runner.server.vmService;
-import gnu.trove.THashMap;
import org.dartlang.vm.service.element.Isolate;
import org.dartlang.vm.service.element.IsolateRef;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
-public class IsolatesInfo {
-
+public final class IsolatesInfo {
public static final class IsolateInfo {
private final String myIsolateId;
private final String myIsolateName;
}
}
- private final Map<String, IsolateInfo> myIsolateIdToInfoMap = new THashMap<>();
+ private final Map<String, IsolateInfo> myIsolateIdToInfoMap = new HashMap<>();
public synchronized boolean addIsolate(@NotNull final IsolateRef isolateRef) {
if (myIsolateIdToInfoMap.containsKey(isolateRef.getId())) {
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.runner.server.vmService.frame;
import com.intellij.openapi.editor.Document;
import com.jetbrains.lang.dart.ide.runner.server.vmService.VmServiceWrapper;
import com.jetbrains.lang.dart.psi.*;
import com.jetbrains.lang.dart.util.DartResolveUtil;
-import gnu.trove.THashSet;
import org.dartlang.vm.service.consumer.GetObjectConsumer;
import org.dartlang.vm.service.element.*;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.regex.Matcher;
private @Nullable LibraryRef findMatchingLibrary(@NotNull Isolate isolate, @NotNull List<VirtualFile> libraryFiles) {
if (!libraryFiles.isEmpty()) {
- Set<String> uris = new THashSet<>();
+ Set<String> uris = new HashSet<>();
for (VirtualFile libraryFile : libraryFiles) {
uris.addAll(myDebugProcess.getUrisForFile(libraryFile));
-// 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.
+// Copyright 2000-2021 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.lang.dart.ide.runner.test;
import com.google.gson.*;
import com.intellij.util.PathUtil;
import com.jetbrains.lang.dart.ide.runner.util.DartTestLocationProvider;
import com.jetbrains.lang.dart.util.DartUrlResolver;
-import gnu.trove.TIntLongHashMap;
+import it.unimi.dsi.fastutil.ints.Int2LongOpenHashMap;
import jetbrains.buildServer.messages.serviceMessages.ServiceMessageVisitor;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
private String myLocation;
private Key myCurrentOutputType;
private ServiceMessageVisitor myCurrentVisitor;
- private final TIntLongHashMap myTestIdToTimestamp;
+ private final Int2LongOpenHashMap myTestIdToTimestamp;
private final Map<Integer, Test> myTestData;
private final Map<Integer, Group> myGroupData;
private final Map<Integer, Suite> mySuiteData;
- private int mySuitCount;
public DartTestEventsConverter(@NotNull final String testFrameworkName,
@NotNull final TestConsoleProperties consoleProperties,
@NotNull final DartUrlResolver urlResolver) {
super(testFrameworkName, consoleProperties);
myUrlResolver = urlResolver;
- myTestIdToTimestamp = new TIntLongHashMap();
+ myTestIdToTimestamp = new Int2LongOpenHashMap();
myTestData = new HashMap<>();
myGroupData = new HashMap<>();
mySuiteData = new HashMap<>();
return message.endsWith("\n") ? message : message + "\n";
}
- private boolean handleAllSuites(JsonObject obj) {
+ private static boolean handleAllSuites(JsonObject obj) {
JsonElement elem = obj.get(JSON_COUNT);
- if (elem == null || !elem.isJsonPrimitive()) return true;
- mySuitCount = elem.getAsInt();
+ if (elem != null) {
+ elem.isJsonPrimitive();
+ }
return true;
}
myTestData.clear();
myGroupData.clear();
mySuiteData.clear();
- mySuitCount = 0;
return doProcessServiceMessages(ServiceMessageBuilder.testsStarted().toString());
}
- private boolean handleDone(JsonObject obj) throws ParseException {
+ private boolean handleDone(JsonObject obj) {
// The test runner has reached the end of the tests.
processAllTestsDone();
return true;
myTestData.clear();
myGroupData.clear();
mySuiteData.clear();
- mySuitCount = 0;
}
private boolean processGroupDone(@NotNull final Group group) throws ParseException {
}
}
- private static class Group extends Item {
- private int myTestCount = 0;
+ private static final class Group extends Item {
+ private final int myTestCount;
private int myDoneTestsCount = 0;
static Group from(JsonObject obj, Map<Integer, Group> groups, Map<Integer, Suite> suites) {
+// Copyright 2000-2021 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.lang.dart.psi.impl;
import com.intellij.lang.ASTNode;
import com.jetbrains.lang.dart.psi.*;
import com.jetbrains.lang.dart.util.DartClassResolveResult;
import com.jetbrains.lang.dart.util.DartResolveUtil;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
if (myMembersCache == null) {
myMembersCache = CachedValuesManager.getManager(getProject()).createCachedValue(
() -> {
- final Map<String, List<DartComponent>> nameToMembers = new THashMap<>();
+ final Map<String, List<DartComponent>> nameToMembers = new HashMap<>();
for (DartComponent component : DartResolveUtil.findNamedSubComponents(false, this)) {
final String componentName = component.getName();
+// Copyright 2000-2021 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.lang.dart.resolve;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.containers.Stack;
import com.jetbrains.lang.dart.ide.index.DartShowHideInfo;
import com.jetbrains.lang.dart.psi.DartComponentName;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.HashMap;
import java.util.Map;
public abstract class DartPsiScopeProcessor implements PsiScopeProcessor {
private static final Logger LOG = Logger.getInstance(DartResolveProcessor.class.getName());
private final Stack<Pair<VirtualFile, DartShowHideInfo>> myShowHideFilters = new Stack<>();
- private final Map<VirtualFile, Collection<PsiElement>> myFilteredOutElements = new THashMap<>();
+ private final Map<VirtualFile, Collection<PsiElement>> myFilteredOutElements = new HashMap<>();
public void importedFileProcessingStarted(final @NotNull VirtualFile importedFile, final @NotNull DartShowHideInfo showHideInfo) {
myShowHideFilters.push(Pair.create(importedFile, showHideInfo));
-// 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.
+// Copyright 2000-2021 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.lang.dart.sdk;
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.util.ui.UIUtil;
import com.jetbrains.lang.dart.DartBundle;
import com.jetbrains.lang.dart.flutter.FlutterUtil;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import javax.swing.text.JTextComponent;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.ExpandVetoException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Comparator;
-import java.util.Enumeration;
-
-public class DartConfigurable implements SearchableConfigurable, NoScroll {
+import java.util.*;
+public final class DartConfigurable implements SearchableConfigurable, NoScroll {
public static final int WEBDEV_PORT_DEFAULT = 53322;
private static final String WEBDEV_PORT_PROPERTY_NAME = "dart.webdev.port";
private boolean myDartSupportEnabledInitial;
private @Nullable DartSdk mySdkInitial;
- private final @NotNull Collection<Module> myModulesWithDartSdkLibAttachedInitial = new THashSet<>();
+ private final @NotNull Collection<Module> myModulesWithDartSdkLibAttachedInitial = new HashSet<>();
public DartConfigurable(final @NotNull Project project) {
myProject = project;
-// 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.
+// Copyright 2000-2021 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.lang.dart.util;
import com.intellij.psi.PsiElement;
import com.jetbrains.lang.dart.psi.*;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.Nullable;
+import java.util.HashSet;
import java.util.Set;
public final class DartControlFlowUtil {
public static Set<DartComponentName> getSimpleDeclarations(PsiElement[] children,
@Nullable PsiElement lastParent,
boolean stopAtLastParent) {
- final Set<DartComponentName> result = new THashSet<>();
+ final Set<DartComponentName> result = new HashSet<>();
boolean addComponentsFlag = true;
for (PsiElement child : children) {
if (child == lastParent && stopAtLastParent) {
-// 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.
+// Copyright 2000-2021 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.lang.dart.util;
import com.intellij.openapi.util.text.StringUtil;
import com.jetbrains.lang.dart.psi.DartClass;
import com.jetbrains.lang.dart.psi.DartComponent;
import com.jetbrains.lang.dart.psi.DartTypeArguments;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@Override
public DartGenericSpecialization clone() {
- final Map<String, DartClassResolveResult> clonedMap = new THashMap<>();
+ final Map<String, DartClassResolveResult> clonedMap = new HashMap<>();
for (String key : map.keySet()) {
clonedMap.put(key, map.get(key));
}
public DartGenericSpecialization getInnerSpecialization(PsiElement element) {
final String prefixToRemove = getGenericKey(element, "");
- final Map<String, DartClassResolveResult> result = new THashMap<>();
+ final Map<String, DartClassResolveResult> result = new HashMap<>();
for (String key : map.keySet()) {
final DartClassResolveResult value = map.get(key);
String newKey = key;
-// 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.
+// Copyright 2000-2021 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.lang.dart.util;
import com.intellij.codeInsight.PsiEquivalenceUtil;
import com.jetbrains.lang.dart.DartTokenTypes;
import com.jetbrains.lang.dart.psi.*;
import com.jetbrains.lang.dart.resolve.ComponentNameScopeProcessor;
-import gnu.trove.THashSet;
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.*;
public final class DartRefactoringUtil {
public static Set<String> collectUsedNames(PsiElement context) {
- return new THashSet<>(ContainerUtil.map(collectUsedComponents(context), NavigationItem::getName));
+ return new HashSet<>(ContainerUtil.map(collectUsedComponents(context), NavigationItem::getName));
}
public static Set<DartComponentName> collectUsedComponents(PsiElement context) {
- final Set<DartComponentName> usedComponentNames = new THashSet<>();
+ final Set<DartComponentName> usedComponentNames = new HashSet<>();
PsiTreeUtil.treeWalkUp(new ComponentNameScopeProcessor(usedComponentNames), context, null, ResolveState.initial());
return usedComponentNames;
}
-// 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.
+// Copyright 2000-2021 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.lang.dart.util;
import com.intellij.openapi.project.Project;
import com.jetbrains.lang.dart.psi.impl.DartPsiCompositeElementImpl;
import com.jetbrains.lang.dart.resolve.DartPsiScopeProcessor;
import com.jetbrains.lang.dart.resolve.DartResolveProcessor;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
if (filesOfInterest != null && filesOfInterest.isEmpty()) return true;
final boolean privateOnly = componentNameHint != null && componentNameHint.startsWith("_");
- return processTopLevelDeclarationsImpl(context, processor, rootVirtualFile, filesOfInterest, new THashSet<>(), privateOnly);
+ return processTopLevelDeclarationsImpl(context, processor, rootVirtualFile, filesOfInterest, new HashSet<>(), privateOnly);
}
private static boolean processTopLevelDeclarationsImpl(final @NotNull PsiElement context,
if (librariesForContext1.isEmpty()) return false;
final List<VirtualFile> librariesForContext2 = findLibrary(context2.getContainingFile());
if (librariesForContext2.isEmpty()) return false;
- final THashSet<VirtualFile> librariesSetForContext1 = new THashSet<>(librariesForContext1);
+ final Set<VirtualFile> librariesSetForContext1 = new HashSet<>(librariesForContext1);
return ContainerUtil.find(librariesForContext2, librariesSetForContext1::contains) != null;
}
}
public static boolean processSuperClasses(PsiElementProcessor<? super DartClass> processor, DartClass @NotNull ... rootDartClasses) {
- final Set<DartClass> processedClasses = new THashSet<>();
- final LinkedList<DartClass> classes = new LinkedList<>();
- classes.addAll(Arrays.asList(rootDartClasses));
-
+ final Set<DartClass> processedClasses = new HashSet<>();
+ LinkedList<DartClass> classes = new LinkedList<>(Arrays.asList(rootDartClasses));
while (!classes.isEmpty()) {
final DartClass dartClass = classes.pollFirst();
if (dartClass == null || processedClasses.contains(dartClass)) {
public static void processSupers(@Nullable PsiElementProcessor<? super DartClass> superClassProcessor,
@Nullable PsiElementProcessor<? super DartClass> superInterfaceProcessor,
@Nullable DartClass rootDartClass) {
- final Set<DartClass> processedClasses = new THashSet<>();
+ final Set<DartClass> processedClasses = new HashSet<>();
DartClass currentClass = rootDartClass;
while (currentClass != null) {
processedClasses.add(currentClass);
-// 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-2021 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.lang.dart.util;
import com.intellij.openapi.application.ApplicationManager;
import com.jetbrains.lang.dart.sdk.DartPackagesLibraryProperties;
import com.jetbrains.lang.dart.sdk.DartPackagesLibraryType;
import com.jetbrains.lang.dart.sdk.DartSdk;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
-public class DartUrlResolverImpl extends DartUrlResolver {
+public final class DartUrlResolverImpl extends DartUrlResolver {
// TODO Fold into superclass.
@NotNull private final Project myProject;
@Nullable private final DartSdk myDartSdk;
@Nullable private final VirtualFile myPubspecYamlFile;
// myLivePackageNameToDirMap also contains packages map from .packages file if applicable
- @NotNull private final Map<String, VirtualFile> myLivePackageNameToDirMap = new THashMap<>();
+ @NotNull private final Map<String, VirtualFile> myLivePackageNameToDirMap = new HashMap<>();
// myPackagesMapFromLib is not empty only if pubspec.yaml file is null
- @NotNull private final Map<String, List<String>> myPackagesMapFromLib = new THashMap<>();
+ @NotNull private final Map<String, List<String>> myPackagesMapFromLib = new HashMap<>();
public DartUrlResolverImpl(final @NotNull Project project, final @NotNull VirtualFile contextFile) {
myProject = project;
-// 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.
+// Copyright 2000-2021 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.lang.dart.util;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.util.io.URLUtil;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
lines = FileUtil.loadLines(dotPackagesFile.getPath(), "UTF-8");
}
- final Map<String, String> result = new THashMap<>();
+ final Map<String, String> result = new HashMap<>();
for (String line : lines) {
if (line.trim().isEmpty() || line.startsWith("#")) continue;
-// 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.
+// Copyright 2000-2021 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.lang.dart.util;
import com.intellij.openapi.editor.Document;
import com.intellij.util.PairConsumer;
import com.jetbrains.lang.dart.ide.errorTreeView.DartProblemsView;
import com.jetbrains.lang.dart.ide.errorTreeView.DartProblemsViewSettings;
-import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.resolver.Resolver;
import java.io.IOException;
+import java.util.HashSet;
import java.util.Map;
import java.util.Set;
public final class PubspecYamlUtil {
-
public static final String PUBSPEC_YAML = "pubspec.yaml";
private static final String NAME = "name";
public static void processInProjectPathPackagesRecursively(@NotNull final Project project,
@NotNull final VirtualFile pubspecYamlFile,
@NotNull final PairConsumer<String, VirtualFile> pathPackageNameAndDirConsumer) {
-
- processInProjectPathPackagesRecursively(project, pubspecYamlFile, new THashSet<>(), pathPackageNameAndDirConsumer);
+ processInProjectPathPackagesRecursively(project, pubspecYamlFile, new HashSet<>(), pathPackageNameAndDirConsumer);
}
private static void processInProjectPathPackagesRecursively(@NotNull final Project project,
-// 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-2021 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.lang.dart.dart_style;
-import gnu.trove.THashSet;
-
-import java.util.Set;
+import java.util.HashSet;
/**
* Run the dart_style test suite using the expected output as the input.
*/
@Override
protected void runTestInDirectory(String dirName) throws Exception {
- Set<String> fail = new THashSet<>();
- fail.addAll(KNOWN_TO_FAIL);
- runTestInDirectory(dirName, fail);
+ runTestInDirectory(dirName, new HashSet<String>(KNOWN_TO_FAIL));
}
@Override
-// 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-2021 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.lang.dart.dart_style;
-import gnu.trove.THashSet;
-
+import java.util.HashSet;
import java.util.Set;
/**
/**
* The set of tests that are known to fail only in strict mode.
*/
- private final Set<String> KNOWN_TO_FAIL_STRICT = new THashSet<>();
+ private final Set<String> KNOWN_TO_FAIL_STRICT = new HashSet<>();
{
KNOWN_TO_FAIL_STRICT.add("splitting/expressions.stmt:13 adjacent string lines all split together;");
*/
@Override
protected void runTestInDirectory(String dirName) throws Exception {
- Set<String> fail = new THashSet<>();
+ Set<String> fail = new HashSet<>();
fail.addAll(KNOWN_TO_FAIL);
fail.addAll(KNOWN_TO_FAIL_STRICT);
runTestInDirectory(dirName, fail);
-// 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-2021 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.lang.dart.dart_style;
import com.intellij.openapi.util.io.FileUtil;
import com.jetbrains.lang.dart.DartFileType;
import com.jetbrains.lang.dart.DartLanguage;
import com.jetbrains.lang.dart.util.DartTestUtils;
-import gnu.trove.THashSet;
import junit.framework.ComparisonFailure;
import java.io.File;
+import java.util.HashSet;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* The set of tests that are known to fail in all test modes.
*/
- protected final Set<String> KNOWN_TO_FAIL = new THashSet<>();
+ protected final Set<String> KNOWN_TO_FAIL = new HashSet<>();
{
KNOWN_TO_FAIL.add("splitting/expressions.stmt:7 space-separated adjacent strings are split if they don't fit");
-// 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.
+// Copyright 2000-2021 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.flex.bc;
import com.intellij.flex.FlexCommonUtils;
import com.intellij.testFramework.HeavyPlatformTestCase;
import com.intellij.testFramework.PsiTestUtil;
import com.intellij.util.PathUtil;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
}
private static Map<String, String> createMap(String... keysAndValues) {
- final Map<String, String> result = new THashMap<>();
+ final Map<String, String> result = new HashMap<>();
for (int i = 0; i < keysAndValues.length; i++) {
//noinspection AssignmentToForLoopParameter
result.put(keysAndValues[i], keysAndValues[++i]);
<orderEntry type="module" module-name="intellij.java.i18n" scope="TEST" />
<orderEntry type="module" module-name="intellij.idea.ultimate.resources" scope="RUNTIME" />
<orderEntry type="library" name="fastutil-min" level="project" />
- <orderEntry type="library" scope="TEST" name="Trove4j" level="project" />
<orderEntry type="module" module-name="intellij.platform.core.ui" scope="TEST" />
<orderEntry type="module" module-name="intellij.properties.psi.impl" scope="TEST" />
<orderEntry type="library" scope="TEST" name="JUnit4" level="project" />