Skip to content

Commit

Permalink
Remove IllegalArgumentException for wrong class type (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukehutch committed Aug 10, 2021
1 parent e414e16 commit 07bbc10
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/main/java/io/github/classgraph/ClassInfo.java
Expand Up @@ -1685,9 +1685,6 @@ public ClassInfoList getInterfaces() {
* interface, otherwise returns the empty list.
*/
public ClassInfoList getClassesImplementing() {
if (!isInterface()) {
throw new IllegalArgumentException("Class is not an interface: " + getName());
}
// Subclasses of implementing classes also implement the interface
final ReachableAndDirectlyRelatedClasses implementingClasses = this
.filterClassInfo(RelType.CLASSES_IMPLEMENTING, /* strictAccept = */ !isExternalClass);
Expand Down Expand Up @@ -1917,9 +1914,6 @@ public ClassInfoList getClassesWithAnnotation() {
if (!scanResult.scanSpec.enableAnnotationInfo) {
throw new IllegalArgumentException("Please call ClassGraph#enableAnnotationInfo() before #scan()");
}
if (!isAnnotation()) {
throw new IllegalArgumentException("Class is not an annotation: " + getName());
}

// Get classes that have this annotation
final ReachableAndDirectlyRelatedClasses classesWithAnnotation = this
Expand Down

0 comments on commit 07bbc10

Please sign in to comment.