Skip to content

Commit aa86c2b

Browse files
authored
Address length used to copy array in FacetsCollector to not be out of bounds (apache#13774)
This has caused a few recent test failures with jdk23 and jdk24. It should get fixed replacing the length with the lengt of the array, rather than using the new length.
1 parent ef577ea commit aa86c2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lucene/facet/src/java/org/apache/lucene/facet/FacetsCollector.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void collect(int doc) throws IOException {
8484
if (keepScores) {
8585
if (doc >= scores.length) {
8686
float[] newScores = new float[ArrayUtil.oversize(doc + 1, 4)];
87-
System.arraycopy(scores, 0, newScores, 0, doc);
87+
System.arraycopy(scores, 0, newScores, 0, scores.length);
8888
scores = newScores;
8989
}
9090
scores[doc] = scorer.score();

0 commit comments

Comments
 (0)