Skip to content

Commit 0035569

Browse files
committed
Prevent incomplete types to stop AOT processing
Previously, if a type to bind had a property whose type could not be loaded, this would fail the whole build. This commit makes sure that such failure does not stop AOT processing: rather we ignore the incomplete type and carry on. Closes gh-43598
1 parent a87a856 commit 0035569

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BindableRuntimeHintsRegistrar.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
import kotlin.jvm.JvmClassMappingKt;
3131
import kotlin.reflect.KClass;
32+
import org.apache.commons.logging.Log;
33+
import org.apache.commons.logging.LogFactory;
3234

3335
import org.springframework.aot.hint.ExecutableMode;
3436
import org.springframework.aot.hint.MemberCategory;
@@ -59,6 +61,8 @@
5961
*/
6062
public class BindableRuntimeHintsRegistrar implements RuntimeHintsRegistrar {
6163

64+
private static final Log logger = LogFactory.getLog(BindableRuntimeHintsRegistrar.class);
65+
6266
private final Bindable<?>[] bindables;
6367

6468
/**
@@ -89,7 +93,12 @@ public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
8993
*/
9094
public void registerHints(RuntimeHints hints) {
9195
for (Bindable<?> bindable : this.bindables) {
92-
new Processor(bindable).process(hints.reflection());
96+
try {
97+
new Processor(bindable).process(hints.reflection());
98+
}
99+
catch (Exception ex) {
100+
logger.debug("Skipping hints for " + bindable, ex);
101+
}
93102
}
94103
}
95104

0 commit comments

Comments
 (0)