Skip to content

Commit 4213083

Browse files
committed
Remove redundant interface declarations in pmd-java
Related to pmd#4885
1 parent f1701df commit 4213083

34 files changed

+34
-66
lines changed

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTAnnotation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* </pre>
2323
*/
24-
public final class ASTAnnotation extends AbstractJavaTypeNode implements TypeNode, ASTMemberValue, Iterable<ASTMemberValuePair> {
24+
public final class ASTAnnotation extends AbstractJavaTypeNode implements ASTMemberValue, Iterable<ASTMemberValuePair> {
2525

2626
ASTAnnotation(int id) {
2727
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayDimExpr.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*
1818
* </pre>
1919
*/
20-
public final class ASTArrayDimExpr extends ASTArrayTypeDim implements Annotatable {
20+
public final class ASTArrayDimExpr extends ASTArrayTypeDim {
2121

2222
ASTArrayDimExpr(int id) {
2323
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTArrayInitializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
* </pre>
2323
*
2424
*/
25-
public final class ASTArrayInitializer extends AbstractJavaExpr implements ASTExpression, Iterable<ASTExpression> {
25+
public final class ASTArrayInitializer extends AbstractJavaExpr implements Iterable<ASTExpression> {
2626

2727
ASTArrayInitializer(int id) {
2828
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBlock.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import net.sourceforge.pmd.lang.ast.impl.javacc.JavaccToken;
88
import net.sourceforge.pmd.lang.java.ast.ASTList.ASTMaybeEmptyListOf;
9-
import net.sourceforge.pmd.lang.java.ast.InternalInterfaces.AllChildrenAreOfType;
109

1110
/**
1211
* A block of code. This is a {@linkplain ASTStatement statement} that
@@ -19,7 +18,7 @@
1918
* </pre>
2019
*/
2120
public final class ASTBlock extends ASTMaybeEmptyListOf<ASTStatement>
22-
implements ASTSwitchArrowRHS, ASTStatement, AllChildrenAreOfType<ASTStatement> {
21+
implements ASTSwitchArrowRHS, ASTStatement {
2322

2423
ASTBlock(int id) {
2524
super(id, ASTStatement.class);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTBooleanLiteral.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* The boolean literal, either "true" or "false".
1111
*/
12-
public final class ASTBooleanLiteral extends AbstractLiteral implements ASTLiteral {
12+
public final class ASTBooleanLiteral extends AbstractLiteral {
1313

1414
private boolean isTrue;
1515

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCastExpression.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* </pre>
1616
*/
17-
public final class ASTCastExpression extends AbstractJavaExpr implements ASTExpression {
17+
public final class ASTCastExpression extends AbstractJavaExpr {
1818

1919
ASTCastExpression(int id) {
2020
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCharLiteral.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* retrieve the actual runtime value. Use {@link #getLiteralText()} to
1616
* retrieve the text.
1717
*/
18-
public final class ASTCharLiteral extends AbstractLiteral implements ASTLiteral {
18+
public final class ASTCharLiteral extends AbstractLiteral {
1919

2020

2121
ASTCharLiteral(int id) {

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTCompilationUnit.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import net.sourceforge.pmd.lang.ast.AstInfo;
1414
import net.sourceforge.pmd.lang.ast.NodeStream;
1515
import net.sourceforge.pmd.lang.ast.RootNode;
16-
import net.sourceforge.pmd.lang.ast.impl.GenericNode;
1716
import net.sourceforge.pmd.lang.java.symbols.table.JSymbolTable;
1817
import net.sourceforge.pmd.lang.java.types.TypeSystem;
1918
import net.sourceforge.pmd.lang.java.types.ast.internal.LazyTypeResolver;
@@ -49,7 +48,7 @@
4948
* @see <a href="https://openjdk.org/jeps/445">JEP 445: Unnamed Classes and Instance Main Methods (Preview)</a> (Java 21)
5049
* @see #isUnnamedClass()
5150
*/
52-
public final class ASTCompilationUnit extends AbstractJavaNode implements JavaNode, GenericNode<JavaNode>, RootNode {
51+
public final class ASTCompilationUnit extends AbstractJavaNode implements RootNode {
5352

5453
private LazyTypeResolver lazyTypeResolver;
5554
private List<JavaComment> comments;

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTConstructorCall.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@
2222
*
2323
* </pre>
2424
*/
25-
public final class ASTConstructorCall extends AbstractInvocationExpr
26-
implements ASTPrimaryExpression,
27-
QualifiableExpression,
28-
LeftRecursiveNode,
29-
InvocationNode {
25+
public final class ASTConstructorCall extends AbstractInvocationExpr implements QualifiableExpression, LeftRecursiveNode {
3026

3127
ASTConstructorCall(int id) {
3228
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTEnumConstant.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
* </pre>
2020
*/
2121
public final class ASTEnumConstant extends AbstractJavaTypeNode
22-
implements Annotatable,
23-
InvocationNode,
24-
ModifierOwner,
22+
implements InvocationNode,
23+
ModifierOwner,
2524
ASTBodyDeclaration,
2625
InternalInterfaces.VariableIdOwner,
2726
JavadocCommentOwner {

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExecutableDeclaration.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.checkerframework.checker.nullness.qual.NonNull;
88
import org.checkerframework.checker.nullness.qual.Nullable;
99

10-
import net.sourceforge.pmd.lang.ast.impl.GenericNode;
1110
import net.sourceforge.pmd.lang.java.symbols.JExecutableSymbol;
1211
import net.sourceforge.pmd.lang.java.types.JClassType;
1312
import net.sourceforge.pmd.lang.java.types.JMethodSig;
@@ -32,7 +31,6 @@ public interface ASTExecutableDeclaration
3231
extends ModifierOwner,
3332
ASTBodyDeclaration,
3433
TypeParamOwnerNode,
35-
GenericNode<JavaNode>,
3634
JavadocCommentOwner {
3735

3836

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTExpression.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@
3939
*
4040
* </pre>
4141
*/
42-
public interface ASTExpression
43-
extends JavaNode,
44-
TypeNode,
45-
ASTMemberValue,
46-
ASTSwitchArrowRHS {
42+
public interface ASTExpression extends TypeNode, ASTMemberValue, ASTSwitchArrowRHS {
4743

4844
/**
4945
* Always returns true. This is to allow XPath queries

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFieldDeclaration.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
* </pre>
2323
*/
2424
public final class ASTFieldDeclaration extends AbstractJavaNode
25-
implements Iterable<ASTVariableId>,
26-
LeftRecursiveNode,
27-
ModifierOwner,
25+
implements LeftRecursiveNode,
2826
ASTBodyDeclaration,
2927
InternalInterfaces.MultiVariableIdOwner,
3028
JavadocCommentOwner {

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTFormalParameter.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
* </pre>
2626
*/
2727
public final class ASTFormalParameter extends AbstractJavaNode
28-
implements ModifierOwner,
29-
TypeNode,
30-
Annotatable,
31-
VariableIdOwner {
28+
implements ModifierOwner, TypeNode, VariableIdOwner {
3229

3330
ASTFormalParameter(int id) {
3431
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTLocalVariableDeclaration.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@
2525
*/
2626
// TODO extend AbstractStatement
2727
public final class ASTLocalVariableDeclaration extends AbstractJavaNode
28-
implements Iterable<ASTVariableId>,
29-
ASTStatement,
30-
ModifierOwner,
28+
implements ASTStatement,
3129
LeftRecursiveNode, // ModifierList is parsed separately in BlockStatement
3230
InternalInterfaces.MultiVariableIdOwner {
3331

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodCall.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919
*
2020
* </pre>
2121
*/
22-
public final class ASTMethodCall extends AbstractInvocationExpr
23-
implements ASTPrimaryExpression,
24-
QualifiableExpression,
25-
InvocationNode,
26-
MethodUsage {
22+
public final class ASTMethodCall extends AbstractInvocationExpr implements QualifiableExpression {
2723

2824
ASTMethodCall(int id) {
2925
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTMethodReference.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
* </pre>
2424
*/
2525
public final class ASTMethodReference extends AbstractJavaExpr
26-
implements ASTPrimaryExpression,
27-
QualifiableExpression,
26+
implements QualifiableExpression,
2827
LeftRecursiveNode,
2928
MethodUsage,
3029
FunctionalExpression {

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNullLiteral.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* </pre>
1717
*/
18-
public final class ASTNullLiteral extends AbstractLiteral implements ASTLiteral {
18+
public final class ASTNullLiteral extends AbstractLiteral {
1919
ASTNullLiteral(int id) {
2020
super(id);
2121
}

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTNumericLiteral.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* A numeric literal of any type (double, int, long, float, etc).
1616
*/
17-
public final class ASTNumericLiteral extends AbstractLiteral implements ASTLiteral {
17+
public final class ASTNumericLiteral extends AbstractLiteral {
1818

1919
/**
2020
* True if this is an integral literal, ie int OR long,

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTRecordComponentList.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
package net.sourceforge.pmd.lang.java.ast;
77

88
import net.sourceforge.pmd.lang.java.ast.ASTList.ASTMaybeEmptyListOf;
9-
import net.sourceforge.pmd.lang.java.ast.InternalInterfaces.AllChildrenAreOfType;
109
import net.sourceforge.pmd.lang.java.symbols.JConstructorSymbol;
1110

1211
/**
@@ -18,8 +17,7 @@
1817
*
1918
* </pre>
2019
*/
21-
public final class ASTRecordComponentList extends ASTMaybeEmptyListOf<ASTRecordComponent>
22-
implements SymbolDeclaratorNode, AllChildrenAreOfType<ASTRecordComponent> {
20+
public final class ASTRecordComponentList extends ASTMaybeEmptyListOf<ASTRecordComponent> implements SymbolDeclaratorNode {
2321

2422
private JConstructorSymbol symbol;
2523

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTStringLiteral.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* in the source ({@link #getLiteralText()}). {@link #getConstValue()} allows to recover
1919
* the actual runtime value, by processing escapes.
2020
*/
21-
public final class ASTStringLiteral extends AbstractLiteral implements ASTLiteral {
21+
public final class ASTStringLiteral extends AbstractLiteral {
2222

2323
private static final String TEXTBLOCK_DELIMITER = "\"\"\"";
2424

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTSwitchExpression.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@
1818
*
1919
* <p>Their syntax is identical though, and described on {@link ASTSwitchLike}.
2020
*/
21-
public final class ASTSwitchExpression extends AbstractJavaExpr
22-
implements ASTExpression,
23-
ASTSwitchLike {
21+
public final class ASTSwitchExpression extends AbstractJavaExpr implements ASTSwitchLike {
2422

2523
ASTSwitchExpression(int id) {
2624
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/ASTVariableId.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
* <p>Note: This node has been called ASTVariableDeclaratorId in PMD 6.
4444
*/
4545
// @formatter:on
46-
public final class ASTVariableId extends AbstractTypedSymbolDeclarator<JVariableSymbol> implements ModifierOwner, SymbolDeclaratorNode {
46+
public final class ASTVariableId extends AbstractTypedSymbolDeclarator<JVariableSymbol> implements ModifierOwner {
4747

4848
private String name;
4949
private List<ASTNamedReferenceExpr> usages = Collections.emptyList();

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/AbstractTypeBodyDeclaration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @author Clément Fournier
99
* @since 6.2.0
1010
*/
11-
abstract class AbstractTypeBodyDeclaration extends AbstractJavaNode implements JavaNode {
11+
abstract class AbstractTypeBodyDeclaration extends AbstractJavaNode {
1212

1313
AbstractTypeBodyDeclaration(int id) {
1414
super(id);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/ast/InternalInterfaces.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ interface VariableIdOwner extends JavaNode {
134134
ASTVariableId getVarId();
135135
}
136136

137-
interface MultiVariableIdOwner extends JavaNode, Iterable<ASTVariableId>, ModifierOwner {
137+
interface MultiVariableIdOwner extends Iterable<ASTVariableId>, ModifierOwner {
138138

139139
/**
140140
* Returns a stream of the variable ids declared

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JAccessibleElementSymbol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*
1717
* @since 7.0.0
1818
*/
19-
public interface JAccessibleElementSymbol extends JElementSymbol, AnnotableSymbol {
19+
public interface JAccessibleElementSymbol extends AnnotableSymbol {
2020

2121
/**
2222
* Conventional return value of {@link #getPackageName()} for

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JExecutableSymbol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* Common supertype for {@linkplain JMethodSymbol method}
2020
* and {@linkplain JConstructorSymbol constructor symbols}.
2121
*/
22-
public interface JExecutableSymbol extends JAccessibleElementSymbol, JTypeParameterOwnerSymbol {
22+
public interface JExecutableSymbol extends JTypeParameterOwnerSymbol {
2323

2424

2525
/**

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/JTypeDeclSymbol.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @since 7.0.0
2323
*/
24-
public interface JTypeDeclSymbol extends JElementSymbol, JAccessibleElementSymbol {
24+
public interface JTypeDeclSymbol extends JAccessibleElementSymbol {
2525

2626
/**
2727
* Returns true if this class is a symbolic reference to an unresolved

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/symbols/internal/ast/AstUnnamedClassSym.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616
import net.sourceforge.pmd.lang.java.ast.ASTMethodDeclaration;
1717
import net.sourceforge.pmd.lang.java.ast.ASTVariableId;
1818
import net.sourceforge.pmd.lang.java.ast.JModifier;
19-
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol;
2019
import net.sourceforge.pmd.lang.java.symbols.JFieldSymbol;
2120
import net.sourceforge.pmd.lang.java.symbols.JMethodSymbol;
2221
import net.sourceforge.pmd.lang.java.symbols.internal.EmptyClassSymbol;
2322

24-
class AstUnnamedClassSym extends EmptyClassSymbol implements JClassSymbol {
23+
class AstUnnamedClassSym extends EmptyClassSymbol {
2524
private final List<JMethodSymbol> declaredMethods;
2625
private final List<JFieldSymbol> declaredFields;
2726

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/BasePrimitiveSymbol.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
import org.checkerframework.checker.nullness.qual.NonNull;
1111
import org.checkerframework.checker.nullness.qual.Nullable;
1212

13-
import net.sourceforge.pmd.lang.java.symbols.JClassSymbol;
1413
import net.sourceforge.pmd.lang.java.symbols.internal.EmptyClassSymbol;
1514
import net.sourceforge.pmd.lang.java.symbols.internal.SymbolEquality;
1615
import net.sourceforge.pmd.lang.java.symbols.internal.SymbolToStrings;
1716
import net.sourceforge.pmd.lang.java.types.JPrimitiveType.PrimitiveTypeKind;
1817

19-
abstract class BasePrimitiveSymbol extends EmptyClassSymbol implements JClassSymbol {
18+
abstract class BasePrimitiveSymbol extends EmptyClassSymbol {
2019

2120
BasePrimitiveSymbol(TypeSystem ts) {
2221
super(() -> ts);

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/JTypeVar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* <p>Type variables do not, in general, use reference identity. Use
3737
* equals to compare them.
3838
*/
39-
public interface JTypeVar extends JTypeMirror, SubstVar {
39+
public interface JTypeVar extends SubstVar {
4040

4141

4242
/**

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/InferenceVar.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
* type is of no importance outside the implementation of this framework.
3636
*/
3737
@SuppressWarnings("PMD.CompareObjectsWithEquals")
38-
public final class InferenceVar implements JTypeMirror, SubstVar {
38+
public final class InferenceVar implements SubstVar {
3939

4040
// we used to use greek letters (for style), but they're hard to type
4141
private static final String NAMES = "abcdefghijklmnopqrstuvwxyz"; // + "αβγδεζηθκλμνξπρςυφχψω"

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/MethodInvocMirror.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@
2121
import net.sourceforge.pmd.lang.java.types.TypeOps;
2222
import net.sourceforge.pmd.lang.java.types.internal.InternalMethodTypeItf;
2323
import net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror;
24-
import net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror.InvocationMirror;
2524
import net.sourceforge.pmd.lang.java.types.internal.infer.ast.JavaExprMirrors.MirrorMaker;
2625

27-
class MethodInvocMirror extends BaseInvocMirror<ASTMethodCall> implements InvocationMirror {
26+
class MethodInvocMirror extends BaseInvocMirror<ASTMethodCall> {
2827

2928

3029
MethodInvocMirror(JavaExprMirrors mirrors, ASTMethodCall call, @Nullable ExprMirror parent, MirrorMaker subexprMaker) {

pmd-java/src/main/java/net/sourceforge/pmd/lang/java/types/internal/infer/ast/StandaloneExprMirror.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import net.sourceforge.pmd.lang.java.types.JTypeMirror;
1111
import net.sourceforge.pmd.lang.java.types.internal.infer.ExprMirror;
1212

13-
class StandaloneExprMirror extends BaseExprMirror<ASTExpression> implements ExprMirror {
13+
class StandaloneExprMirror extends BaseExprMirror<ASTExpression> {
1414

1515
StandaloneExprMirror(JavaExprMirrors factory, ASTExpression myNode, @Nullable ExprMirror parent) {
1616
super(factory, myNode, parent);

0 commit comments

Comments
 (0)