Changelog History
Page 5
-
v4.8.53 Changes
November 04, 2019- 🔦 Exposed raw type descriptor and/or type signature strings for methods, fields and classes (#380):
MethodInfo#getTypeDescriptorStr()
MethodInfo#getTypeSignatureStr()
MethodInfo#getTypeSignatureOrTypeDescriptorStr()
FieldInfo#getTypeDescriptorStr()
FieldInfo#getTypeSignatureStr()
FieldInfo#getTypeSignatureOrTypeDescriptorStr()
ClassInfo#getTypeSignatureStr()
- ✂ Removed
static final
check on fields before scanning for constant initializer values, to allow constant initializers to be read for non-static / non-final fields in Kotlin. (Java does not generate these, and technically Kotlin should not either, but one user relies on this in their Kotlin API -- #379.)
Thanks to @rankinc for both these feature requests!
- 🔦 Exposed raw type descriptor and/or type signature strings for methods, fields and classes (#380):
-
v4.8.52 Changes
October 20, 2019✂ Remove the shutdown hook entirely (#376).
📚 A shutdown hook has been in place for numerous releases, and its purpose was to call
ScanResult#close()
on any openScanResult
instances before JVM shutdown, in order to free up resources (delete any temporary files that had to be created to extract deflated nested jars; unmap mapped byte buffers; close open modules; close open files; free up allocated memory; etc.). However the JVM's own shutdown processes should take care of all of these steps, including the removal of any temporary files that are created, as they are marked for deletion on JVM shutdown. More importantly,ScanResult
implementsAutocloseable
, and the ClassGraph documentation strongly recommends assigningScanResult
in a try-with-resources block so that eachScanResult
is properly closed, so the shutdown hook was always just a fallback.If you want to close all open (unclosed)
ScanResult
instances at once, you can call the new static methodScanResult.closeAll()
. You might want to do this on container unload/destroy, in a containerized runtime.ClassGraph automatically registers lifecycle listeners for servlet containers and Spring applications that call
ScanResult.closeAll()
, to ensure that resources are properly freed when containers are destroyed or unloaded.Note that if you call
ScanResult.closeAll()
, you need to ensure that the lifecycle of the classloader matches the lifecycle of your application, or that two concurrent applications don't share the same classloader, otherwise one application might close another application'sScanResult
instances while they are still in use. -
v4.8.51 Changes
October 20, 2019In servlet containers and Spring applications, rather than adding a shutdown hook to close any unclosed
ScanResult
objects (to prevent resource leaks), instead add an event listener that closes unclosedScanResult
objects when the container is being torn down. This prevents a leak of the container's classloader (#376, thanks to @vimil for reporting).Please report any regressions with servlet containers or Spring.
-
v4.8.50 Changes
October 17, 2019âš No new functionality; only fixes static analysis warnings (switched on Eclipse JDT's nullability analysis warnings; fixed all warnings).
-
v4.8.49 Changes
October 17, 2019