GitOrigin-RevId: a6e02daa32397b805eb1a1aa9c9855f092548eb6
This commit is contained in:
Vladimir Krivosheev
2021-01-22 20:58:21 +00:00
committed by intellij-monorepo-bot
parent 677b08f121
commit 99cc95ff68
50 changed files with 243 additions and 314 deletions
@@ -10,7 +10,6 @@
<orderEntry type="module" module-name="intellij.platform.util.rt" />
<orderEntry type="library" name="jetbrains-annotations-java5" level="project" />
<orderEntry type="library" name="Log4J" level="project" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="library" name="netty-codec-http" level="project" />
<orderEntry type="library" name="javax.annotation-api" level="project" />
<orderEntry type="library" name="jps-javac-extension" level="project" />
@@ -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<JavaFileObject> 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<File, File[]> myDirectoryCache = new THashMap<File, File[]>();
private final Map<File, FileOperations.Archive> myArchiveCache = new THashMap<File, FileOperations.Archive>();
private final TObjectByteHashMap<File> myIsFile = new TObjectByteHashMap<File>();
private final Map<File, File[]> myDirectoryCache = new HashMap<File, File[]>();
private final Map<File, FileOperations.Archive> myArchiveCache = new HashMap<File, FileOperations.Archive>();
private final Map<File, Boolean> myIsFile = new HashMap<File, Boolean>();
@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<String, Collection<ZipEntry>> myPaths = new THashMap<String, Collection<ZipEntry>>();
private final Map<String, Collection<ZipEntry>> myPaths = new HashMap<String, Collection<ZipEntry>>();
private final Function<ZipEntry, JavaFileObject> myToFileObjectConverter;
private static final FileObjectKindFilter<ZipEntry> ourEntryFilter = new FileObjectKindFilter<ZipEntry>(new Function<ZipEntry, String>() {
@Override
@@ -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<File, String> myMap = new THashMap<File, String>();
private final Map<File, String> myMap = new HashMap<File, String>();
private final Collection<File> myPath = new ArrayList<File>();
@Override
@@ -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<String, CompilerRef.CompilerClassHierarchyElementDef> myAnonymousName2Id = null;
private static final class AnonymousClassEnumerator {
private Map<String, CompilerRef.CompilerClassHierarchyElementDef> 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);
@@ -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<BuildTarget<?>, Collection<BuildTarget<?>>> 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
@@ -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<JpsModule, Set<String>> computeModuleCharsetMap() {
final Map<JpsModule, Set<String>> map = new THashMap<>();
final Map<JpsModule, Set<String>> map = new HashMap<>();
final Iterable<JavaBuilderExtension> builderExtensions = JpsServiceManager.getInstance().getExtensions(JavaBuilderExtension.class);
for (Map.Entry<String, String> entry : myUrlToCharset.entrySet()) {
final String fileUrl = entry.getKey();
@@ -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<ModuleBuildTarget, Collection<ClassItem>> remoteClasses = new THashMap<>();
final Map<ModuleBuildTarget, Collection<ClassItem>> remoteClasses = new HashMap<>();
for (ModuleBuildTarget target : chunk.getTargets()) {
for (CompiledClass compiledClass : outputConsumer.getTargetCompiledClasses(target)) {
try {
@@ -11,6 +11,5 @@
<orderEntry type="module" module-name="intellij.platform.testFramework" exported="" scope="TEST" />
<orderEntry type="library" scope="TEST" name="assertJ" level="project" />
<orderEntry type="module" module-name="intellij.platform.testExtensions" scope="TEST" />
<orderEntry type="library" name="Trove4j" level="project" />
</component>
</module>
@@ -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"
@@ -19,7 +19,7 @@
<orderEntry type="library" name="miglayout-swing" level="project" />
<orderEntry type="module" module-name="intellij.platform.statistics" />
<orderEntry type="module" module-name="intellij.platform.boot" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="library" name="fastutil-min" level="project" />
</component>
</module>
@@ -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) {
@@ -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<List<Line>, TIntArrayList> bigLines1 = getBigLines(lines1, threshold);
Pair<List<Line>, TIntArrayList> bigLines2 = getBigLines(lines2, threshold);
Pair<List<Line>, IntList> bigLines1 = getBigLines(lines1, threshold);
Pair<List<Line>, 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<List<Line>, TIntArrayList> getBigLines(@NotNull List<? extends Line> lines, int threshold) {
private static Pair<List<Line>, IntList> getBigLines(@NotNull List<? extends Line> lines, int threshold) {
List<Line> 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);
@@ -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);
}
}
@@ -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<S extends MergeModelBase.State> implements Disposable {
private static final Logger LOG = Logger.getInstance(MergeModelBase.class);
@@ -32,10 +35,10 @@ public abstract class MergeModelBase<S extends MergeModelBase.State> 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<S extends MergeModelBase.State> 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<S extends MergeModelBase.State> 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<S extends MergeModelBase.State> 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<S extends MergeModelBase.State> implements
});
}
private void registerUndoRedo(boolean undo, @Nullable TIntArrayList affectedChanges) {
private void registerUndoRedo(boolean undo, @Nullable IntList affectedChanges) {
if (myUndoManager == null) return;
List<S> 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<S extends MergeModelBase.State> 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<MergeModelBase> myModelRef;
@NotNull private final List<? extends State> myStates;
private final boolean myUndo;
@@ -375,13 +376,13 @@ public abstract class MergeModelBase<S extends MergeModelBase.State> 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);
@@ -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());
}
@@ -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 {
@@ -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<JComponent> components = new ArrayList<>(titles.size());
List<DiffEditorTitleCustomizer> diffTitleCustomizers = request.getUserData(EDITORS_TITLE_CUSTOMIZER);
List<DiffEditorTitleCustomizer> 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<JComponent> result = new ArrayList<>(contents.size());
List<DiffEditorTitleCustomizer> diffTitleCustomizers = request.getUserData(EDITORS_TITLE_CUSTOMIZER);
List<DiffEditorTitleCustomizer> 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<DiffNotificationProvider> getNotificationProviders(@NotNull UserDataHolder holder) {
List<DiffNotificationProvider> providers = notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATION_PROVIDERS));
List<JComponent> components = notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATIONS));
List<DiffNotificationProvider> providers = ContainerUtil.notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATION_PROVIDERS));
List<JComponent> components = ContainerUtil.notNullize(holder.getUserData(DiffUserDataKeys.NOTIFICATIONS));
return ContainerUtil.concat(providers, ContainerUtil.map(components, component -> (viewer) -> component));
}
@@ -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<RevisionItem, Period> periods = new THashMap<>();
Map<RevisionItem, Period> 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;
@@ -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<String, String> myEnvironmentVariables = new THashMap<>();
private @NotNull Map<String, String> myEnvironmentVariables = new HashMap<>();
public ChromeSettings() {
}
@@ -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<AbstractProperty, Object> myValues = new THashMap<>();
private final Map<AbstractProperty, Externalizer> myExternalizers = new THashMap<>();
private final Map<AbstractProperty, Object> myValues = new HashMap<>();
private final Map<AbstractProperty, Externalizer> myExternalizers = new HashMap<>();
public <T> void registerProperty(AbstractProperty<T> property, Externalizer<T> externalizer) {
String name = property.getName();
@@ -39,7 +39,7 @@ public final class ExternalizablePropertyContainer extends AbstractProperty.Abst
}
public void readExternal(@NotNull Element element) {
Map<String, AbstractProperty> propertyByName = new THashMap<>();
Map<String, AbstractProperty> propertyByName = new HashMap<>();
for (AbstractProperty abstractProperty : myExternalizers.keySet()) {
propertyByName.put(abstractProperty.getName(), abstractProperty);
}
@@ -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<LanguageExtensionPoint> extensions = Extensions.getRootArea().<LanguageExtensionPoint>getExtensionPoint(LanguageParserDefinitions.INSTANCE.getName()).getExtensionList();
LOG.debug("ParserDefinitions: " + extensions.size());
THashMap<Language, String> languageMap = new THashMap<>();
Map<Language, String> languageMap = new HashMap<>();
languageMap.put(Language.ANY, "platform");
final TObjectIntHashMap<String> map = new TObjectIntHashMap<>();
for (LanguageExtensionPoint e : extensions) {
@@ -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<String, PrefixInfo>()
private val prefixMap = HashMap<String, PrefixInfo>()
override fun generateID(prefix: String): String {
val info = prefixMap.getOrPut(prefix) { PrefixInfo() }
@@ -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<String, String> graph = new THashMap<>();
Map<String, String> 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<String, String> graph = new THashMap<>();
Map<String, String> 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<String, String> graph = new THashMap<>();
Map<String, String> 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<String, String> graph = new THashMap<>();
Map<String, String> graph = new HashMap<>();
List<String> answer = new ArrayList<>();
for (int i = 0; i < 10000; ++i) {
graph.put(String.valueOf((char)i), String.valueOf((char)(i + 1)));
@@ -16,7 +16,6 @@
<orderEntry type="module" module-name="intellij.platform.execution.impl" exported="" />
<orderEntry type="library" name="netty-codec-http" level="project" />
<orderEntry type="module" module-name="intellij.platform.debugger.testFramework" scope="TEST" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="library" name="fastutil-min" level="project" />
<orderEntry type="library" name="netty-buffer" level="project" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
@@ -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<String, String>()
rawNameToSource = HashMap<String, String>()
}
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) {
@@ -12,7 +12,6 @@
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
<orderEntry type="library" name="netty-codec-http" level="project" />
<orderEntry type="library" name="fastutil-min" level="project" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="library" name="netty-buffer" level="project" />
</component>
</module>
@@ -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> 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<String, T> map = new THashMap<>();
Map<String, T> map = new HashMap<>();
while (reader.hasNext()) {
if (factory == null) {
//noinspection unchecked
@@ -165,7 +162,7 @@ public final class JsonReaders {
}
public static Map<String, Object> nextObject(JsonReaderEx reader) {
Map<String, Object> map = new THashMap<>();
Map<String, Object> 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<StringIntPair> readIntStringPairs(JsonReaderEx reader) {
checkIsNull(reader, null);
checkIsNull(reader);
reader.beginArray();
if (!reader.hasNext()) {
reader.endArray();
@@ -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()
}
@@ -7,7 +7,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="library" name="gson" level="project" />
<orderEntry type="module" module-name="intellij.platform.scriptDebugger.protocolReaderRuntime" exported="" />
<orderEntry type="module" module-name="intellij.platform.ide.impl" />
@@ -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<String>()
val skippedNames = HashSet<String>()
for (method in methods) {
val annotation = method.getAnnotation<JsonField>(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<ProtocolName>()?.name ?: member.name
val protocolName = member.annotation<ProtocolName>()?.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)
@@ -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<TypeWriter<*>?>, basePackages: Collection<Map<Class<*>, String>>) = GlobalScope(State(typeWriters, basePackages))
internal open class GlobalScope(val state: State) {
@@ -19,15 +16,14 @@ internal open class GlobalScope(val state: State) {
}
internal class State(typeWriters: Collection<TypeWriter<*>?>, private val basePackages: Collection<Map<Class<*>, String>>) {
private var typeToName: Map<TypeWriter<*>, String>
private val typesWithFactories = THashSet<TypeWriter<*>>()
val typesWithFactoriesList = ArrayList<TypeWriter<*>>();
private var typeToName: Map<TypeWriter<*>?, String>
private val typesWithFactories = HashSet<TypeWriter<*>>()
val typesWithFactoriesList = ArrayList<TypeWriter<*>>()
init {
var uniqueCode = 0
val result = THashMap<TypeWriter<*>, String>(typeWriters.size)
for (handler in typeWriters) {
val conflict = result.put(handler, "M${Integer.toString(uniqueCode++, Character.MAX_RADIX)}")
val result = HashMap<TypeWriter<*>?, String>(typeWriters.size)
for ((uniqueCode, handler) in typeWriters.withIndex()) {
val conflict = result.put(handler, "M${uniqueCode.toString(Character.MAX_RADIX)}")
if (conflict != null) {
throw RuntimeException()
}
@@ -1,6 +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.THashSet
import org.jetbrains.io.JsonReaderEx
import org.jetbrains.jsonProtocol.JsonField
import org.jetbrains.jsonProtocol.JsonSubtype
@@ -10,7 +10,6 @@ import java.lang.reflect.Method
import java.lang.reflect.ParameterizedType
import java.lang.reflect.Type
import java.lang.reflect.WildcardType
import java.util.*
import kotlin.reflect.KCallable
internal fun InterfaceReader(protocolInterfaces: List<Class<*>>): InterfaceReader {
@@ -64,7 +63,7 @@ internal fun createHandler(typeToTypeHandler: LinkedHashMap<Class<*>, TypeWriter
}
internal class InterfaceReader(val typeToTypeHandler: LinkedHashMap<Class<*>, TypeWriter<*>?>) {
val processed = THashSet<Class<*>>()
val processed = HashSet<Class<*>>()
private val refs = ArrayList<TypeRef<*>>()
val subtypeCasters = ArrayList<SubtypeCaster>()
@@ -1,11 +1,10 @@
// 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 java.nio.file.Paths
import java.util.*
class GenerateConfiguration<ROOT>(val packageName: String, val className: String, readerRootClass: Class<ROOT>, protocolInterfaces: List<Class<*>>, basePackagesMap: Map<Class<*>, String>? = null) {
val basePackagesMap: List<Map<Class<*>, String>> = if (basePackagesMap == null) listOf<Map<Class<*>, String>>() else listOf(basePackagesMap)
val basePackagesMap: List<Map<Class<*>, String>> = if (basePackagesMap == null) listOf() else listOf(basePackagesMap)
internal val typeToTypeHandler = InterfaceReader(protocolInterfaces).go()
internal val root = ReaderRoot(readerRootClass, typeToTypeHandler)
@@ -63,7 +62,7 @@ private class StringParam {
fun buildParserMap(configuration: GenerateConfiguration<*>): Map<Class<*>, String> {
val fileScope = generate(configuration, StringBuilder())
val typeToImplClassName = THashMap<Class<*>, String>()
val typeToImplClassName = HashMap<Class<*>, String>()
for (typeWriter in configuration.typeToTypeHandler.values) {
typeToImplClassName.put(typeWriter!!.typeClass, "${configuration.packageName}.${configuration.className}.${fileScope.getTypeImplShortName(typeWriter)}")
}
@@ -1,6 +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.THashSet
import org.jetbrains.io.JsonReaderEx
import org.jetbrains.jsonProtocol.JsonParseMethod
import java.lang.reflect.Method
@@ -8,8 +8,8 @@ import java.lang.reflect.ParameterizedType
import java.util.*
internal class ReaderRoot<R>(val type: Class<R>, private val typeToTypeHandler: LinkedHashMap<Class<*>, TypeWriter<*>?>) {
private val visitedInterfaces = THashSet<Class<*>>(1)
val methodMap = LinkedHashMap<Method, ReadDelegate>()
private val visitedInterfaces = HashSet<Class<*>>(1)
private val methodMap = LinkedHashMap<Method, ReadDelegate>()
init {
readInterfaceRecursive(type)
@@ -20,7 +20,6 @@
<orderEntry type="module" module-name="intellij.platform.lang" />
<orderEntry type="module" module-name="intellij.java.rt" />
<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" />
</component>
</module>
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-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.execution.testframework.sm;
import com.intellij.execution.impl.ConsoleBuffer;
@@ -25,7 +11,6 @@ import com.intellij.openapi.util.text.StringUtil;
import com.intellij.testFramework.LightPlatformTestCase;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.util.containers.ContainerUtil;
import gnu.trove.THashMap;
import jetbrains.buildServer.messages.serviceMessages.ServiceMessage;
import org.hamcrest.core.IsCollectionContaining;
import org.jetbrains.annotations.NotNull;
@@ -52,7 +37,7 @@ public class OutputEventSplitterTest extends LightPlatformTestCase {
);
private OutputEventSplitter mySplitter;
private final Map<ProcessOutputType, Console> myOutput = new THashMap<>();
private final Map<ProcessOutputType, Console> myOutput = new HashMap<>();
@Override
protected void setUp() throws Exception {
@@ -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.testFramework;
import com.intellij.AbstractBundle;
@@ -29,7 +29,6 @@ import com.intellij.util.ArrayUtilRt;
import com.intellij.util.DocumentUtil;
import com.intellij.util.ThreeState;
import com.intellij.util.containers.ContainerUtil;
import gnu.trove.THashMap;
import gnu.trove.THashSet;
import gnu.trove.TObjectHashingStrategy;
import org.intellij.lang.annotations.JdkConstants;
@@ -88,7 +87,7 @@ public class ExpectedHighlightingData {
}
private final Map<String, ExpectedHighlightingSet> myHighlightingTypes = new LinkedHashMap<>();
private final Map<RangeMarker, LineMarkerInfo<?>> myLineMarkerInfos = new THashMap<>();
private final Map<RangeMarker, LineMarkerInfo<?>> myLineMarkerInfos = new HashMap<>();
private final Document myDocument;
private final String myText;
private boolean myIgnoreExtraHighlighting;
@@ -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.util;
import com.intellij.openapi.util.Comparing;
@@ -49,7 +49,7 @@ public final class SmartFMap<K,V> implements Map<K,V> {
}
}
if (array.length == 2 * ARRAY_THRESHOLD) {
Map<Object,Object> map = new THashMap<>();
Map<Object,Object> map = new HashMap<>();
for (int i = 0; i < array.length; i += 2) {
map.put(array[i], array[i + 1]);
}
@@ -65,7 +65,7 @@ public final class SmartFMap<K,V> implements Map<K,V> {
public SmartFMap<K, V> minus(@NotNull K key) {
if (myMap instanceof Map) {
Map<K, V> newMap = new THashMap<>(asMap());
Map<K, V> newMap = new HashMap<>(asMap());
newMap.remove(key);
if (newMap.size() <= ARRAY_THRESHOLD) {
Object[] newArray = new Object[newMap.size() * 2];
@@ -1,8 +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 com.intellij.util.io;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.util.ExceptionUtil;
import com.intellij.util.ExceptionUtilRt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -59,7 +59,8 @@ final class FileChannelUtil {
}
}
catch (Throwable e) {
ExceptionUtil.rethrow(e);
ExceptionUtilRt.rethrowUnchecked(e);
throw new RuntimeException(e);
}
return channel;
}
@@ -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.util.io;
import org.jetbrains.annotations.ApiStatus;
@@ -12,7 +12,7 @@ import java.nio.file.StandardOpenOption;
import java.util.*;
@ApiStatus.Internal
class OpenChannelsCache { // TODO: Will it make sense to have a background thread, that flushes the cache by timeout?
final class OpenChannelsCache { // TODO: Will it make sense to have a background thread, that flushes the cache by timeout?
private final int myCacheSizeLimit;
@NotNull
private final Set<StandardOpenOption> myOpenOptions;
@@ -88,7 +88,7 @@ class OpenChannelsCache { // TODO: Will it make sense to have a background threa
}
}
private static class ChannelDescriptor {
private static final class ChannelDescriptor {
private int lockCount = 0;
private final FileChannel myChannel;
@@ -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.openapi.vcs.changes.ui
import com.intellij.openapi.actionSystem.DataKey
@@ -8,7 +8,6 @@ import com.intellij.openapi.util.KeyedExtensionFactory
import com.intellij.openapi.vcs.changes.ui.ChangesGroupingSupport.Companion.DIRECTORY_GROUPING
import com.intellij.openapi.vcs.changes.ui.ChangesGroupingSupport.Companion.MODULE_GROUPING
import com.intellij.openapi.vcs.changes.ui.ChangesGroupingSupport.Companion.REPOSITORY_GROUPING
import gnu.trove.THashMap
import org.jetbrains.annotations.NonNls
import java.beans.PropertyChangeListener
import java.beans.PropertyChangeSupport
@@ -24,7 +23,7 @@ open class ChangesGroupingSupport(val project: Project, source: Any, val showCon
get() = groupingConfig.filterValues { it }.keys
init {
groupingConfig = THashMap()
groupingConfig = HashMap()
for (epBean in ChangesGroupingPolicyFactory.EP_NAME.extensionList) {
if (epBean.key != null) {
groupingConfig.put(epBean.key, false)
@@ -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.openapi.vcs.checkin
import com.intellij.codeInsight.CodeSmellInfo
@@ -23,7 +23,6 @@ import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.VirtualFileManager
import com.intellij.psi.impl.PsiDocumentManagerImpl
import com.intellij.util.containers.MultiMap
import gnu.trove.THashMap
internal object CodeAnalysisBeforeCheckinShowOnlyNew {
val LOG = logger<CodeAnalysisBeforeCheckinShowOnlyNew>()
@@ -34,7 +33,7 @@ internal object CodeAnalysisBeforeCheckinShowOnlyNew {
val codeSmellDetector = CodeSmellDetector.getInstance(project)
val newCodeSmells = codeSmellDetector.findCodeSmells(selectedFiles)
val location2CodeSmell = MultiMap<Pair<VirtualFile, Int>, CodeSmellInfo>()
val fileToChanges: MutableMap<VirtualFile, List<Range>> = THashMap()
val fileToChanges: MutableMap<VirtualFile, List<Range>> = HashMap()
val changeListManager = ChangeListManager.getInstance(project)
val changes4Update = changeListManager.allChanges
val fileDocumentManager = FileDocumentManager.getInstance()
@@ -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.openapi.vcs.update;
import com.intellij.configurationStore.StoreReloadManager;
@@ -39,7 +39,6 @@ import com.intellij.util.containers.MultiMap;
import com.intellij.util.ui.OptionsDialog;
import com.intellij.vcs.ViewUpdateInfoNotification;
import com.intellij.vcsUtil.VcsUtil;
import gnu.trove.THashMap;
import org.jetbrains.annotations.*;
import java.io.File;
@@ -180,7 +179,7 @@ public abstract class AbstractCommonUpdateAction extends AbstractVcsAction imple
}
}
final Map<AbstractVcs, Collection<FilePath>> result = new THashMap<>();
final Map<AbstractVcs, Collection<FilePath>> result = new HashMap<>();
for (Map.Entry<AbstractVcs, Collection<FilePath>> entry : resultPrep.entrySet()) {
AbstractVcs vcs = entry.getKey();
result.put(vcs, vcs.filterUniqueRoots(new ArrayList<>(entry.getValue()), FilePath::getVirtualFile));
@@ -12,7 +12,6 @@
<orderEntry type="module" module-name="intellij.platform.debugger" />
<orderEntry type="module" module-name="intellij.platform.testExtensions" />
<orderEntry type="library" name="StreamEx" level="project" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
</component>
</module>
@@ -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.plugins.gradle.config;
import com.intellij.ProjectTopics;
@@ -26,7 +26,6 @@ import com.intellij.util.Function;
import com.intellij.util.JdomKt;
import com.intellij.util.containers.FactoryMap;
import com.intellij.util.xmlb.XmlSerializer;
import gnu.trove.THashMap;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -97,7 +96,7 @@ public class GradleResourceCompilerConfigurationGenerator {
boolean configurationUpdateRequired = context.isRebuild() || !gradleConfigFile.exists();
final Map<String, Integer> affectedConfigurationHash = new THashMap<>();
final Map<String, Integer> affectedConfigurationHash = new HashMap<>();
for (Map.Entry<String, GradleModuleResourceConfiguration> entry : affectedGradleModuleConfigurations.entrySet()) {
Integer moduleLastConfigurationHash = myModulesConfigurationHash.get(entry.getKey());
int moduleCurrentConfigurationHash = entry.getValue().computeConfigurationHash();
@@ -153,7 +152,7 @@ public class GradleResourceCompilerConfigurationGenerator {
}
private @NotNull Map<String, GradleModuleResourceConfiguration> generateAffectedGradleModulesConfiguration(@NotNull CompileContext context) {
final Map<String, GradleModuleResourceConfiguration> affectedGradleModuleConfigurations = new THashMap<>();
final Map<String, GradleModuleResourceConfiguration> affectedGradleModuleConfigurations = new HashMap<>();
final Map<String, ExternalProject> lazyExternalProjectMap = FactoryMap.create(
gradleProjectPath1 -> externalProjectDataCache.getRootExternalProject(gradleProjectPath1));
@@ -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.plugins.gradle.importing;
import com.intellij.ide.highlighter.ModuleFileType;
@@ -23,7 +23,6 @@ import com.intellij.openapi.roots.TestModuleProperties;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.containers.ContainerUtil;
import gnu.trove.THashMap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.gradle.model.ExternalProject;
import org.jetbrains.plugins.gradle.service.project.GradleProjectResolverUtil;
@@ -343,7 +342,7 @@ public class GradleMiscImportingTest extends GradleJavaImportingTestCase {
@NotNull
private Map<String, ExternalProject> getExternalProjectsMap() {
ExternalProject rootExternalProject = ExternalProjectDataCache.getInstance(myProject).getRootExternalProject(getProjectPath());
final Map<String, ExternalProject> externalProjectMap = new THashMap<>();
final Map<String, ExternalProject> externalProjectMap = new HashMap<>();
if (rootExternalProject == null) return externalProjectMap;
ArrayDeque<ExternalProject> queue = new ArrayDeque<>();
queue.add(rootExternalProject);
+1 -1
View File
@@ -26,7 +26,7 @@
<orderEntry type="module" module-name="intellij.platform.externalSystem" />
<orderEntry type="module" module-name="intellij.jvm.analysis" />
<orderEntry type="module" module-name="intellij.platform.core.ui" />
<orderEntry type="library" name="Trove4j" level="project" />
<orderEntry type="library" name="fastutil-min" level="project" />
</component>
<component name="copyright">
<Base>
@@ -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.execution.junit2.configuration;
@@ -44,7 +44,7 @@ import com.intellij.ui.components.fields.ExpandableTextField;
import com.intellij.util.ArrayUtilRt;
import com.intellij.util.indexing.DumbModeAccessType;
import com.intellij.util.ui.UIUtil;
import gnu.trove.TIntArrayList;
import it.unimi.dsi.fastutil.ints.IntArrayList;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
@@ -61,16 +61,16 @@ import java.util.Objects;
import java.util.function.Supplier;
public class JUnitConfigurable<T extends JUnitConfiguration> extends SettingsEditor<T> implements PanelWithAnchor {
private static final List<TIntArrayList> ourEnabledFields = Arrays.asList(
new TIntArrayList(new int[]{0}),
new TIntArrayList(new int[]{1}),
new TIntArrayList(new int[]{1, 2}),
new TIntArrayList(new int[]{3}),
new TIntArrayList(new int[]{4}),
new TIntArrayList(new int[]{5}),
new TIntArrayList(new int[]{1, 2}),
new TIntArrayList(new int[]{6}),
new TIntArrayList(new int[]{1, 2})
private static final List<IntArrayList> ourEnabledFields = Arrays.asList(
new IntArrayList(new int[]{0}),
new IntArrayList(new int[]{1}),
new IntArrayList(new int[]{1, 2}),
new IntArrayList(new int[]{3}),
new IntArrayList(new int[]{4}),
new IntArrayList(new int[]{5}),
new IntArrayList(new int[]{1, 2}),
new IntArrayList(new int[]{6}),
new IntArrayList(new int[]{1, 2})
);
private static final String[] FORK_MODE_ALL =
{JUnitConfiguration.FORK_NONE, JUnitConfiguration.FORK_METHOD, JUnitConfiguration.FORK_KLASS};
@@ -528,7 +528,7 @@ public class JUnitConfigurable<T extends JUnitConfiguration> extends SettingsEdi
public void onTypeChanged(final int newType) {
myTypeChooser.setSelectedItem(newType);
final TIntArrayList enabledFields = ourEnabledFields.size() > newType ? ourEnabledFields.get(newType) : null;
final IntArrayList enabledFields = ourEnabledFields.size() > newType ? ourEnabledFields.get(newType) : null;
for (int i = 0; i < myTestLocations.length; i++)
getTestLocation(i).setEnabled(enabledFields != null && enabledFields.contains(i));
/*if (newType == JUnitConfigurationModel.PATTERN) {
@@ -17,8 +17,6 @@ import com.jetbrains.python.psi.impl.PyFileImpl;
import com.jetbrains.python.psi.impl.PythonLanguageLevelPusher;
import com.jetbrains.python.psi.types.TypeEvalContext;
import com.jetbrains.python.sdk.PythonSdkUtil;
import gnu.trove.Equality;
import gnu.trove.THashSet;
import junit.framework.TestCase;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
@@ -26,6 +24,7 @@ import org.jetbrains.annotations.Nullable;
import org.junit.Assert;
import java.util.*;
import java.util.function.BiPredicate;
import java.util.function.Consumer;
public abstract class PythonCommonTestCase extends TestCase {
@@ -171,8 +170,8 @@ public abstract class PythonCommonTestCase extends TestCase {
final StringBuilder builder = new StringBuilder();
for (final Object o : collection) {
if (o instanceof THashSet) {
builder.append(new TreeSet<>((THashSet<?>)o));
if (o instanceof Set) {
builder.append(new TreeSet<>((Set<?>)o));
}
else {
builder.append(o);
@@ -184,12 +183,13 @@ public abstract class PythonCommonTestCase extends TestCase {
private static <T> boolean equals(@NotNull Iterable<? extends T> a1,
@NotNull Iterable<? extends T> a2,
@NotNull Equality<? super T> comparator) {
@NotNull BiPredicate<? super T, ? super T> comparator) {
Iterator<? extends T> it1 = a1.iterator();
Iterator<? extends T> it2 = a2.iterator();
while (it1.hasNext() || it2.hasNext()) {
if (!it1.hasNext() || !it2.hasNext()) return false;
if (!comparator.equals(it1.next(), it2.next())) return false;
if (!it1.hasNext() || !it2.hasNext() || !comparator.test(it1.next(), it2.next())) {
return false;
}
}
return true;
}
@@ -243,14 +243,13 @@ public abstract class PythonCommonTestCase extends TestCase {
public static <T> void assertOrderedEquals(@NotNull String errorMsg,
@NotNull Iterable<? extends T> actual,
@NotNull Iterable<? extends T> expected) {
//noinspection unchecked
assertOrderedEquals(errorMsg, actual, expected, Equality.CANONICAL);
assertOrderedEquals(errorMsg, actual, expected, (t, t2) -> Objects.equals(t, t2));
}
public static <T> void assertOrderedEquals(@NotNull String errorMsg,
@NotNull Iterable<? extends T> actual,
@NotNull Iterable<? extends T> expected,
@NotNull Equality<? super T> comparator) {
@NotNull BiPredicate<? super T, ? super T> comparator) {
if (!equals(actual, expected, comparator)) {
String expectedString = toString(expected);
String actualString = toString(actual);
@@ -18,6 +18,5 @@
<orderEntry type="library" scope="TEST" name="Guava" level="project" />
<orderEntry type="library" scope="TEST" name="StreamEx" level="project" />
<orderEntry type="module" module-name="intellij.platform.analysis.impl" scope="TEST" />
<orderEntry type="library" name="Trove4j" level="project" />
</component>
</module>