Replace the trove4j collections usages with the fastutil ones

The trove4j library is licensed under LGPL, and that causes some troubles while working with it. The fastutil library provides the same functionality in the context of our needs, and is licensed under the Apache license.
^KTI-1135 In Progress
This commit is contained in:
Alexander.Likhachev
2023-12-06 12:48:36 +01:00
committed by Space Team
parent dd5fffebf2
commit 21b438f55d
27 changed files with 71 additions and 86 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ plugins {
dependencies {
api(project(":core:descriptors"))
compileOnly(intellijCore())
compileOnly(commonDependency("org.jetbrains.intellij.deps:trove4j"))
compileOnly(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil"))
}
sourceSets {
@@ -4,7 +4,7 @@
package org.jetbrains.kotlin.js.backend;
import gnu.trove.THashSet;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import java.util.Collections;
import java.util.Set;
@@ -142,7 +142,7 @@ public class JsReservedIdentifiers {
"$stack", "$stackDepth", "$location",
};
reservedGlobalSymbols = new THashSet<String>(commonBuiltins.length);
reservedGlobalSymbols = new ObjectOpenHashSet<>(commonBuiltins.length);
Collections.addAll(reservedGlobalSymbols, commonBuiltins);
}
@@ -4,6 +4,7 @@
package org.jetbrains.kotlin.js.backend;
import it.unimi.dsi.fastutil.objects.ObjectOpenHashSet;
import kotlin.text.StringsKt;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.js.backend.ast.*;
@@ -12,7 +13,6 @@ import org.jetbrains.kotlin.js.backend.ast.JsIntLiteral;
import org.jetbrains.kotlin.js.backend.ast.JsVars.JsVar;
import org.jetbrains.kotlin.js.common.IdentifierPolicyKt;
import org.jetbrains.kotlin.js.util.TextOutput;
import gnu.trove.THashSet;
import org.jetbrains.annotations.NotNull;
import java.util.*;
@@ -190,7 +190,7 @@ public class JsToStringGenerationVisitor extends JsVisitor {
* because the statements designated by statementEnds and statementStarts are
* those that appear directly within these global blocks.
*/
private Set<JsBlock> globalBlocks = new THashSet<JsBlock>();
private Set<JsBlock> globalBlocks = new ObjectOpenHashSet<>();
@NotNull
protected final TextOutput p;