Skip to content

Commit

Permalink
Remove invalid methods from ClassTypeSignature and MethodTypeSignature
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehutch committed Dec 18, 2020
1 parent 40aec43 commit daa3d22
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 25 deletions.
3 changes: 1 addition & 2 deletions src/main/java/io/github/classgraph/ArrayTypeSignature.java
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,8 @@ protected void addTypeAnnotation(final List<TypePathNode> typePath, final Annota
* @return a list of {@link AnnotationInfo} objects for the type annotations of on this array type, or null if
* none.
*/
@Override
public AnnotationInfoList getTypeAnnotationInfo() {
return super.getTypeAnnotationInfo();
return typeAnnotationInfo;
}

// -------------------------------------------------------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/io/github/classgraph/ClassTypeSignature.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,6 @@ protected void addTypeAnnotation(final List<TypePathNode> typePath, final Annota
"Cannot call this method on " + ClassTypeSignature.class.getSimpleName());
}

@Override
public AnnotationInfoList getTypeAnnotationInfo() {
throw new IllegalArgumentException("Cannot call this method on " + ClassTypeSignature.class.getSimpleName()
+ " -- type annotations are accessible by calling getTypeParameters(), getSuperclassSignature(), "
+ "and getSuperinterfaceSignature().");
}

// -------------------------------------------------------------------------------------------------------------

/* (non-Javadoc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@
public abstract class HierarchicalTypeSignature extends ScanResultObject {
protected AnnotationInfoList typeAnnotationInfo;

/**
* Get a list of {@link AnnotationInfo} objects for any type annotations on this type, or null if none.
*
* @return a list of {@link AnnotationInfo} objects for any type annotations on this type, or null if none.
*/
public AnnotationInfoList getTypeAnnotationInfo() {
return typeAnnotationInfo;
}

/**
* Add a type annotation.
*
Expand Down
7 changes: 0 additions & 7 deletions src/main/java/io/github/classgraph/MethodTypeSignature.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,6 @@ protected void addTypeAnnotation(final List<TypePathNode> typePath, final Annota
"Cannot call this method on " + MethodTypeSignature.class.getSimpleName());
}

@Override
public AnnotationInfoList getTypeAnnotationInfo() {
throw new IllegalArgumentException("Cannot call this method on " + MethodTypeSignature.class.getSimpleName()
+ " -- type annotations are accessible by calling getTypeParameters(), getResultType(), "
+ "and getThrowsSignatures().");
}

/**
* Add a type annotation for an explicit receiver parameter.
*
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/io/github/classgraph/TypeSignature.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ final protected void findReferencedClassInfo(final Map<String, ClassInfo> classN
}
}

/**
* Get a list of {@link AnnotationInfo} objects for any type annotations on this type, or null if none.
*
* @return a list of {@link AnnotationInfo} objects for any type annotations on this type, or null if none.
*/
public AnnotationInfoList getTypeAnnotationInfo() {
return typeAnnotationInfo;
}

/**
* Compare base types, ignoring generic type parameters.
*
Expand Down

0 comments on commit daa3d22

Please sign in to comment.