Details
-
Improvement
-
Status: Resolved
-
Trivial
-
Resolution: Fixed
-
4.0, 5.0, 6.0, 7.0, 8.0
-
New
Description
QuadPrefixTree in Lucene prepopulates these arrays:
levelW = new double[maxLevels];
levelH = new double[maxLevels];
levelS = new int[maxLevels];
levelN = new int[maxLevels];
Like this
for (int i = 1; i < levelW.length; i++) {
{{ levelW[i] = levelW[i - 1] / 2.0;}}
{{ levelH[i] = levelH[i - 1] / 2.0;}}
{{ levelS[i] = levelS[i - 1] * 2;}}
{{ levelN[i] = levelN[i - 1] * 4;}}
}
The field
levelN[]
overflows after level 14 = 1073741824 where maxLevels is limited to
MAX_LEVELS_POSSIBLE = 50;
The field levelN appears not to be used anywhere. Likewise, the field
{{levelS[] }}
is only used in the
printInfo
method. I would propose either to remove both
levelN[],levelS[]
or to change the datatype
levelN = new long[maxLevels];