Comparing v6.33.0...v6.34.0 · openrewrite/rewrite-maven-plugin (original) (raw)
Commits on Mar 18, 2026
- Prevent cross-scope source files from being parsed as PlainText
processMainSources and processTestSources each iterate resource
directories via getResources()/getTestResources(). When a resource
directory points at ${project.basedir}, OmniParser walks the entire
project tree. 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 type
information and annotations invisible to recipes.
Fix: before each scope's resource loop, pre-populate alreadyParsed
with the other scope's source file paths (Java, Kotlin, Groovy). - Centralize cross-scope source exclusion in listSourceFiles
Move the alreadyParsed pre-population from each scope method into
listSourceFiles(), eliminating coupling between processMainSources
and processTestSources. Both scopes' source paths are now computed
once upfront before either scope method runs. - Rename alreadyParsed to parsedPaths and remove redundant addAll calls
Rename the Setvariable/parameter from alreadyParsed to
parsedPaths since it is now pre-populated before parsing begins.
Remove the redundant addAll calls in processMainSources and
processTestSources that re-added paths already present from the
upfront pre-population. - Add integration test for basedir resource PlainText leak
Verify that source files in both main and test scopes are parsed as
Java (not PlainText) when resource directories point at project.basedir.
AutoFormat only operates on Java ASTs, so it will not modify files that
were incorrectly claimed by PlainTextParser.
Co-authored-by: Tim te Beek tim@moderne.io
Configuration menu
Browse the repository at this point in the history
2. Configuration menu
Browse the repository at this point in the history
3. Configuration menu
Browse the repository at this point in the history