PMD: remove redundant 'implements' (UnnecessaryInterfaceDeclaration)#7640
Open
Vest wants to merge 1 commit into
Open
PMD: remove redundant 'implements' (UnnecessaryInterfaceDeclaration)#7640Vest wants to merge 1 commit into
Vest wants to merge 1 commit into
Conversation
PMD's UnnecessaryInterfaceDeclaration rule flagged 22 sites where a class/interface declared an 'implements' that a supertype already provided. Removed those declarations, plus 3 more that surfaced after the parent classes (CDOMObject, AbstractCategory) stopped being shadowed by their subclasses. Touches markers (Cloneable, Comparable, Serializable, VarScoped, VarContainer, Loadable, ObjectContainer, Category, ReferenceFacade, DataView, ReferenceListener, TreeTableModel, CDOMToken, etc.) — all guaranteed by the supertype chain. Compile + all four test source sets verified clean. pmdMain count: 110 -> 75.
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.
What
Removes redundant
implementsclauses across 29 files incode/src/java, flagged by PMD'sUnnecessaryInterfaceDeclarationrule. Each removed interface is already provided by a supertype in the inheritance chain.Why
PMD's
pmdMaintask reports these as violations. The declarations are pure noise — they don't change semantics (the marker / contract is still inherited) and they obscure which interfaces the class actually adds.Scope
CDOMObject,AbstractCategoryno longer shadowed by subclass declarations)Removed markers include:
Cloneable,Comparable<Object>,Serializable,VarScoped,VarContainer,Loadable,ObjectContainer<T>,Category<T>,ReferenceFacade<T>,DataView<T>,ReferenceListener<T>,TreeTableModel,CDOMToken<T>,PCGenScoped,ReferenceManufacturer<T>— all guaranteed by the supertype.Verification
./gradlew compileJava compileTestJava compileItestJava compileSlowtestJava— all green./gradlew pmdMain—UnnecessaryInterfaceDeclarationcount: 22 → 0; overall PMD count: 110 → 75Notes
Cloneableis a marker interface, so the explicit declaration on a concrete class was a (mild) self-documenting hint. Removing it is correct per the rule and the supertype keeps the marker.VariableDeclarationUsageDistance,PublicMemberInNonPublicType,OverridingThreadRun,AvoidUsingVolatile) are untouched.code/gradle/reporting.gradlestill haspmd { ignoreFailures = true }, so CI gating is unchanged; this PR just reduces the noise floor.