diff --git a/jps/jps-plugin/src/org/jetbrains/jps/builders/java/dependencyView/NullabilityAnnotationsTracker.kt b/jps/jps-plugin/src/org/jetbrains/jps/builders/java/dependencyView/NullabilityAnnotationsTracker.kt index 7e202b9b1fc..cca87b2b52a 100644 --- a/jps/jps-plugin/src/org/jetbrains/jps/builders/java/dependencyView/NullabilityAnnotationsTracker.kt +++ b/jps/jps-plugin/src/org/jetbrains/jps/builders/java/dependencyView/NullabilityAnnotationsTracker.kt @@ -16,7 +16,7 @@ package org.jetbrains.jps.builders.java.dependencyView -import gnu.trove.TIntHashSet +import it.unimi.dsi.fastutil.ints.IntOpenHashSet import org.jetbrains.jps.builders.java.dependencyView.TypeRepr.ClassType import org.jetbrains.kotlin.fileClasses.internalNameWithoutInnerClasses import org.jetbrains.kotlin.load.java.JAVAX_NONNULL_ANNOTATION @@ -41,7 +41,6 @@ internal class NullabilityAnnotationsTracker : AnnotationsChangeTracker() { return handleNullAnnotationsChanges(context, method, changedAnnotations) } - override fun fieldAnnotationsChanged( context: NamingContext, field: FieldRepr, @@ -55,7 +54,12 @@ internal class NullabilityAnnotationsTracker : AnnotationsChangeTracker() { protoMember: ProtoMember, annotations: Sequence ): Set { - val nullabilityAnnotations = TIntHashSet(this.annotations.toIntArray { context.get(it) }) + val n = this.annotations.size + val nullabilityAnnotations = IntOpenHashSet(n) + for (i in 0 until n) { + nullabilityAnnotations.add(context.get(this.annotations.get(i))) + } + val changedNullAnnotation = annotations.firstOrNull { nullabilityAnnotations.contains(it.className) } val result = EnumSet.noneOf(Recompile::class.java) @@ -74,6 +78,4 @@ internal class NullabilityAnnotationsTracker : AnnotationsChangeTracker() { private fun Difference.Specifier.addedOrRemoved(): Sequence = added().asSequence() + removed().asSequence() - private inline fun Array.toIntArray(fn: (T) -> Int): IntArray = - IntArray(size) { i -> fn(get(i)) } } \ No newline at end of file