mirror of https://github.com/apache/lucene.git
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:
parent
ef577ea43a
commit
aa86c2b8a0
|
@ -84,7 +84,7 @@ public class FacetsCollector extends SimpleCollector {
|
||||||
if (keepScores) {
|
if (keepScores) {
|
||||||
if (doc >= scores.length) {
|
if (doc >= scores.length) {
|
||||||
float[] newScores = new float[ArrayUtil.oversize(doc + 1, 4)];
|
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 = newScores;
|
||||||
}
|
}
|
||||||
scores[doc] = scorer.score();
|
scores[doc] = scorer.score();
|
||||||
|
|
Loading…
Reference in New Issue