mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-10-07 04:41:23 +00:00
addPresentableNestedNames() recursively walks the properties of beans calling getters. Likely unintentionally this includes calling getClass() and recursing into the reflection API. When running on JDK 11 the reflection API has some methods (e.g. in java.lang.module) that return instances of Optional. With the newer version of Spring's BeanWrapperImpl encounters an Optional it attempts to unwrap it and throws IllegalArgumentException if it is empty. Let's fix this in two ways. Firstly let's avoid walking the reflection API entirely as its irrelevant for the purposes of bean browsing by not inspecting the properties of instances of java.lang.Class. Secondly in case any Heritrix beans start using Optional in future lets also handle the empty case by also not inspecting, the same as we do for null. Fixes #376 Reported-By: Lauren Ko <lauren.ko@unt.edu>