diff --git a/build.sbt b/build.sbt index f5108d6b..55e0e808 100644 --- a/build.sbt +++ b/build.sbt @@ -76,6 +76,10 @@ lazy val `elastiknn-lucene` = project "org.apache.lucene" % "lucene-core" % LuceneVersion, "org.apache.lucene" % "lucene-analysis-common" % LuceneVersion % Test ), + javacOptions ++= Seq( + "--add-exports", + "java.base/jdk.internal.vm.annotation=ALL-UNNAMED" + ), TestSettings ) diff --git a/elastiknn-lucene/src/main/java/com/klibisz/elastiknn/search/ArrayHitCounter.java b/elastiknn-lucene/src/main/java/com/klibisz/elastiknn/search/ArrayHitCounter.java index a2b5b081..d5aafeed 100644 --- a/elastiknn-lucene/src/main/java/com/klibisz/elastiknn/search/ArrayHitCounter.java +++ b/elastiknn-lucene/src/main/java/com/klibisz/elastiknn/search/ArrayHitCounter.java @@ -1,5 +1,6 @@ package com.klibisz.elastiknn.search; +import jdk.internal.vm.annotation.ForceInline; import org.apache.lucene.search.DocIdSetIterator; import java.util.Arrays; @@ -30,6 +31,7 @@ public ArrayHitCounter(int numDocs) { this(numDocs, 10); } + @ForceInline private void incrementKeyByCount(int docId, short count) { int newCount = (docIdToCount[docId] += count); if (newCount > maxCount) maxCount = newCount;