Skip to content

Commit 2e85c54

Browse files
committed
Making totalResult incrementor long to prevent overflow
Change-Id: I400e7355de9e08195effbe8ed2e956ea9c8e250b
1 parent 3f0af8f commit 2e85c54

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Changes

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
0.64.5 2025-11-14
1+
0.64.5 2025-11-21
22
- [maintenance] Update to Java 21 (diewald)
33
- [enhancement] Alter vcNamePattern to allow system VC names with less
44
than 3 characters (margaretha)
5+
- [bugfix] Making totalResult counter long to prevent overflows (diewald)
56

67
0.64.4 2025-09-17
78
- [feature] Added --progress option to Krill-Indexer (kupietz)

src/main/java/de/ids_mannheim/korap/KrillIndex.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,8 +1423,8 @@ public Result search (Krill ks) {
14231423
};
14241424

14251425
// Some initializations ...
1426-
int i = 0; // matchcount
1427-
int j = 0; // matchdoccount
1426+
long i = 0; // matchcount
1427+
long j = 0; // matchdoccount
14281428
int startIndex = kr.getStartIndex();
14291429
int count = kr.getItemsPerPage();
14301430
int hits = kr.getItemsPerPage() + startIndex;
@@ -1686,8 +1686,8 @@ public Result search (Krill ks) {
16861686
if (itemsPerResource > 0)
16871687
kr.setItemsPerResource(itemsPerResource);
16881688

1689-
kr.setTotalResults(cutoff ? (long) -1 : (long) i);
1690-
kr.setTotalResources(cutoff ? (long) -1 : (long) j);
1689+
kr.setTotalResults(cutoff ? (long) -1 : i);
1690+
kr.setTotalResources(cutoff ? (long) -1 : j);
16911691
}
16921692

16931693
catch (IOException e) {

0 commit comments

Comments
 (0)