github classgraph/classgraph fast-classpath-scanner-2.0.0

latest releases: classgraph-4.8.172, classgraph-4.8.171, classgraph-4.8.170...
7 years ago

Version 2.0.0 of FastClasspathScanner is the culmination of a huge amount of work to parallelize and optimize the scanning process based on careful profiling, and to improve classpath detection in many contexts. This release includes numerous important bugfixes, so upgrading is strongly recommended.

Note that the project documentation has been significantly improved, and moved to the Wiki. Also feel free to join the new mailing list for users of FastClasspathScanner.

Changelog relative to the early 1.x series:

  • Parallel scanning: FastClasspathScanner now performs multithreaded scanning by default, overlapping disk/SSD reads, unzipping and classfile parsing across multiple threads for maximum throughput. This delivers a speedup of a factor of 2-4x compared to older versions of FastClasspathScanner (and FastClasspathScanner was already the fastest classpath scanner before this optimization). There is also a new method Future<ScanResult> FastClasspathScanner#scanAsync(), which allows you to scan asynchronously, with full support for thread interruption via Future#cancel().
  • Fixed numerous bugs, notably in the area of classpath detection and extraction of classpath elements from classloaders. If your classes are not being found with an older version, it's more likely this version will be able to find them.
  • API changes:
    • FastClasspathScanner#scan() now returns a ScanResult object that contains the result of a classpath scan. This object can be queried for classes that match specific criteria.
    • InterfaceMatchProcessor was renamed to ImplementingClassMatchProcessor, because this MatchProcessor wasn't used to match an interface, it was used to match the classes that implement the interface.
    • A third new mechanism was added for scanning for matching classes, by calling Map<String, ClassInfo> ScanResult#getClassNameToClassInfo, which can be used with Java 8 stream processing to filter for classes that match specific criteria, using the methods of ClassInfo objects. See the wiki for examples.
    • A MethodAnnotationMatchProcessor was added that allows you to match methods with a given annotation.
  • Debugging output was significantly improved (this can be enabled by calling FastClasspathScanner#verbose() before FastClasspathScanner#scan()).
  • Javadoc comments for the public API were improved.

In future, FastClasspathScanner version numbers will follow the SemVer (semantic versioning) spec.

Don't miss a new classgraph release

NewReleases is sending notifications on new releases.