Commit a9fd211
NIO: walkFiles consistently relative or absolute (#3773)
* walkFiles consistently relative or absolute
The expected behavior from Files.walkFileTree is that if the starting path is absolute, then all the visited paths are absolute. If the starting path is relative, then all the visited paths are relative.
This PR adds a test for this behavior, and shows that our current code
fails for an absolute path: it returns a mix of relative and absolute
paths.
This PR also adds a code change to fix the problem, so the actual
behavior matches what is expected.
This should fix issue #3772
* address issues found by linter
* rename PostTraversalWalker
* apply reviewer feedback1 parent ab77568 commit a9fd211
File tree
2 files changed
+84
-3
lines changed- java-storage-nio/google-cloud-nio/src
- main/java/com/google/cloud/storage/contrib/nio
- test/java/com/google/cloud/storage/contrib/nio/it
2 files changed
+84
-3
lines changedLines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
105 | 107 | | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
109 | | - | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| |||
123 | 127 | | |
124 | 128 | | |
125 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
126 | 133 | | |
127 | 134 | | |
128 | 135 | | |
| |||
769 | 776 | | |
770 | 777 | | |
771 | 778 | | |
772 | | - | |
| 779 | + | |
773 | 780 | | |
774 | 781 | | |
775 | 782 | | |
| |||
793 | 800 | | |
794 | 801 | | |
795 | 802 | | |
796 | | - | |
| 803 | + | |
797 | 804 | | |
798 | 805 | | |
799 | 806 | | |
| |||
Lines changed: 74 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
538 | 539 | | |
539 | 540 | | |
540 | 541 | | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
541 | 589 | | |
542 | 590 | | |
543 | 591 | | |
| |||
620 | 668 | | |
621 | 669 | | |
622 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
623 | 697 | | |
624 | 698 | | |
625 | 699 | | |
| |||
0 commit comments