diff --git a/src/main/java/io/github/classgraph/ClassInfo.java b/src/main/java/io/github/classgraph/ClassInfo.java index 271c5aa7c..bd71f11bc 100644 --- a/src/main/java/io/github/classgraph/ClassInfo.java +++ b/src/main/java/io/github/classgraph/ClassInfo.java @@ -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); @@ -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