Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 8f9b9b1

Browse files
christophstroblsdeleuze
authored andcommitted
Guard hint processor against ClassNotFoundException.
This commit fixes an issue where hints for types identified via their name can lead to unintended ClassNotFoundException.
1 parent ef7a00f commit 8f9b9b1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

spring-aot/src/main/java/org/springframework/context/bootstrap/generator/nativex/HintsBeanNativeConfigurationProcessor.java

+3
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ private void findAndRegisterRelevantNativeHints(Class<?> beanType, NativeConfigu
8686
// Types
8787
Map<String, AccessDescriptor> dependantTypes = hint.getDependantTypes();
8888
for (Map.Entry<String, AccessDescriptor> entry : dependantTypes.entrySet()) {
89+
if(!ClassUtils.isPresent(entry.getKey(), null)) {
90+
continue;
91+
}
8992
Class<?> keyClass = ClassUtils.forName(entry.getKey(), null);
9093
AccessDescriptor value = entry.getValue();
9194
Integer accessBits = value.getAccessBits();

0 commit comments

Comments
 (0)