Major bugfix and performance release -- recommended update
Performance improvements:
- Added a custom zipfile central directory parser to ClassGraph, which is able to read jarfiles nested inside jarfiles, to arbitrary nesting depth, without extracting the inner jars to temporary files (this is something the Java
ZipFile
API cannot do). This makes it significantly faster to scan fat jars that store their dependencies as nested jars (e.g. jars generated by Spring Boot).- As this was a large change, please report any behavioral changes or performance regressions in the ClassGraph bugtracker.
- Fixed a performance regression introduced at version 4.4.3 to do with extending scanning upwards to superclasses, interfaces and annotations that are defined outside whitelisted packages. (#282, thanks to @GedMarc)
- Implemented a number of other performance improvements that give a sizeable reduction in scan time.
New features:
- Even with scanning of system modules disabled (the default), you can whitelist individual system modules to scan, e.g.
.whitelistModules("java.base")
. (To enable scanning of all system modules, you can callenableSystemJarsAndModules()
, as described below.) whitelistClasspathElementsContainingResourcePath(paths)
whitelists classpath elements that contain a resource with a specific path. For example, this can be used to scan only classpath elements that contain a specific configuration file.blacklistClasspathElementsContainingResourcePath(paths)
blacklists classpath elements that contain a resource with a specific path.
Bugfixes:
- Numerous bugfixes (too many to list) for robustness and handling of corner cases -- recommended upgrade.
- Fixed
ClassInfo#getPackageName()
, which was returning the simplename of the class, not the package name. (#276, thanks to @danielpoq) - Fixed "Calling
blacklistLibOrExtJars
without arguments causes an Exception" (#277, thanks to @larsgrefer) - Improved verbose logging output.
Breaking changes:
enableSystemPackages()
no longer callswhitelistLibOrExtJars()
. You need to separately callwhitelistLibOrExtJars()
if you want to scan jars in JRElib/
orext/
directories in addition tort.jar
or the system modules.enableSystemPackages()
was deprecated and now calls a new method with a more correct name,enableSystemJarsAndModules()
.ClassGraph#stripZipSFXHeaders()
was removed, as it did nothing useful.- Classes intended for internal-only use were moved to a "noapi" package, which is not exported in the JPMS module descriptor.
Code cleanups:
- Incorporated a large number of static code analysis fixes from @larsgrefer (#279) -- huge thanks for all your contributions towards this release, Lars!
- Lots of refactoring and code cleanups.