Dominic Page created LUCENE-8758: ------------------------------------ Summary: Class Field levelN is not populated correctly in QuadPrefixTree Key: LUCENE-8758 URL: https://issues.apache.org/jira/browse/LUCENE-8758 Project: Lucene - Core Issue Type: Improvement Components: modules/spatial-extras Affects Versions: 8.0, 7.0, 6.0, 5.0, 4.0 Reporter: Dominic Page Fix For: 8.x
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];}} -- This message was sent by Atlassian JIRA (v7.6.3#76005) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org