Skip to content

Commit

Permalink
refactor: Remove redundant supertypes (#4369)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWitt authored Jan 14, 2022
1 parent 075c8f5 commit 5f0a945
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
import spoon.support.reflect.cu.CompilationUnitImpl;

import java.io.File;
import java.io.Serializable;

/**
* This class represents the position of a program element in a source file.
*/
public class NoSourcePosition implements SourcePosition, Serializable {
public class NoSourcePosition implements SourcePosition {

private static final long serialVersionUID = 1L;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/spoon/reflect/declaration/CtConstructor.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/**
* This element defines a constructor declaration.
*/
public interface CtConstructor<T> extends CtExecutable<T>, CtTypeMember, CtFormalTypeDeclarer, CtShadowable {
public interface CtConstructor<T> extends CtExecutable<T>, CtFormalTypeDeclarer, CtShadowable {

/**
* Always returns "&lt;init&gt;".
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/spoon/reflect/declaration/CtMethod.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* This element defines a method declaration.
*/
public interface CtMethod<T> extends CtExecutable<T>, CtTypeMember, CtFormalTypeDeclarer, CtShadowable {
public interface CtMethod<T> extends CtExecutable<T>, CtFormalTypeDeclarer, CtShadowable {
/**
* @param superMethod to be checked method
* @return true if this method overrides `superMethod`.<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package spoon.reflect.visitor.filter;

import spoon.reflect.reference.CtReference;
import spoon.reflect.visitor.Filter;

/**
* This class defines an abstract reference filter that needs to be subclassed
Expand All @@ -17,7 +16,7 @@
* @param <T>
* the type of the reference to be matched
*/
public abstract class AbstractReferenceFilter<T extends CtReference> extends AbstractFilter<T> implements Filter<T> {
public abstract class AbstractReferenceFilter<T extends CtReference> extends AbstractFilter<T> {

/**
* Creates a reference filter with the type of the potentially matching
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
import spoon.reflect.cu.CompilationUnit;
import spoon.reflect.cu.position.BodyHolderSourcePosition;

import java.io.Serializable;

/**
* This class represents the position of a Java program element in a source
* file.
*/
public class BodyHolderSourcePositionImpl extends DeclarationSourcePositionImpl
implements BodyHolderSourcePosition, Serializable {
implements BodyHolderSourcePosition {

private static final long serialVersionUID = 1L;
private int bodyStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
import spoon.reflect.cu.CompilationUnit;
import spoon.reflect.cu.position.CompoundSourcePosition;

import java.io.Serializable;

/**
* This class represents the position of a named Java program element in a source
* file.
*/
public class CompoundSourcePositionImpl extends SourcePositionImpl
implements CompoundSourcePosition, Serializable {
implements CompoundSourcePosition {

private static final long serialVersionUID = 1L;
private int declarationSourceStart;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
import spoon.reflect.cu.CompilationUnit;
import spoon.reflect.cu.position.DeclarationSourcePosition;

import java.io.Serializable;

/**
* This class represents the position of a Java program element in a source
* file.
*/
public class DeclarationSourcePositionImpl extends CompoundSourcePositionImpl
implements DeclarationSourcePosition, Serializable, Cloneable {
implements DeclarationSourcePosition, Cloneable {

private static final long serialVersionUID = 1L;
private int modifierSourceEnd;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
import spoon.reflect.cu.position.NoSourcePosition;

import java.io.File;
import java.io.Serializable;
import java.util.Arrays;

/**
* This immutable class represents the position of a Java program element in a source
* file.
*/
public class SourcePositionImpl implements SourcePosition, Serializable {
public class SourcePositionImpl implements SourcePosition {

private static final long serialVersionUID = 1L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@
import spoon.support.visitor.equals.CloneHelper;
import spoon.support.visitor.equals.EqualsVisitor;
import spoon.support.visitor.replace.ReplacementVisitor;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import java.lang.invoke.MethodHandles;
import java.util.ArrayList;
Expand All @@ -72,7 +70,7 @@
* Contains the default implementation of most CtElement methods.
*
*/
public abstract class CtElementImpl implements CtElement, Serializable {
public abstract class CtElementImpl implements CtElement {
private static final long serialVersionUID = 1L;
protected static final Logger LOGGER = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
public static final String ERROR_MESSAGE_TO_STRING = "Error in printing the node. One parent isn't initialized!";
Expand Down

0 comments on commit 5f0a945

Please sign in to comment.