Repository navigation
[java] Reset CPD constructor detection for each file - #7138
Merged
Merged
Conversation
Contributor
|
Compared to main: (comment created at 2026-10-03 08:58:33+00:00 for ec0c7c3) |
turbospaces
added a commit
to codiqo/codiqo
that referenced
this pull request
Oct 5, 2026
…retry workaround pmd/pmd#7138 (merged for 7.29.0) makes JavaCpdLexer start a fresh ConstructorDetector for every file. Before it, the detector leaked state across files, and a large enough file set (micronaut-core, spring-framework) crashed CPD with an NPE that named no file. - pmd.version is 7.29.0-SNAPSHOT, resolved from the Central snapshots repository, which is added to both <repositories> and <pluginRepositories> (maven-pmd-plugin is pinned to ${pmd.version}). Both blocks are temporary and go once PMD 7.29.0 is released (milestone due 2026-10-30). - The CPD batch retry existed only for that crash and is removed together with CpdBatchRetryTest. CPD again runs once over every file of a language, so clones spanning what used to be two retry batches are no longer lost. Consumers need no change: codiqo itself is published to the same snapshots repository, which they already list as both a repository and a plugin repository. Co-Authored-By: Claude Opus 5.5 <[email protected]>
turbospaces
added a commit
to codiqo/codiqo
that referenced
this pull request
Oct 30, 2026
…stable releases PMD 7.29.0 carries pmd/pmd#7138, the CPD lexer fix the floating 7.29.0-SNAPSHOT was used for, so the temporary central-snapshots repository and plugin repository are removed with it. JaCoCo 0.8.16 adds official Java 27 support. It is also the agent version codiqo attaches to the builds it analyses. openai-java moves from 4.91.0 to 4.94.0, with no breaking changes listed. ClassGraph stays on 4.8.199, the latest 4.x: 6.0.1 is JDK 25 bytecode. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the PR
The constructor detector was kept around when CPD moved to another file so its old state could affect the next one. It now starts fresh for each file which fixes the crash with
--ignore-identifiers.Added tests for the three file case in the issue and a case where an identifier in a later file was being treated as a constructor. Both compare the reused lexer with a fresh lexer.
This touches the detector setup that #6215 also changes so that part may need adjusting if it lands first.
ran
./mvnw -B -ntp -pl pmd-java -am clean verifywith Java 21. 16,774 tests with 32 skipped and no failures or errors. Both new tests failed before the fix.Related issues
Ready?
pmd-javaand its dependencies./mvnw clean verifypasses (checked automatically by github actions)