Skip to content

classgraph-4.8.130 introduces NPE when scanning with overridden classloader #639

@limbic-derek

Description

@limbic-derek

I tracked down this regression to this particular release.

Here's what I'm doing:

  private void getClassInfo(Class<?> clazz) {
    try (var results =
        classGraph
            .acceptClasses(clazz.getName())
            .overrideClassLoaders(clazz.getClassLoader())
            .scan()) {
      var classInfo = results.getClassInfo(clazz.getName());
      // do stuff w/ classInfo except its null here in 4.8.130
    }
  }

  public final class SomeClass {
  }

public static test() {
  getClassInfo(SomeClass.class);
}

Prior to release 4.8.130, I would get what I expected (ClassInfo for SomeClass), by upgrading to this version, I get a null.
Any thoughts on this? I also verified this is still broken w/ the latest release for me.

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