Restore support for package private ReflectiveProcessor

See gh-28975
This commit is contained in:
Stephane Nicoll
2022-08-18 14:27:59 +02:00
parent d6afa8df2d
commit eac616a83e
2 changed files with 36 additions and 1 deletions

View File

@@ -113,7 +113,9 @@ public class ReflectiveRuntimeHintsRegistrar {
private ReflectiveProcessor instantiateClass(Class<? extends ReflectiveProcessor> type) {
try {
return type.getDeclaredConstructor().newInstance();
Constructor<? extends ReflectiveProcessor> constructor = type.getDeclaredConstructor();
ReflectionUtils.makeAccessible(constructor);
return constructor.newInstance();
}
catch (Exception ex) {
throw new IllegalStateException("Failed to instantiate " + type, ex);