Repository navigation
[java] Fix #6965: AbstractClassWithoutAnyMethod false positive on derived abstract class - #6972
Merged
UncleOwen merged 5 commits intoAug 15, 2026
Conversation
UncleOwen
reviewed
Aug 13, 2026
Contributor
|
Compared to main: (comment created at 2026-08-15 11:47:28+00:00 for ba43cf3) |
An empty abstract class that extends another type cannot be replaced with a private constructor when the parent already declares abstract methods. Skip those subclasses. Fixes pmd#6965
The two cases were the same ExtendsList skip. Keep the reporter sample. Fold not(ExtendsList) into the existing predicate so design.xml line numbers stay put.
AzazelSensei
force-pushed
the
fix/abstract-class-without-any-method-6965
branch
from
August 14, 2026 11:36
56b6b08 to
c5b2ef8
Compare
Contributor
Author
|
Rebased onto main. Only clash was the changelog — kept both entries. |
…-any-method-6965 # Conflicts: # docs/pages/release_notes.md
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
AbstractClassWithoutAnyMethodflags an empty abstract class even when it extends a type that already has abstract methods. That class has to stay abstract, so the usual "use a private constructor" advice does not apply.The XPath now skips classes with an
ExtendsList, same idea asAbstractClassWithoutAbstractMethod.Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)