Skip to content

Update documentation with modular @IndexSubclasses gotcha #68

@pentlander

Description

@pentlander

When your project uses a module-info.java class, using @IndexSubclasses on the package-info.java class does not work out of the box. According to the javadoc:

Additionally, and except for the special case where the resource has a name ending with ".class", this method will only find resources in packages of named modules when the package is opened unconditionally (even if the caller of this method is in the same module as the resource).

This means that the user needs to add opens package.containing.package.info to the module-info.java in order for the ClassIndex.getPackageClasses function to work. I ran into this problem myself, so I thought it would be useful to document for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions