Commit c9ddb37
committed
Fix DataReader.findNewLine with multiple lone EOL character
When there is multiple lone CR within a buffer, the virtual index is accumulated each time with the relative index.
The virtual index may be incorrectly seen as >= max, which ignores CRLN within max.
- Fix virtual index accumulation
- Re-use the branch that changes the buffer
- Add unit tests1 parent bf787bf commit c9ddb37
2 files changed
Lines changed: 35 additions & 13 deletions
File tree
- common/buffers/src
- main/java/io/helidon/common/buffers
- test/java/io/helidon/common/buffers
Lines changed: 5 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
412 | 412 | | |
413 | 413 | | |
414 | 414 | | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | 415 | | |
425 | 416 | | |
426 | 417 | | |
427 | 418 | | |
428 | 419 | | |
429 | 420 | | |
430 | | - | |
| 421 | + | |
431 | 422 | | |
432 | 423 | | |
433 | 424 | | |
| |||
437 | 428 | | |
438 | 429 | | |
439 | 430 | | |
440 | | - | |
| 431 | + | |
441 | 432 | | |
442 | 433 | | |
443 | 434 | | |
444 | 435 | | |
445 | 436 | | |
| 437 | + | |
446 | 438 | | |
447 | | - | |
448 | 439 | | |
449 | 440 | | |
450 | 441 | | |
451 | 442 | | |
452 | 443 | | |
453 | 444 | | |
454 | 445 | | |
| 446 | + | |
455 | 447 | | |
456 | 448 | | |
| 449 | + | |
457 | 450 | | |
458 | 451 | | |
459 | 452 | | |
| |||
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
44 | 73 | | |
0 commit comments