Commit ba97c90
authored
Fix DataReader.findNewLine with multiple lone EOL character (helidon-io#9362)
When there is multiple lone CR within a buffer, the virtual index is accumulated each time with the node 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
- Renamed indexWithinNode -> fromIndexNode
- Renamed crIndex -> crIndexNode
- Renamed lfIndex -> lfIndexNode
- Add unit tests1 parent 4e2d6de commit ba97c90
2 files changed
Lines changed: 48 additions & 26 deletions
File tree
- common/buffers/src
- main/java/io/helidon/common/buffers
- test/java/io/helidon/common/buffers
Lines changed: 18 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
398 | | - | |
399 | 398 | | |
400 | | - | |
| 399 | + | |
| 400 | + | |
401 | 401 | | |
402 | 402 | | |
403 | 403 | | |
404 | | - | |
405 | | - | |
| 404 | + | |
| 405 | + | |
406 | 406 | | |
407 | | - | |
408 | | - | |
409 | | - | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
410 | 410 | | |
411 | | - | |
| 411 | + | |
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 | + | |
434 | 425 | | |
435 | 426 | | |
436 | 427 | | |
437 | 428 | | |
438 | | - | |
| 429 | + | |
439 | 430 | | |
440 | | - | |
| 431 | + | |
441 | 432 | | |
442 | 433 | | |
443 | 434 | | |
444 | 435 | | |
445 | 436 | | |
446 | | - | |
447 | | - | |
| 437 | + | |
| 438 | + | |
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 | | |
460 | | - | |
| 453 | + | |
461 | 454 | | |
462 | 455 | | |
463 | 456 | | |
| |||
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