Skip to content

ClassInfoList.getClassesImplementing() throws exception if underlying object is a class despite documentation stating the contrary #543

@parttimenerd

Description

@parttimenerd

The documentation and the code differ for ClassInfoList.getClassesImplementing():

    /**
     * Get the classes (and their subclasses) that implement this interface, if this is an interface.
     *
     * @return the list of the classes (and their subclasses) that implement this interface, if this is an
     *         interface, otherwise returns the empty list.
     */
    public ClassInfoList getClassesImplementing() {
        if (!isInterface()) {
            throw new IllegalArgumentException("Class is not an interface: " + getName());
        }

The code clearly throws an IllegalArgumentException for non-interfaces.

This propagates to ScanResult.getClassesImplementing() too which therefore has the same issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions