Commit a26d9df
committed
Prevent cross-scope source files from being parsed as PlainText
When processMainSources or processTestSources runs independently
(e.g. scoped listSourceFiles), resource parsing can walk the entire
project tree if a resource directory points at the project root.
Source files belonging to the other scope are not yet in alreadyParsed,
so they get claimed by PlainTextParser. The real parse in the other
scope then produces a duplicate entry, and the PlainText version
shadows the properly typed one — making annotations invisible to
recipes like FindAnnotations.
Fix: pre-populate alreadyParsed with the opposite scope's source file
paths before resource parsing begins. This mirrors what the non-scoped
listSourceFiles gets for free by processing both scopes with a shared
alreadyParsed set.1 parent b7b08c4 commit a26d9df
File tree
1 file changed
+22
-0
lines changed- src/main/java/org/openrewrite/maven
1 file changed
+22
-0
lines changedLines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
398 | 401 | | |
399 | 402 | | |
400 | 403 | | |
| |||
461 | 464 | | |
462 | 465 | | |
463 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
464 | 471 | | |
465 | 472 | | |
466 | 473 | | |
| |||
748 | 755 | | |
749 | 756 | | |
750 | 757 | | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
751 | 773 | | |
752 | 774 | | |
753 | 775 | | |
| |||
0 commit comments