Address length used to copy array in FacetsCollector to not be out of bounds (#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.
This commit is contained in:
Luca Cavanna 2024-09-12 13:08:44 +02:00 committed by GitHub
parent ef577ea43a
commit aa86c2b8a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ public class FacetsCollector extends SimpleCollector {
if (keepScores) {
if (doc >= scores.length) {
float[] newScores = new float[ArrayUtil.oversize(doc + 1, 4)];
System.arraycopy(scores, 0, newScores, 0, doc);
System.arraycopy(scores, 0, newScores, 0, scores.length);
scores = newScores;
}
scores[doc] = scorer.score();