diff --git a/jps/jps-builders-6/intellij.platform.jps.build.javac.rt.iml b/jps/jps-builders-6/intellij.platform.jps.build.javac.rt.iml
index b2028be90cbe..55aedb2e3f10 100644
--- a/jps/jps-builders-6/intellij.platform.jps.build.javac.rt.iml
+++ b/jps/jps-builders-6/intellij.platform.jps.build.javac.rt.iml
@@ -10,7 +10,6 @@
-
diff --git a/jps/jps-builders-6/src/org/jetbrains/jps/javac/DefaultFileOperations.java b/jps/jps-builders-6/src/org/jetbrains/jps/javac/DefaultFileOperations.java
index d23865764710..12ea81920523 100644
--- a/jps/jps-builders-6/src/org/jetbrains/jps/javac/DefaultFileOperations.java
+++ b/jps/jps-builders-6/src/org/jetbrains/jps/javac/DefaultFileOperations.java
@@ -1,16 +1,13 @@
-// 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 org.jetbrains.jps.javac;
import com.intellij.openapi.util.text.StringUtilRt;
import com.intellij.util.BooleanFunction;
import com.intellij.util.Function;
-import gnu.trove.THashMap;
-import gnu.trove.TObjectByteHashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
-import javax.tools.JavaFileManager;
-import javax.tools.JavaFileObject;
+import javax.tools.*;
import java.io.File;
import java.io.IOException;
import java.util.*;
@@ -20,6 +17,7 @@ import java.util.zip.ZipFile;
final class DefaultFileOperations implements FileOperations {
private static final File[] NULL_FILE_ARRAY = new File[0];
private static final Archive NULL_ARCHIVE = new Archive() {
+ @NotNull
@Override
public Iterable list(String relPath, Set extends JavaFileObject.Kind> kinds, boolean recurse) {
return Collections.emptyList();
@@ -28,14 +26,10 @@ final class DefaultFileOperations implements FileOperations {
public void close(){
}
};
- private static final byte UNKNOWN = 0;
- private static final byte NO = 1;
- private static final byte YES = 2;
-
- private final Map myDirectoryCache = new THashMap();
- private final Map myArchiveCache = new THashMap();
- private final TObjectByteHashMap myIsFile = new TObjectByteHashMap();
+ private final Map myDirectoryCache = new HashMap();
+ private final Map myArchiveCache = new HashMap();
+ private final Map myIsFile = new HashMap();
@Override
@NotNull
@@ -79,12 +73,12 @@ final class DefaultFileOperations implements FileOperations {
@Override
public boolean isFile(File file) {
- byte cachedIsFile = myIsFile.get(file);
- if (cachedIsFile == UNKNOWN) {
- cachedIsFile = file.isFile() ? YES : NO;
+ Boolean cachedIsFile = myIsFile.get(file);
+ if (cachedIsFile == null) {
+ cachedIsFile = file.isFile();
myIsFile.put(file, cachedIsFile);
}
- return cachedIsFile == YES;
+ return cachedIsFile == Boolean.TRUE;
}
@Override
@@ -168,7 +162,7 @@ final class DefaultFileOperations implements FileOperations {
private static class ZipArchive implements FileOperations.Archive {
private final ZipFile myZip;
- private final Map> myPaths = new THashMap>();
+ private final Map> myPaths = new HashMap>();
private final Function myToFileObjectConverter;
private static final FileObjectKindFilter ourEntryFilter = new FileObjectKindFilter(new Function() {
@Override
diff --git a/jps/jps-builders-6/src/org/jetbrains/jps/javac/ModulePath.java b/jps/jps-builders-6/src/org/jetbrains/jps/javac/ModulePath.java
index bad6ffea7127..407c3ed310c2 100644
--- a/jps/jps-builders-6/src/org/jetbrains/jps/javac/ModulePath.java
+++ b/jps/jps-builders-6/src/org/jetbrains/jps/javac/ModulePath.java
@@ -1,13 +1,8 @@
-// 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 org.jetbrains.jps.javac;
-import gnu.trove.THashMap;
-
import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
+import java.util.*;
public abstract class ModulePath {
public interface Builder {
@@ -61,7 +56,7 @@ public abstract class ModulePath {
public static Builder newBuilder() {
return new Builder() {
- private final Map myMap = new THashMap();
+ private final Map myMap = new HashMap();
private final Collection myPath = new ArrayList();
@Override
diff --git a/jps/jps-builders/src/org/jetbrains/jps/backwardRefs/BackwardReferenceIndexUtil.java b/jps/jps-builders/src/org/jetbrains/jps/backwardRefs/BackwardReferenceIndexUtil.java
index c813d7a36c57..e960c5764c3a 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/backwardRefs/BackwardReferenceIndexUtil.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/backwardRefs/BackwardReferenceIndexUtil.java
@@ -1,4 +1,4 @@
-// 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 org.jetbrains.jps.backwardRefs;
import com.intellij.openapi.diagnostic.Logger;
@@ -125,13 +125,13 @@ public final class BackwardReferenceIndexUtil {
}
}
- private static class AnonymousClassEnumerator {
- private THashMap myAnonymousName2Id = null;
+ private static final class AnonymousClassEnumerator {
+ private Map myAnonymousName2Id = null;
private CompilerRef.JavaCompilerAnonymousClassRef addAnonymous(String internalName,
CompilerRef.JavaCompilerClassRef base) {
if (myAnonymousName2Id == null) {
- myAnonymousName2Id = new THashMap<>();
+ myAnonymousName2Id = new HashMap<>();
}
final int anonymousIdx = myAnonymousName2Id.size();
myAnonymousName2Id.put(internalName, base);
diff --git a/jps/jps-builders/src/org/jetbrains/jps/builders/impl/BuildTargetIndexImpl.java b/jps/jps-builders/src/org/jetbrains/jps/builders/impl/BuildTargetIndexImpl.java
index 2623605c10fd..e6da31c0b096 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/builders/impl/BuildTargetIndexImpl.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/builders/impl/BuildTargetIndexImpl.java
@@ -1,4 +1,4 @@
-// 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 org.jetbrains.jps.builders.impl;
import com.intellij.util.containers.ContainerUtil;
@@ -6,7 +6,6 @@ import com.intellij.util.graph.DFSTBuilder;
import com.intellij.util.graph.Graph;
import com.intellij.util.graph.GraphGenerator;
import com.intellij.util.graph.InboundSemiGraph;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jps.builders.*;
import org.jetbrains.jps.incremental.CompileContext;
@@ -14,7 +13,7 @@ import org.jetbrains.jps.model.module.JpsModule;
import java.util.*;
-public class BuildTargetIndexImpl implements BuildTargetIndex {
+public final class BuildTargetIndexImpl implements BuildTargetIndex {
private final BuildTargetRegistry myRegistry;
private final BuildRootIndexImpl myBuildRootIndex;
private final Map, Collection>> myDependencies;
@@ -23,7 +22,7 @@ public class BuildTargetIndexImpl implements BuildTargetIndex {
public BuildTargetIndexImpl(BuildTargetRegistry targetRegistry, BuildRootIndexImpl buildRootIndex) {
myRegistry = targetRegistry;
myBuildRootIndex = buildRootIndex;
- myDependencies = new THashMap<>();
+ myDependencies = new HashMap<>();
}
@Override
diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/CompilerEncodingConfiguration.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/CompilerEncodingConfiguration.java
index cb3cd2e411f4..6e60e40166b1 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/incremental/CompilerEncodingConfiguration.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/CompilerEncodingConfiguration.java
@@ -1,24 +1,9 @@
-/*
- * Copyright 2000-2012 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 org.jetbrains.jps.incremental;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.io.FileUtilRt;
import com.intellij.util.containers.ContainerUtil;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.ModuleChunk;
@@ -59,7 +44,7 @@ public class CompilerEncodingConfiguration {
}
private Map> computeModuleCharsetMap() {
- final Map> map = new THashMap<>();
+ final Map> map = new HashMap<>();
final Iterable builderExtensions = JpsServiceManager.getInstance().getExtensions(JavaBuilderExtension.class);
for (Map.Entry entry : myUrlToCharset.entrySet()) {
final String fileUrl = entry.getKey();
diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/RmiStubsGenerator.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/RmiStubsGenerator.java
index f5a8ec78064d..0d57192d5788 100644
--- a/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/RmiStubsGenerator.java
+++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/instrumentation/RmiStubsGenerator.java
@@ -1,4 +1,4 @@
-// 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 org.jetbrains.jps.incremental.instrumentation;
import com.intellij.compiler.instrumentation.InstrumentationClassFinder;
@@ -14,7 +14,6 @@ import com.intellij.util.ArrayUtilRt;
import com.intellij.util.SmartList;
import com.intellij.util.SystemProperties;
import com.intellij.util.containers.FileCollectionFactory;
-import gnu.trove.THashMap;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -76,7 +75,7 @@ public final class RmiStubsGenerator extends ClassProcessingBuilder {
protected ExitCode performBuild(CompileContext context, ModuleChunk chunk, InstrumentationClassFinder finder, OutputConsumer outputConsumer) {
ExitCode exitCode = ExitCode.NOTHING_DONE;
if (!outputConsumer.getCompiledClasses().isEmpty()) {
- final Map> remoteClasses = new THashMap<>();
+ final Map> remoteClasses = new HashMap<>();
for (ModuleBuildTarget target : chunk.getTargets()) {
for (CompiledClass compiledClass : outputConsumer.getTargetCompiledClasses(target)) {
try {
diff --git a/jps/model-impl/intellij.platform.jps.model.tests.iml b/jps/model-impl/intellij.platform.jps.model.tests.iml
index 249c319a5d8c..19fd09b671e0 100644
--- a/jps/model-impl/intellij.platform.jps.model.tests.iml
+++ b/jps/model-impl/intellij.platform.jps.model.tests.iml
@@ -11,6 +11,5 @@
-
\ No newline at end of file
diff --git a/platform/build-scripts/icons/src/org/jetbrains/intellij/build/images/IconsClassGenerator.kt b/platform/build-scripts/icons/src/org/jetbrains/intellij/build/images/IconsClassGenerator.kt
index 701111de6864..9e791b9c6dd8 100644
--- a/platform/build-scripts/icons/src/org/jetbrains/intellij/build/images/IconsClassGenerator.kt
+++ b/platform/build-scripts/icons/src/org/jetbrains/intellij/build/images/IconsClassGenerator.kt
@@ -83,6 +83,13 @@ internal open class IconsClassGenerator(private val projectHome: Path,
val dir = module.getSourceRoots(JavaSourceRootType.SOURCE).first().file.absolutePath + '/' + packageName.replace('.', '/')
outFile = Path.of(dir, "$className.java")
}
+ "intellij.css" -> {
+ packageName = "com.intellij.lang.css"
+ className = "CssIcons"
+
+ val dir = module.getSourceRoots(JavaSourceRootType.SOURCE).first().file.absolutePath + '/' + packageName.replace('.', '/')
+ outFile = Path.of(dir, "$className.java")
+ }
"intellij.android.artwork" -> {
packageName = "icons"
diff --git a/platform/diff-impl/intellij.platform.diff.impl.iml b/platform/diff-impl/intellij.platform.diff.impl.iml
index d52958340942..e221f03767dc 100644
--- a/platform/diff-impl/intellij.platform.diff.impl.iml
+++ b/platform/diff-impl/intellij.platform.diff.impl.iml
@@ -19,7 +19,7 @@
-
+
\ No newline at end of file
diff --git a/platform/diff-impl/src/com/intellij/diff/comparison/ByChar.java b/platform/diff-impl/src/com/intellij/diff/comparison/ByChar.java
index 541af21136dc..9dc83a6f2867 100644
--- a/platform/diff-impl/src/com/intellij/diff/comparison/ByChar.java
+++ b/platform/diff-impl/src/com/intellij/diff/comparison/ByChar.java
@@ -1,4 +1,4 @@
-// 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.diff.comparison;
import com.intellij.diff.comparison.iterables.DiffIterable;
@@ -6,7 +6,7 @@ import com.intellij.diff.comparison.iterables.FairDiffIterable;
import com.intellij.diff.util.Range;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.util.Pair;
-import gnu.trove.TIntArrayList;
+import it.unimi.dsi.fastutil.ints.IntArrayList;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
@@ -206,7 +206,7 @@ public final class ByChar {
//
private static int @NotNull [] getAllCodePoints(@NotNull CharSequence text) {
- TIntArrayList list = new TIntArrayList(text.length());
+ IntArrayList list = new IntArrayList(text.length());
int len = text.length();
int offset = 0;
@@ -220,13 +220,13 @@ public final class ByChar {
offset += charCount;
}
- return list.toNativeArray();
+ return list.toIntArray();
}
@NotNull
private static CodePointsOffsets getNonSpaceCodePoints(@NotNull CharSequence text) {
- TIntArrayList codePoints = new TIntArrayList(text.length());
- TIntArrayList offsets = new TIntArrayList(text.length());
+ IntArrayList codePoints = new IntArrayList(text.length());
+ IntArrayList offsets = new IntArrayList(text.length());
int len = text.length();
int offset = 0;
@@ -243,13 +243,13 @@ public final class ByChar {
offset += charCount;
}
- return new CodePointsOffsets(codePoints.toNativeArray(), offsets.toNativeArray());
+ return new CodePointsOffsets(codePoints.toIntArray(), offsets.toIntArray());
}
@NotNull
private static CodePointsOffsets getPunctuationChars(@NotNull CharSequence text) {
- TIntArrayList codePoints = new TIntArrayList(text.length());
- TIntArrayList offsets = new TIntArrayList(text.length());
+ IntArrayList codePoints = new IntArrayList(text.length());
+ IntArrayList offsets = new IntArrayList(text.length());
for (int i = 0; i < text.length(); i++) {
char c = text.charAt(i);
@@ -259,7 +259,7 @@ public final class ByChar {
}
}
- return new CodePointsOffsets(codePoints.toNativeArray(), offsets.toNativeArray());
+ return new CodePointsOffsets(codePoints.toIntArray(), offsets.toIntArray());
}
private static int countChars(int[] codePoints, int start, int end) {
diff --git a/platform/diff-impl/src/com/intellij/diff/comparison/ByLine.java b/platform/diff-impl/src/com/intellij/diff/comparison/ByLine.java
index 199e52c6de42..b5e261c4e79e 100644
--- a/platform/diff-impl/src/com/intellij/diff/comparison/ByLine.java
+++ b/platform/diff-impl/src/com/intellij/diff/comparison/ByLine.java
@@ -1,4 +1,4 @@
-// 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.diff.comparison;
import com.intellij.diff.comparison.iterables.FairDiffIterable;
@@ -8,7 +8,8 @@ import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.containers.ContainerUtil;
-import gnu.trove.TIntArrayList;
+import it.unimi.dsi.fastutil.ints.IntArrayList;
+import it.unimi.dsi.fastutil.ints.IntList;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
@@ -189,8 +190,8 @@ public final class ByLine {
int start1 = Math.max(last1, builder.getIndex1());
int start2 = Math.max(last2, builder.getIndex2());
- TIntArrayList subLines1 = new TIntArrayList();
- TIntArrayList subLines2 = new TIntArrayList();
+ IntArrayList subLines1 = new IntArrayList();
+ IntArrayList subLines2 = new IntArrayList();
for (int i = start1; i < line1; i++) {
if (StringUtil.equalsIgnoreWhitespaces(sample, lines1.get(i).getContent())) {
subLines1.add(i);
@@ -210,7 +211,7 @@ public final class ByLine {
sample = null;
}
- private void alignExactMatching(TIntArrayList subLines1, TIntArrayList subLines2) {
+ private void alignExactMatching(IntList subLines1, IntList subLines2) {
int n = Math.max(subLines1.size(), subLines2.size());
boolean skipAligning = n > 10 || // we use brute-force algorithm (C_n_k). This will limit search space by ~250 cases.
subLines1.size() == subLines2.size(); // nothing to do
@@ -218,8 +219,8 @@ public final class ByLine {
if (skipAligning) {
int count = Math.min(subLines1.size(), subLines2.size());
for (int i = 0; i < count; i++) {
- int index1 = subLines1.get(i);
- int index2 = subLines2.get(i);
+ int index1 = subLines1.getInt(i);
+ int index2 = subLines2.getInt(i);
if (lines1.get(index1).equals(lines2.get(index2))) {
builder.markEqual(index1, index2);
}
@@ -230,8 +231,8 @@ public final class ByLine {
if (subLines1.size() < subLines2.size()) {
int[] matching = getBestMatchingAlignment(subLines1, subLines2, lines1, lines2);
for (int i = 0; i < subLines1.size(); i++) {
- int index1 = subLines1.get(i);
- int index2 = subLines2.get(matching[i]);
+ int index1 = subLines1.getInt(i);
+ int index2 = subLines2.getInt(matching[i]);
if (lines1.get(index1).equals(lines2.get(index2))) {
builder.markEqual(index1, index2);
}
@@ -240,8 +241,8 @@ public final class ByLine {
else {
int[] matching = getBestMatchingAlignment(subLines2, subLines1, lines2, lines1);
for (int i = 0; i < subLines2.size(); i++) {
- int index1 = subLines1.get(matching[i]);
- int index2 = subLines2.get(i);
+ int index1 = subLines1.getInt(matching[i]);
+ int index2 = subLines2.getInt(i);
if (lines1.get(index1).equals(lines2.get(index2))) {
builder.markEqual(index1, index2);
}
@@ -253,8 +254,8 @@ public final class ByLine {
return fair(builder.finish());
}
- private static int @NotNull [] getBestMatchingAlignment(@NotNull final TIntArrayList subLines1,
- @NotNull final TIntArrayList subLines2,
+ private static int @NotNull [] getBestMatchingAlignment(@NotNull final IntList subLines1,
+ @NotNull final IntList subLines2,
@NotNull final List extends Line> lines1,
@NotNull final List extends Line> lines2) {
assert subLines1.size() < subLines2.size();
@@ -289,8 +290,8 @@ public final class ByLine {
private void processCombination() {
int weight = 0;
for (int i = 0; i < size; i++) {
- int index1 = subLines1.get(i);
- int index2 = subLines2.get(comb[i]);
+ int index1 = subLines1.getInt(i);
+ int index2 = subLines2.getInt(comb[i]);
if (lines1.get(index1).equals(lines2.get(index2))) weight++;
}
@@ -324,17 +325,17 @@ public final class ByLine {
int threshold = ComparisonUtil.getUnimportantLineCharCount();
if (threshold == 0) return diff(lines1, lines2, indicator);
- Pair, TIntArrayList> bigLines1 = getBigLines(lines1, threshold);
- Pair, TIntArrayList> bigLines2 = getBigLines(lines2, threshold);
+ Pair, IntList> bigLines1 = getBigLines(lines1, threshold);
+ Pair, IntList> bigLines2 = getBigLines(lines2, threshold);
FairDiffIterable changes = diff(bigLines1.first, bigLines2.first, indicator);
return new ChangeCorrector.SmartLineChangeCorrector(bigLines1.second, bigLines2.second, lines1, lines2, changes, indicator).build();
}
@NotNull
- private static Pair, TIntArrayList> getBigLines(@NotNull List extends Line> lines, int threshold) {
+ private static Pair, IntList> getBigLines(@NotNull List extends Line> lines, int threshold) {
List bigLines = new ArrayList<>(lines.size());
- TIntArrayList indexes = new TIntArrayList(lines.size());
+ IntList indexes = new IntArrayList(lines.size());
for (int i = 0; i < lines.size(); i++) {
Line line = lines.get(i);
diff --git a/platform/diff-impl/src/com/intellij/diff/comparison/ChangeCorrector.java b/platform/diff-impl/src/com/intellij/diff/comparison/ChangeCorrector.java
index 8a67f49e9eb1..b7490b90a4be 100644
--- a/platform/diff-impl/src/com/intellij/diff/comparison/ChangeCorrector.java
+++ b/platform/diff-impl/src/com/intellij/diff/comparison/ChangeCorrector.java
@@ -1,4 +1,4 @@
-// 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.diff.comparison;
import com.intellij.diff.comparison.ByLine.Line;
@@ -7,7 +7,7 @@ import com.intellij.diff.comparison.iterables.FairDiffIterable;
import com.intellij.diff.util.Range;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.util.IntPair;
-import gnu.trove.TIntArrayList;
+import it.unimi.dsi.fastutil.ints.IntList;
import org.jetbrains.annotations.NotNull;
import java.util.List;
@@ -128,14 +128,14 @@ abstract class ChangeCorrector {
}
}
- public static class SmartLineChangeCorrector extends ChangeCorrector {
- @NotNull private final TIntArrayList myIndexes1;
- @NotNull private final TIntArrayList myIndexes2;
+ public static final class SmartLineChangeCorrector extends ChangeCorrector {
+ @NotNull private final IntList myIndexes1;
+ @NotNull private final IntList myIndexes2;
@NotNull private final List extends Line> myLines1;
@NotNull private final List extends Line> myLines2;
- public SmartLineChangeCorrector(@NotNull TIntArrayList indexes1,
- @NotNull TIntArrayList indexes2,
+ public SmartLineChangeCorrector(@NotNull IntList indexes1,
+ @NotNull IntList indexes2,
@NotNull List extends Line> lines1,
@NotNull List extends Line> lines2,
@NotNull FairDiffIterable changes,
@@ -166,13 +166,13 @@ abstract class ChangeCorrector {
@Override
protected IntPair getOriginalRange1(int index) {
- int offset = myIndexes1.get(index);
+ int offset = myIndexes1.getInt(index);
return new IntPair(offset, offset + 1);
}
@Override
protected IntPair getOriginalRange2(int index) {
- int offset = myIndexes2.get(index);
+ int offset = myIndexes2.getInt(index);
return new IntPair(offset, offset + 1);
}
}
diff --git a/platform/diff-impl/src/com/intellij/diff/merge/MergeModelBase.java b/platform/diff-impl/src/com/intellij/diff/merge/MergeModelBase.java
index 533410af974c..4542c628f207 100644
--- a/platform/diff-impl/src/com/intellij/diff/merge/MergeModelBase.java
+++ b/platform/diff-impl/src/com/intellij/diff/merge/MergeModelBase.java
@@ -1,4 +1,4 @@
-// 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.intellij.diff.merge;
import com.intellij.diff.util.DiffUtil;
@@ -16,14 +16,17 @@ import com.intellij.openapi.util.NlsContexts;
import com.intellij.util.SmartList;
import com.intellij.util.concurrency.annotations.RequiresEdt;
import com.intellij.util.concurrency.annotations.RequiresWriteLock;
-import gnu.trove.TIntArrayList;
-import gnu.trove.TIntHashSet;
+import it.unimi.dsi.fastutil.ints.IntArrayList;
+import it.unimi.dsi.fastutil.ints.IntList;
+import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
+import it.unimi.dsi.fastutil.ints.IntSet;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
+import java.util.function.IntConsumer;
public abstract class MergeModelBase implements Disposable {
private static final Logger LOG = Logger.getInstance(MergeModelBase.class);
@@ -32,10 +35,10 @@ public abstract class MergeModelBase implements
@NotNull private final Document myDocument;
@Nullable private final UndoManager myUndoManager;
- @NotNull private final TIntArrayList myStartLines = new TIntArrayList();
- @NotNull private final TIntArrayList myEndLines = new TIntArrayList();
+ @NotNull private final IntArrayList myStartLines = new IntArrayList();
+ @NotNull private final IntArrayList myEndLines = new IntArrayList();
- @NotNull private final TIntHashSet myChangesToUpdate = new TIntHashSet();
+ @NotNull private final IntSet myChangesToUpdate = new IntOpenHashSet();
private int myBulkChangeUpdateDepth;
private boolean myInsideCommand;
@@ -71,16 +74,16 @@ public abstract class MergeModelBase implements
}
public int getLineStart(int index) {
- return myStartLines.get(index);
+ return myStartLines.getInt(index);
}
public int getLineEnd(int index) {
- return myEndLines.get(index);
+ return myEndLines.getInt(index);
}
public void setChanges(@NotNull List extends LineRange> changes) {
- myStartLines.clear(changes.size());
- myEndLines.clear(changes.size());
+ myStartLines.clear();
+ myEndLines.clear();
for (LineRange range : changes) {
myStartLines.add(range.start);
@@ -126,9 +129,8 @@ public abstract class MergeModelBase implements
LOG.assertTrue(myBulkChangeUpdateDepth >= 0);
if (myBulkChangeUpdateDepth == 0) {
- myChangesToUpdate.forEach(index -> {
+ myChangesToUpdate.forEach((IntConsumer)index -> {
reinstallHighlighters(index);
- return true;
});
myChangesToUpdate.clear();
}
@@ -208,9 +210,9 @@ public abstract class MergeModelBase implements
@Nullable String commandGroupId,
@NotNull UndoConfirmationPolicy confirmationPolicy,
boolean underBulkUpdate,
- @Nullable TIntArrayList affectedChanges,
+ @Nullable IntList affectedChanges,
@NotNull Runnable task) {
- TIntArrayList allAffectedChanges = affectedChanges != null ? collectAffectedChanges(affectedChanges) : null;
+ IntList allAffectedChanges = affectedChanges != null ? collectAffectedChanges(affectedChanges) : null;
return DiffUtil.executeWriteCommand(myProject, myDocument, commandName, commandGroupId, confirmationPolicy, underBulkUpdate, () -> {
LOG.assertTrue(!myInsideCommand);
@@ -236,15 +238,14 @@ public abstract class MergeModelBase implements
});
}
- private void registerUndoRedo(boolean undo, @Nullable TIntArrayList affectedChanges) {
+ private void registerUndoRedo(boolean undo, @Nullable IntList affectedChanges) {
if (myUndoManager == null) return;
List states;
if (affectedChanges != null) {
states = new ArrayList<>(affectedChanges.size());
- affectedChanges.forEach((index) -> {
+ affectedChanges.forEach((IntConsumer)(index) -> {
states.add(storeChangeState(index));
- return true;
});
}
else {
@@ -256,7 +257,7 @@ public abstract class MergeModelBase implements
myUndoManager.undoableActionPerformed(new MyUndoableAction(this, states, undo));
}
- private static class MyUndoableAction extends BasicUndoableAction {
+ private static final class MyUndoableAction extends BasicUndoableAction {
@NotNull private final WeakReference myModelRef;
@NotNull private final List extends State> myStates;
private final boolean myUndo;
@@ -375,13 +376,13 @@ public abstract class MergeModelBase implements
*/
@NotNull
@RequiresEdt
- private TIntArrayList collectAffectedChanges(@NotNull TIntArrayList directChanges) {
- TIntArrayList result = new TIntArrayList(directChanges.size());
+ private IntList collectAffectedChanges(@NotNull IntList directChanges) {
+ IntList result = new IntArrayList(directChanges.size());
int directArrayIndex = 0;
int otherIndex = 0;
while (directArrayIndex < directChanges.size() && otherIndex < getChangesCount()) {
- int directIndex = directChanges.get(directArrayIndex);
+ int directIndex = directChanges.getInt(directArrayIndex);
if (directIndex == otherIndex) {
result.add(directIndex);
diff --git a/platform/diff-impl/src/com/intellij/diff/merge/TextMergeViewer.java b/platform/diff-impl/src/com/intellij/diff/merge/TextMergeViewer.java
index 56d53d471fb2..ec287539670d 100644
--- a/platform/diff-impl/src/com/intellij/diff/merge/TextMergeViewer.java
+++ b/platform/diff-impl/src/com/intellij/diff/merge/TextMergeViewer.java
@@ -1,4 +1,4 @@
-// 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.diff.merge;
import com.intellij.diff.DiffContext;
@@ -71,7 +71,8 @@ import com.intellij.util.concurrency.annotations.RequiresBackgroundThread;
import com.intellij.util.concurrency.annotations.RequiresEdt;
import com.intellij.util.concurrency.annotations.RequiresWriteLock;
import com.intellij.util.containers.ContainerUtil;
-import gnu.trove.TIntArrayList;
+import it.unimi.dsi.fastutil.ints.IntArrayList;
+import it.unimi.dsi.fastutil.ints.IntList;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -775,9 +776,9 @@ public class TextMergeViewer implements MergeTool.MergeViewer {
@NotNull Runnable task) {
myContentModified = true;
- TIntArrayList affectedIndexes = null;
+ IntList affectedIndexes = null;
if (affected != null) {
- affectedIndexes = new TIntArrayList(affected.size());
+ affectedIndexes = new IntArrayList(affected.size());
for (TextMergeChange change : affected) {
affectedIndexes.add(change.getIndex());
}
diff --git a/platform/diff-impl/src/com/intellij/diff/tools/util/text/LineOffsetsUtil.java b/platform/diff-impl/src/com/intellij/diff/tools/util/text/LineOffsetsUtil.java
index 8316369d40f4..87ae8ba519b7 100644
--- a/platform/diff-impl/src/com/intellij/diff/tools/util/text/LineOffsetsUtil.java
+++ b/platform/diff-impl/src/com/intellij/diff/tools/util/text/LineOffsetsUtil.java
@@ -1,10 +1,10 @@
-// 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.diff.tools.util.text;
import com.intellij.diff.util.DiffUtil;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.util.text.StringUtil;
-import gnu.trove.TIntArrayList;
+import it.unimi.dsi.fastutil.ints.IntArrayList;
import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
@@ -16,7 +16,7 @@ public final class LineOffsetsUtil {
@NotNull
public static LineOffsets create(@NotNull CharSequence text) {
- TIntArrayList ends = new TIntArrayList();
+ IntArrayList ends = new IntArrayList();
int index = 0;
while (true) {
@@ -31,7 +31,7 @@ public final class LineOffsetsUtil {
}
}
- return new LineOffsetsImpl(ends.toNativeArray(), text.length());
+ return new LineOffsetsImpl(ends.toIntArray(), text.length());
}
private static final class LineOffsetsImpl implements LineOffsets {
diff --git a/platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java b/platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java
index f6108cb21a05..2f8690f92623 100644
--- a/platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java
+++ b/platform/diff-impl/src/com/intellij/diff/util/DiffUtil.java
@@ -1,4 +1,4 @@
-// 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.diff.util;
import com.intellij.application.options.CodeStyle;
@@ -96,7 +96,6 @@ import com.intellij.util.ui.JBUI;
import com.intellij.util.ui.SingleComponentCenteringLayout;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.components.BorderLayoutPanel;
-import gnu.trove.Equality;
import icons.PlatformDiffImplIcons;
import org.jetbrains.annotations.*;
@@ -111,11 +110,9 @@ import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.List;
import java.util.*;
+import java.util.function.BiPredicate;
import java.util.function.IntUnaryOperator;
-import static com.intellij.diff.util.DiffUserDataKeysEx.EDITORS_TITLE_CUSTOMIZER;
-import static com.intellij.util.containers.ContainerUtil.notNullize;
-
public final class DiffUtil {
private static final Logger LOG = Logger.getInstance(DiffUtil.class);
@@ -526,7 +523,7 @@ public final class DiffUtil {
List<@Nls String> titles = request.getContentTitles();
List components = new ArrayList<>(titles.size());
- List diffTitleCustomizers = request.getUserData(EDITORS_TITLE_CUSTOMIZER);
+ List diffTitleCustomizers = request.getUserData(DiffUserDataKeysEx.EDITORS_TITLE_CUSTOMIZER);
for (int i = 0; i < contents.size(); i++) {
JComponent title = createTitle(titles.get(i),
diffTitleCustomizers != null ? diffTitleCustomizers.get(i) : null);
@@ -549,7 +546,7 @@ public final class DiffUtil {
List result = new ArrayList<>(contents.size());
- List diffTitleCustomizers = request.getUserData(EDITORS_TITLE_CUSTOMIZER);
+ List diffTitleCustomizers = request.getUserData(DiffUserDataKeysEx.EDITORS_TITLE_CUSTOMIZER);
for (int i = 0; i < contents.size(); i++) {
JComponent title = createTitle(titles.get(i),
contents.get(i),
@@ -1303,8 +1300,8 @@ public final class DiffUtil {
@NotNull
public static MergeConflictType getMergeType(@NotNull Condition super ThreeSide> emptiness,
- @NotNull Equality super ThreeSide> equality,
- @Nullable Equality super ThreeSide> trueEquality,
+ @NotNull BiPredicate super ThreeSide, ? super ThreeSide> equality,
+ @Nullable BiPredicate super ThreeSide, ? super ThreeSide> trueEquality,
@NotNull BooleanGetter conflictResolver) {
boolean isLeftEmpty = emptiness.value(ThreeSide.LEFT);
boolean isBaseEmpty = emptiness.value(ThreeSide.BASE);
@@ -1319,7 +1316,7 @@ public final class DiffUtil {
return new MergeConflictType(TextDiffType.INSERTED, true, false);
}
else { // =-=
- boolean equalModifications = equality.equals(ThreeSide.LEFT, ThreeSide.RIGHT);
+ boolean equalModifications = equality.test(ThreeSide.LEFT, ThreeSide.RIGHT);
if (equalModifications) {
return new MergeConflictType(TextDiffType.INSERTED, true, true);
}
@@ -1333,13 +1330,13 @@ public final class DiffUtil {
return new MergeConflictType(TextDiffType.DELETED, true, true);
}
else { // -==, ==-, ===
- boolean unchangedLeft = equality.equals(ThreeSide.BASE, ThreeSide.LEFT);
- boolean unchangedRight = equality.equals(ThreeSide.BASE, ThreeSide.RIGHT);
+ boolean unchangedLeft = equality.test(ThreeSide.BASE, ThreeSide.LEFT);
+ boolean unchangedRight = equality.test(ThreeSide.BASE, ThreeSide.RIGHT);
if (unchangedLeft && unchangedRight) {
assert trueEquality != null;
- boolean trueUnchangedLeft = trueEquality.equals(ThreeSide.BASE, ThreeSide.LEFT);
- boolean trueUnchangedRight = trueEquality.equals(ThreeSide.BASE, ThreeSide.RIGHT);
+ boolean trueUnchangedLeft = trueEquality.test(ThreeSide.BASE, ThreeSide.LEFT);
+ boolean trueUnchangedRight = trueEquality.test(ThreeSide.BASE, ThreeSide.RIGHT);
assert !trueUnchangedLeft || !trueUnchangedRight;
return new MergeConflictType(TextDiffType.MODIFIED, !trueUnchangedLeft, !trueUnchangedRight);
}
@@ -1347,7 +1344,7 @@ public final class DiffUtil {
if (unchangedLeft) return new MergeConflictType(isRightEmpty ? TextDiffType.DELETED : TextDiffType.MODIFIED, false, true);
if (unchangedRight) return new MergeConflictType(isLeftEmpty ? TextDiffType.DELETED : TextDiffType.MODIFIED, true, false);
- boolean equalModifications = equality.equals(ThreeSide.LEFT, ThreeSide.RIGHT);
+ boolean equalModifications = equality.test(ThreeSide.LEFT, ThreeSide.RIGHT);
if (equalModifications) {
return new MergeConflictType(TextDiffType.MODIFIED, true, true);
}
@@ -1465,7 +1462,7 @@ public final class DiffUtil {
@NotNull
private static MergeConflictType getLeftToRightDiffType(@NotNull Condition super ThreeSide> emptiness,
- @NotNull Equality super ThreeSide> equality) {
+ @NotNull BiPredicate super ThreeSide, ? super ThreeSide> equality) {
boolean isLeftEmpty = emptiness.value(ThreeSide.LEFT);
boolean isBaseEmpty = emptiness.value(ThreeSide.BASE);
boolean isRightEmpty = emptiness.value(ThreeSide.RIGHT);
@@ -1487,8 +1484,8 @@ public final class DiffUtil {
return new MergeConflictType(TextDiffType.MODIFIED, true, true);
}
else { // -==, ==-, ===
- boolean unchangedLeft = equality.equals(ThreeSide.BASE, ThreeSide.LEFT);
- boolean unchangedRight = equality.equals(ThreeSide.BASE, ThreeSide.RIGHT);
+ boolean unchangedLeft = equality.test(ThreeSide.BASE, ThreeSide.LEFT);
+ boolean unchangedRight = equality.test(ThreeSide.BASE, ThreeSide.RIGHT);
assert !unchangedLeft || !unchangedRight;
if (unchangedLeft) {
@@ -1728,8 +1725,8 @@ public final class DiffUtil {
@NotNull
private static List getNotificationProviders(@NotNull UserDataHolder holder) {
- List providers = notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATION_PROVIDERS));
- List components = notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATIONS));
+ List providers = ContainerUtil.notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATION_PROVIDERS));
+ List components = ContainerUtil.notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATIONS));
return ContainerUtil.concat(providers, ContainerUtil.map(components, component -> (viewer) -> component));
}
diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java
index 3b06147ceb60..7df1fb214b88 100644
--- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java
+++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java
@@ -1,5 +1,4 @@
-// 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.history.integration.ui.views;
import com.intellij.history.core.revisions.Revision;
@@ -27,7 +26,6 @@ import com.intellij.util.ui.JBInsets;
import com.intellij.util.ui.TextTransferable;
import com.intellij.util.ui.UIUtil;
import com.intellij.util.ui.accessibility.AccessibleContextUtil;
-import gnu.trove.THashMap;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
@@ -45,7 +43,7 @@ import java.awt.*;
import java.util.List;
import java.util.*;
-public class RevisionsList {
+public final class RevisionsList {
public static final int RECENT_PERIOD = 12;
private final JBTable table;
@@ -112,7 +110,7 @@ public class RevisionsList {
Date today = new Date();
- Map periods = new THashMap<>();
+ Map periods = new HashMap<>();
for (int i = 0; i < newRevs.size(); i++) {
RevisionItem each = newRevs.get(i);
boolean recent = today.getTime() - each.revision.getTimestamp() < 1000 * 60 * 60 * RECENT_PERIOD;
diff --git a/platform/platform-api/src/com/intellij/ide/browsers/chrome/ChromeSettings.java b/platform/platform-api/src/com/intellij/ide/browsers/chrome/ChromeSettings.java
index 8dca7c822b81..df9b22d99cfd 100644
--- a/platform/platform-api/src/com/intellij/ide/browsers/chrome/ChromeSettings.java
+++ b/platform/platform-api/src/com/intellij/ide/browsers/chrome/ChromeSettings.java
@@ -1,4 +1,4 @@
-// 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.ide.browsers.chrome;
import com.intellij.ide.browsers.BrowserSpecificSettings;
@@ -9,13 +9,11 @@ import com.intellij.util.execution.ParametersListUtil;
import com.intellij.util.xmlb.annotations.Tag;
import com.intellij.util.xmlb.annotations.XMap;
import gnu.trove.THashMap;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Objects;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import java.util.*;
+
public final class ChromeSettings extends BrowserSpecificSettings {
public static final String USER_DATA_DIR_ARG = "--user-data-dir=";
public static final String NO_FIRST_RUN_ARG = "--no-first-run";
@@ -24,7 +22,7 @@ public final class ChromeSettings extends BrowserSpecificSettings {
private @Nullable String myCommandLineOptions;
private @Nullable String myUserDataDirectoryPath;
private boolean myUseCustomProfile;
- private @NotNull Map myEnvironmentVariables = new THashMap<>();
+ private @NotNull Map myEnvironmentVariables = new HashMap<>();
public ChromeSettings() {
}
diff --git a/platform/platform-api/src/com/intellij/util/config/ExternalizablePropertyContainer.java b/platform/platform-api/src/com/intellij/util/config/ExternalizablePropertyContainer.java
index 1b5551a0a997..955e51801ec0 100644
--- a/platform/platform-api/src/com/intellij/util/config/ExternalizablePropertyContainer.java
+++ b/platform/platform-api/src/com/intellij/util/config/ExternalizablePropertyContainer.java
@@ -1,23 +1,23 @@
-// 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.util.config;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Comparing;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.util.SmartList;
-import gnu.trove.THashMap;
import org.jdom.Element;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
public final class ExternalizablePropertyContainer extends AbstractProperty.AbstractPropertyContainer {
private static final Logger LOG = Logger.getInstance(ExternalizablePropertyContainer.class);
- private final Map myValues = new THashMap<>();
- private final Map myExternalizers = new THashMap<>();
+ private final Map myValues = new HashMap<>();
+ private final Map myExternalizers = new HashMap<>();
public void registerProperty(AbstractProperty property, Externalizer externalizer) {
String name = property.getName();
@@ -39,7 +39,7 @@ public final class ExternalizablePropertyContainer extends AbstractProperty.Abst
}
public void readExternal(@NotNull Element element) {
- Map propertyByName = new THashMap<>();
+ Map propertyByName = new HashMap<>();
for (AbstractProperty abstractProperty : myExternalizers.keySet()) {
propertyByName.put(abstractProperty.getName(), abstractProperty);
}
diff --git a/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java b/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java
index 6d8a0bd890e8..1b876e940677 100644
--- a/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/psi/tree/IElementTypeTest.java
@@ -1,4 +1,4 @@
-// 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.intellij.psi.tree;
import com.intellij.lang.*;
@@ -11,7 +11,6 @@ import com.intellij.psi.PsiLanguageInjectionHost;
import com.intellij.psi.impl.source.tree.CompositeElement;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.testFramework.fixtures.BasePlatformTestCase;
-import gnu.trove.THashMap;
import gnu.trove.TObjectIntHashMap;
import java.util.*;
@@ -28,7 +27,7 @@ public class IElementTypeTest extends BasePlatformTestCase {
List extensions = Extensions.getRootArea().getExtensionPoint(LanguageParserDefinitions.INSTANCE.getName()).getExtensionList();
LOG.debug("ParserDefinitions: " + extensions.size());
- THashMap languageMap = new THashMap<>();
+ Map languageMap = new HashMap<>();
languageMap.put(Language.ANY, "platform");
final TObjectIntHashMap map = new TObjectIntHashMap<>();
for (LanguageExtensionPoint e : extensions) {
diff --git a/platform/platform-tests/testSrc/com/intellij/ui/SvgRenderer.kt b/platform/platform-tests/testSrc/com/intellij/ui/SvgRenderer.kt
index a38dfeaa0c5e..05e4c53ba584 100644
--- a/platform/platform-tests/testSrc/com/intellij/ui/SvgRenderer.kt
+++ b/platform/platform-tests/testSrc/com/intellij/ui/SvgRenderer.kt
@@ -1,4 +1,4 @@
-// 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.ui
import com.intellij.icons.AllIcons
@@ -9,7 +9,6 @@ import com.intellij.openapi.util.io.FileUtilRt
import com.intellij.openapi.util.text.StringUtilRt
import com.intellij.testFramework.assertions.Assertions.assertThat
import com.intellij.util.ui.LafIconLookup
-import gnu.trove.THashMap
import org.apache.batik.anim.dom.SVGDOMImplementation
import org.apache.batik.dom.GenericDOMImplementation
import org.apache.batik.svggen.*
@@ -87,7 +86,7 @@ internal class SvgRenderer(val svgFileDir: Path) {
}
context.idGenerator = object : SVGIDGenerator() {
- private val prefixMap = THashMap()
+ private val prefixMap = HashMap()
override fun generateID(prefix: String): String {
val info = prefixMap.getOrPut(prefix) { PrefixInfo() }
diff --git a/platform/platform-tests/testSrc/com/intellij/util/graph/CollectTest.java b/platform/platform-tests/testSrc/com/intellij/util/graph/CollectTest.java
index 4f3f12a9744d..1186083ba491 100644
--- a/platform/platform-tests/testSrc/com/intellij/util/graph/CollectTest.java
+++ b/platform/platform-tests/testSrc/com/intellij/util/graph/CollectTest.java
@@ -1,16 +1,12 @@
-// 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.intellij.util.graph;
import com.intellij.util.ArrayUtilRt;
-import gnu.trove.THashMap;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import org.junit.Test;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.util.*;
import static org.assertj.core.api.Assertions.assertThat;
@@ -18,7 +14,7 @@ public class CollectTest extends GraphTestCase {
@Test
public void testSimple() {
- Map graph = new THashMap<>();
+ Map graph = new HashMap<>();
graph.put("a", "b");
graph.put("b", "c");
graph.put("c", "c");
@@ -27,7 +23,7 @@ public class CollectTest extends GraphTestCase {
@Test
public void testFull() {
- Map graph = new THashMap<>();
+ Map graph = new HashMap<>();
graph.put("a", "bcd");
graph.put("b", "acd");
graph.put("c", "abd");
@@ -37,7 +33,7 @@ public class CollectTest extends GraphTestCase {
@Test
public void testVisitedNode() {
- Map graph = new THashMap<>();
+ Map graph = new HashMap<>();
graph.put("a", "bcd");
graph.put("b", "acd");
graph.put("c", "abd");
@@ -50,7 +46,7 @@ public class CollectTest extends GraphTestCase {
@Test
public void testBigGraph() {
- Map graph = new THashMap<>();
+ Map graph = new HashMap<>();
List answer = new ArrayList<>();
for (int i = 0; i < 10000; ++i) {
graph.put(String.valueOf((char)i), String.valueOf((char)(i + 1)));
diff --git a/platform/script-debugger/debugger-ui/intellij.platform.scriptDebugger.ui.iml b/platform/script-debugger/debugger-ui/intellij.platform.scriptDebugger.ui.iml
index 0117665cd258..7145da256e35 100644
--- a/platform/script-debugger/debugger-ui/intellij.platform.scriptDebugger.ui.iml
+++ b/platform/script-debugger/debugger-ui/intellij.platform.scriptDebugger.ui.iml
@@ -16,7 +16,6 @@
-
diff --git a/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt b/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt
index a2cde0d904a0..28e7e03f6ab6 100644
--- a/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt
+++ b/platform/script-debugger/debugger-ui/src/com/intellij/javascript/debugger/NameMapper.kt
@@ -1,4 +1,4 @@
-// Copyright 2000-2018 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.javascript.debugger
import com.google.common.base.CharMatcher
@@ -8,7 +8,6 @@ import com.intellij.openapi.vfs.VirtualFile
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiNamedElement
import com.intellij.psi.SyntaxTraverser
-import gnu.trove.THashMap
import org.jetbrains.debugger.sourcemap.MappingEntry
import org.jetbrains.debugger.sourcemap.Mappings
import org.jetbrains.debugger.sourcemap.MappingsProcessorInLine
@@ -123,7 +122,7 @@ open class NameMapper(private val document: Document, private val transpiledDocu
fun addMapping(generatedName: String, sourceName: String) {
if (rawNameToSource == null) {
- rawNameToSource = THashMap()
+ rawNameToSource = HashMap()
}
rawNameToSource!!.put(generatedName, sourceName)
}
@@ -149,7 +148,6 @@ open class NameMapper(private val document: Document, private val transpiledDocu
}
return document.immutableCharSequence.subSequence(lineStartOffset + sourceEntry.generatedColumn, endOffset)
}
-
}
fun warnSeveralMapping(element: PsiElement) {
diff --git a/platform/script-debugger/protocol/protocol-reader-runtime/intellij.platform.scriptDebugger.protocolReaderRuntime.iml b/platform/script-debugger/protocol/protocol-reader-runtime/intellij.platform.scriptDebugger.protocolReaderRuntime.iml
index 311540657200..11cd779e1f84 100644
--- a/platform/script-debugger/protocol/protocol-reader-runtime/intellij.platform.scriptDebugger.protocolReaderRuntime.iml
+++ b/platform/script-debugger/protocol/protocol-reader-runtime/intellij.platform.scriptDebugger.protocolReaderRuntime.iml
@@ -12,7 +12,6 @@
-
\ No newline at end of file
diff --git a/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/JsonReaders.java b/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/JsonReaders.java
index a68aac796f83..46ecffa58f6c 100644
--- a/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/JsonReaders.java
+++ b/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/JsonReaders.java
@@ -1,19 +1,16 @@
+// 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 org.jetbrains.jsonProtocol;
import com.google.gson.stream.JsonToken;
import com.intellij.util.ArrayUtilRt;
-import gnu.trove.TDoubleArrayList;
-import gnu.trove.THashMap;
-import gnu.trove.TIntArrayList;
-import gnu.trove.TLongArrayList;
+import it.unimi.dsi.fastutil.doubles.DoubleArrayList;
+import it.unimi.dsi.fastutil.ints.IntArrayList;
+import it.unimi.dsi.fastutil.longs.LongArrayList;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.io.JsonReaderEx;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
public final class JsonReaders {
public static final ObjectFactory STRING_OBJECT_FACTORY = new ObjectFactory<>() {
@@ -30,9 +27,9 @@ public final class JsonReaders {
return new MapFactory<>(valueFactory);
}
- private static void checkIsNull(JsonReaderEx reader, String fieldName) {
+ private static void checkIsNull(JsonReaderEx reader) {
if (reader.peek() == JsonToken.NULL) {
- throw new RuntimeException("Field is not nullable" + (fieldName == null ? "" : (": " + fieldName)));
+ throw new RuntimeException("Field is not nullable" + "");
}
}
@@ -124,7 +121,7 @@ public final class JsonReaders {
return Collections.emptyMap();
}
- Map map = new THashMap<>();
+ Map map = new HashMap<>();
while (reader.hasNext()) {
if (factory == null) {
//noinspection unchecked
@@ -165,7 +162,7 @@ public final class JsonReaders {
}
public static Map nextObject(JsonReaderEx reader) {
- Map map = new THashMap<>();
+ Map map = new HashMap<>();
while (reader.hasNext()) {
map.put(reader.nextName(), read(reader));
}
@@ -207,58 +204,58 @@ public final class JsonReaders {
}
public static long[] readLongArray(JsonReaderEx reader) {
- checkIsNull(reader, null);
+ checkIsNull(reader);
reader.beginArray();
if (!reader.hasNext()) {
reader.endArray();
return ArrayUtilRt.EMPTY_LONG_ARRAY;
}
- TLongArrayList result = new TLongArrayList();
+ LongArrayList result = new LongArrayList();
do {
result.add(reader.nextLong());
}
while (reader.hasNext());
reader.endArray();
- return result.toNativeArray();
+ return result.toLongArray();
}
public static double[] readDoubleArray(JsonReaderEx reader) {
- checkIsNull(reader, null);
+ checkIsNull(reader);
reader.beginArray();
if (!reader.hasNext()) {
reader.endArray();
return new double[]{0};
}
- TDoubleArrayList result = new TDoubleArrayList();
+ DoubleArrayList result = new DoubleArrayList();
do {
result.add(reader.nextDouble());
}
while (reader.hasNext());
reader.endArray();
- return result.toNativeArray();
+ return result.toDoubleArray();
}
public static int[] readIntArray(JsonReaderEx reader) {
- checkIsNull(reader, null);
+ checkIsNull(reader);
reader.beginArray();
if (!reader.hasNext()) {
reader.endArray();
return ArrayUtilRt.EMPTY_INT_ARRAY;
}
- TIntArrayList result = new TIntArrayList();
+ IntArrayList result = new IntArrayList();
do {
result.add(reader.nextInt());
}
while (reader.hasNext());
reader.endArray();
- return result.toNativeArray();
+ return result.toIntArray();
}
public static List readIntStringPairs(JsonReaderEx reader) {
- checkIsNull(reader, null);
+ checkIsNull(reader);
reader.beginArray();
if (!reader.hasNext()) {
reader.endArray();
diff --git a/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/OutMessage.kt b/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/OutMessage.kt
index 5d8fdc5405aa..e2e7875f3133 100644
--- a/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/OutMessage.kt
+++ b/platform/script-debugger/protocol/protocol-reader-runtime/src/org/jetbrains/jsonProtocol/OutMessage.kt
@@ -1,14 +1,14 @@
-// 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 org.jetbrains.jsonProtocol
import com.google.gson.stream.JsonWriter
import com.intellij.util.containers.isNullOrEmpty
import com.intellij.util.io.writeUtf8
-import gnu.trove.TIntArrayList
-import gnu.trove.TIntHashSet
import io.netty.buffer.ByteBuf
import io.netty.buffer.ByteBufAllocator
import io.netty.buffer.ByteBufUtf8Writer
+import it.unimi.dsi.fastutil.ints.IntList
+import it.unimi.dsi.fastutil.ints.IntSet
import org.jetbrains.io.JsonUtil
open class OutMessage {
@@ -70,23 +70,23 @@ open class OutMessage {
writer.endArray()
}
- fun writeIntSet(name: String, value: TIntHashSet) {
+ fun writeIntSet(name: String, value: IntSet) {
beginArguments()
writer.name(name)
writer.beginArray()
- value.forEach { value ->
- writer.value(value.toLong())
- true
+ val iterator = value.iterator()
+ while (iterator.hasNext()) {
+ writer.value(iterator.nextInt().toLong())
}
writer.endArray()
}
- fun writeIntList(name: String, value: TIntArrayList) {
+ fun writeIntList(name: String, value: IntList) {
beginArguments()
writer.name(name)
writer.beginArray()
- for (i in 0..value.size() - 1) {
- writer.value(value.getQuick(i).toLong())
+ for (i in 0 until value.size) {
+ writer.value(value.getInt(i).toLong())
}
writer.endArray()
}
diff --git a/platform/script-debugger/protocol/protocol-reader/intellij.javascript.protocolReader.iml b/platform/script-debugger/protocol/protocol-reader/intellij.javascript.protocolReader.iml
index 184972c2cdc0..f28360b611f7 100644
--- a/platform/script-debugger/protocol/protocol-reader/intellij.javascript.protocolReader.iml
+++ b/platform/script-debugger/protocol/protocol-reader/intellij.javascript.protocolReader.iml
@@ -7,7 +7,6 @@
-
diff --git a/platform/script-debugger/protocol/protocol-reader/src/FieldProcessor.kt b/platform/script-debugger/protocol/protocol-reader/src/FieldProcessor.kt
index 9bd7ee14cb4d..698d221445ab 100644
--- a/platform/script-debugger/protocol/protocol-reader/src/FieldProcessor.kt
+++ b/platform/script-debugger/protocol/protocol-reader/src/FieldProcessor.kt
@@ -1,7 +1,7 @@
+// 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 org.jetbrains.protocolReader
import com.intellij.openapi.util.text.StringUtil
-import gnu.trove.THashSet
import org.jetbrains.jsonProtocol.JsonField
import org.jetbrains.jsonProtocol.JsonSubtypeCasting
import org.jetbrains.jsonProtocol.Optional
@@ -35,12 +35,12 @@ internal class FieldProcessor(private val reader: InterfaceReader, typeClass: Cl
init {
val methods = typeClass.methods
// todo sort by source location
- Arrays.sort(methods, { o1, o2 -> o1.name.compareTo(o2.name) })
+ Arrays.sort(methods) { o1, o2 -> o1.name.compareTo(o2.name) }
- val skippedNames = THashSet()
+ val skippedNames = HashSet()
for (method in methods) {
- val annotation = method.getAnnotation(JsonField::class.java)
- if (annotation != null && !annotation.primitiveValue.isEmpty()) {
+ val annotation = method.getAnnotation(JsonField::class.java)
+ if (annotation != null && annotation.primitiveValue.isNotEmpty()) {
skippedNames.add(annotation.primitiveValue)
skippedNames.add("${annotation.primitiveValue}Type")
}
@@ -91,7 +91,7 @@ internal class FieldProcessor(private val reader: InterfaceReader, typeClass: Cl
}
private fun createMethodHandler(member: KCallable<*>, method: Method, skipRead: Boolean): MethodHandler? {
- var protocolName = member.annotation()?.name ?: member.name
+ val protocolName = member.annotation()?.name ?: member.name
val genericReturnType = member.returnType.javaType
val isNotNull: Boolean
val isPrimitive = if (genericReturnType is Class<*>) genericReturnType.isPrimitive else genericReturnType !is ParameterizedType
@@ -176,7 +176,7 @@ internal class FieldProcessor(private val reader: InterfaceReader, typeClass: Cl
fieldTypeInfo = {scope, out -> fieldTypeParser.appendInternalValueTypeName(scope, out)}
}
else {
- fieldTypeInfo = {scope, out -> fieldTypeParser.appendFinishedValueTypeName(out)}
+ fieldTypeInfo = { _, out -> fieldTypeParser.appendFinishedValueTypeName(out)}
}
val binding = VolatileFieldBinding(position, fieldTypeInfo)
volatileFields.add(binding)
diff --git a/platform/script-debugger/protocol/protocol-reader/src/GlobalScope.kt b/platform/script-debugger/protocol/protocol-reader/src/GlobalScope.kt
index 13ffceb36c93..be4fd806d013 100644
--- a/platform/script-debugger/protocol/protocol-reader/src/GlobalScope.kt
+++ b/platform/script-debugger/protocol/protocol-reader/src/GlobalScope.kt
@@ -1,9 +1,6 @@
+// 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 org.jetbrains.protocolReader
-import gnu.trove.THashMap
-import gnu.trove.THashSet
-import java.util.*
-
internal fun GlobalScope(typeWriters: Collection?>, basePackages: Collection