@@ -108,7 +108,7 @@ assert startsWith(MINVALUE)
108
108
assert startsWith (PATTERN );
109
109
field .pattern = stripPrefix (PATTERN );
110
110
field .dataStartFilePointer = data .getFilePointer ();
111
- data .seek (data .getFilePointer () + (1 + field .pattern .length () + 2 ) * maxDoc );
111
+ data .seek (data .getFilePointer () + (1 + field .pattern .length () + 2 ) * ( long ) maxDoc );
112
112
} else if (dvType == DocValuesType .BINARY ) {
113
113
readLine ();
114
114
assert startsWith (MAXLENGTH );
@@ -118,7 +118,8 @@ assert startsWith(MINVALUE)
118
118
field .pattern = stripPrefix (PATTERN );
119
119
field .dataStartFilePointer = data .getFilePointer ();
120
120
data .seek (
121
- data .getFilePointer () + (9 + field .pattern .length () + field .maxLength + 2 ) * maxDoc );
121
+ data .getFilePointer ()
122
+ + (9 + field .pattern .length () + field .maxLength + 2 ) * (long ) maxDoc );
122
123
} else if (dvType == DocValuesType .SORTED || dvType == DocValuesType .SORTED_SET ) {
123
124
readLine ();
124
125
assert startsWith (NUMVALUES );
@@ -136,7 +137,7 @@ assert startsWith(MINVALUE)
136
137
data .seek (
137
138
data .getFilePointer ()
138
139
+ (9 + field .pattern .length () + field .maxLength ) * field .numValues
139
- + (1 + field .ordPattern .length ()) * maxDoc );
140
+ + (1 + field .ordPattern .length ()) * ( long ) maxDoc );
140
141
} else {
141
142
throw new AssertionError ();
142
143
}
@@ -214,7 +215,7 @@ public Long apply(int docID) {
214
215
throw new IndexOutOfBoundsException (
215
216
"docID must be 0 .. " + (maxDoc - 1 ) + "; got " + docID );
216
217
}
217
- in .seek (field .dataStartFilePointer + (1 + field .pattern .length () + 2 ) * docID );
218
+ in .seek (field .dataStartFilePointer + (1 + field .pattern .length () + 2 ) * ( long ) docID );
218
219
SimpleTextUtil .readLine (in , scratch );
219
220
// System.out.println("parsing delta: " + scratch.utf8ToString());
220
221
BigDecimal bd ;
@@ -262,7 +263,7 @@ public long cost() {
262
263
@ Override
263
264
public int advance (int target ) throws IOException {
264
265
for (int i = target ; i < maxDoc ; ++i ) {
265
- in .seek (field .dataStartFilePointer + (1 + field .pattern .length () + 2 ) * i );
266
+ in .seek (field .dataStartFilePointer + (1 + field .pattern .length () + 2 ) * ( long ) i );
266
267
SimpleTextUtil .readLine (in , scratch ); // data
267
268
SimpleTextUtil .readLine (in , scratch ); // 'T' or 'F'
268
269
if (scratch .byteAt (0 ) == (byte ) 'T' ) {
@@ -275,7 +276,7 @@ public int advance(int target) throws IOException {
275
276
@ Override
276
277
boolean advanceExact (int target ) throws IOException {
277
278
this .doc = target ;
278
- in .seek (field .dataStartFilePointer + (1 + field .pattern .length () + 2 ) * target );
279
+ in .seek (field .dataStartFilePointer + (1 + field .pattern .length () + 2 ) * ( long ) target );
279
280
SimpleTextUtil .readLine (in , scratch ); // data
280
281
SimpleTextUtil .readLine (in , scratch ); // 'T' or 'F'
281
282
return scratch .byteAt (0 ) == (byte ) 'T' ;
@@ -311,7 +312,7 @@ public BytesRef apply(int docID) {
311
312
}
312
313
in .seek (
313
314
field .dataStartFilePointer
314
- + (9 + field .pattern .length () + field .maxLength + 2 ) * docID );
315
+ + (9 + field .pattern .length () + field .maxLength + 2 ) * ( long ) docID );
315
316
SimpleTextUtil .readLine (in , scratch );
316
317
assert StringHelper .startsWith (scratch .get (), LENGTH );
317
318
int len ;
@@ -401,7 +402,8 @@ public long cost() {
401
402
public int advance (int target ) throws IOException {
402
403
for (int i = target ; i < maxDoc ; ++i ) {
403
404
in .seek (
404
- field .dataStartFilePointer + (9 + field .pattern .length () + field .maxLength + 2 ) * i );
405
+ field .dataStartFilePointer
406
+ + (9 + field .pattern .length () + field .maxLength + 2 ) * (long ) i );
405
407
SimpleTextUtil .readLine (in , scratch );
406
408
assert StringHelper .startsWith (scratch .get (), LENGTH );
407
409
int len ;
@@ -435,7 +437,7 @@ boolean advanceExact(int target) throws IOException {
435
437
this .doc = target ;
436
438
in .seek (
437
439
field .dataStartFilePointer
438
- + (9 + field .pattern .length () + field .maxLength + 2 ) * target );
440
+ + (9 + field .pattern .length () + field .maxLength + 2 ) * ( long ) target );
439
441
SimpleTextUtil .readLine (in , scratch );
440
442
assert StringHelper .startsWith (scratch .get (), LENGTH );
441
443
int len ;
@@ -504,7 +506,7 @@ public int advance(int target) throws IOException {
504
506
in .seek (
505
507
field .dataStartFilePointer
506
508
+ field .numValues * (9 + field .pattern .length () + field .maxLength )
507
- + i * (1 + field .ordPattern .length ()));
509
+ + i * (long ) ( 1 + field .ordPattern .length ()));
508
510
SimpleTextUtil .readLine (in , scratch );
509
511
try {
510
512
ord = (int ) ordDecoder .parse (scratch .get ().utf8ToString ()).longValue () - 1 ;
@@ -524,7 +526,7 @@ public boolean advanceExact(int target) throws IOException {
524
526
in .seek (
525
527
field .dataStartFilePointer
526
528
+ field .numValues * (9 + field .pattern .length () + field .maxLength )
527
- + target * (1 + field .ordPattern .length ()));
529
+ + target * (long ) ( 1 + field .ordPattern .length ()));
528
530
SimpleTextUtil .readLine (in , scratch );
529
531
try {
530
532
ord = (int ) ordDecoder .parse (scratch .get ().utf8ToString ()).longValue () - 1 ;
@@ -547,7 +549,9 @@ public BytesRef lookupOrd(int ord) throws IOException {
547
549
throw new IndexOutOfBoundsException (
548
550
"ord must be 0 .. " + (field .numValues - 1 ) + "; got " + ord );
549
551
}
550
- in .seek (field .dataStartFilePointer + ord * (9 + field .pattern .length () + field .maxLength ));
552
+ in .seek (
553
+ field .dataStartFilePointer
554
+ + ord * (long ) (9 + field .pattern .length () + field .maxLength ));
551
555
SimpleTextUtil .readLine (in , scratch );
552
556
assert StringHelper .startsWith (scratch .get (), LENGTH )
553
557
: "got " + scratch .get ().utf8ToString () + " in=" + in ;
@@ -688,8 +692,8 @@ public int advance(int target) throws IOException {
688
692
for (int i = target ; i < maxDoc ; ++i ) {
689
693
in .seek (
690
694
field .dataStartFilePointer
691
- + field .numValues * (9 + field .pattern .length () + field .maxLength )
692
- + i * (1 + field .ordPattern .length ()));
695
+ + field .numValues * (long ) ( 9 + field .pattern .length () + field .maxLength )
696
+ + i * (long ) ( 1 + field .ordPattern .length ()));
693
697
SimpleTextUtil .readLine (in , scratch );
694
698
String ordList = scratch .get ().utf8ToString ().trim ();
695
699
if (ordList .isEmpty () == false ) {
@@ -705,8 +709,8 @@ public int advance(int target) throws IOException {
705
709
public boolean advanceExact (int target ) throws IOException {
706
710
in .seek (
707
711
field .dataStartFilePointer
708
- + field .numValues * (9 + field .pattern .length () + field .maxLength )
709
- + target * (1 + field .ordPattern .length ()));
712
+ + field .numValues * (long ) ( 9 + field .pattern .length () + field .maxLength )
713
+ + target * (long ) ( 1 + field .ordPattern .length ()));
710
714
SimpleTextUtil .readLine (in , scratch );
711
715
String ordList = scratch .get ().utf8ToString ().trim ();
712
716
doc = target ;
0 commit comments