-
Notifications
You must be signed in to change notification settings - Fork 441
Description
Currently the reflect-config.json
file generated by ReflectionConfigGenerator
contains some unnecessary entries.
Specifically, entries for classes used internally by picocli: picocli uses reflection to allow the library to be used from Java 5 and higher while still using features available in later versions of Java. One example is type converters for classes in the java.time.*
package, another example is java.io.Console.readPassword()
.
According to the Graal SubstrateVM docs on reflection, SubstrateVM does static analysis that detects calls to the reflection API.
The analysis intercepts calls to Class.forName(String), Class.forName(String, ClassLoader), Class.getDeclaredField(String), Class.getField(String), Class.getDeclaredMethod(String, Class[]), Class.getMethod(String, Class[]), Class.getDeclaredConstructor(Class[]) and Class.getConstructor(Class[]). If the arguments to these calls can be reduced to a constant we try to resolve the target elements. If the target elements can be resolved the calls are removed and instead the target elements are embedded in the code.
It should be possible to generate a reduced reflect-config.json
that does not include entries for the above.