Skip to content

Commit 9c8c1f3

Browse files
Implement RuntimeHintsRegistrar
1 parent a378199 commit 9c8c1f3

File tree

7 files changed

+46
-31
lines changed

7 files changed

+46
-31
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerTemplateAvailabilityProvider.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121
import java.util.List;
2222

2323
import org.springframework.aot.hint.RuntimeHints;
24+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
2425
import org.springframework.boot.autoconfigure.template.PathBasedTemplateAvailabilityProvider;
2526
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider;
2627
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
@@ -65,16 +66,13 @@ public void setTemplateLoaderPath(List<String> templateLoaderPath) {
6566

6667
}
6768

68-
static class FreeMarkerTemplateAvailabilityRuntimeHints extends BindableRuntimeHintsRegistrar {
69-
70-
FreeMarkerTemplateAvailabilityRuntimeHints() {
71-
super(FreeMarkerTemplateAvailabilityProperties.class);
72-
}
69+
static class FreeMarkerTemplateAvailabilityRuntimeHints implements RuntimeHintsRegistrar {
7370

7471
@Override
7572
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
7673
if (ClassUtils.isPresent(REQUIRED_CLASS_NAME, classLoader)) {
77-
super.registerHints(hints, classLoader);
74+
BindableRuntimeHintsRegistrar.forTypes(FreeMarkerTemplateAvailabilityProperties.class)
75+
.registerHints(hints, classLoader);
7876
}
7977
}
8078

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/groovy/template/GroovyTemplateAvailabilityProvider.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2023 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
2121
import java.util.List;
2222

2323
import org.springframework.aot.hint.RuntimeHints;
24+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
2425
import org.springframework.boot.autoconfigure.template.PathBasedTemplateAvailabilityProvider;
2526
import org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider;
2627
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
@@ -65,16 +66,13 @@ public void setResourceLoaderPath(List<String> resourceLoaderPath) {
6566

6667
}
6768

68-
static class GroovyTemplateAvailabilityRuntimeHints extends BindableRuntimeHintsRegistrar {
69-
70-
GroovyTemplateAvailabilityRuntimeHints() {
71-
super(GroovyTemplateAvailabilityProperties.class);
72-
}
69+
static class GroovyTemplateAvailabilityRuntimeHints implements RuntimeHintsRegistrar {
7370

7471
@Override
7572
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
7673
if (ClassUtils.isPresent(REQUIRED_CLASS_NAME, classLoader)) {
77-
super.registerHints(hints, classLoader);
74+
BindableRuntimeHintsRegistrar.forTypes(GroovyTemplateAvailabilityProperties.class)
75+
.registerHints(hints, classLoader);
7876
}
7977
}
8078

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfiguration.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.boot.autoconfigure.http;
1818

19+
import org.springframework.aot.hint.RuntimeHints;
20+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
1921
import org.springframework.beans.factory.ObjectProvider;
2022
import org.springframework.boot.autoconfigure.AutoConfiguration;
2123
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -31,6 +33,7 @@
3133
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
3234
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
3335
import org.springframework.boot.context.properties.bind.Binder;
36+
import org.springframework.boot.logging.structured.GraylogExtendedLogFormatProperties;
3437
import org.springframework.boot.web.servlet.server.Encoding;
3538
import org.springframework.context.annotation.Bean;
3639
import org.springframework.context.annotation.Conditional;
@@ -100,10 +103,11 @@ private static final class ReactiveWebApplication {
100103

101104
}
102105

103-
static class HttpMessageConvertersAutoConfigurationRuntimeHints extends BindableRuntimeHintsRegistrar {
106+
static class HttpMessageConvertersAutoConfigurationRuntimeHints implements RuntimeHintsRegistrar {
104107

105-
HttpMessageConvertersAutoConfigurationRuntimeHints() {
106-
super(Encoding.class);
108+
@Override
109+
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
110+
BindableRuntimeHintsRegistrar.forTypes(Encoding.class).registerHints(hints, classLoader);
107111
}
108112

109113
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/ApplicationProperties.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@
1919
import java.util.LinkedHashSet;
2020
import java.util.Set;
2121

22+
import org.springframework.aot.hint.RuntimeHints;
23+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
2224
import org.springframework.boot.Banner.Mode;
2325
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
2426
import org.springframework.boot.logging.LoggingSystemProperty;
@@ -157,10 +159,11 @@ void setWebApplicationType(WebApplicationType webApplicationType) {
157159
this.webApplicationType = webApplicationType;
158160
}
159161

160-
static class ApplicationPropertiesRuntimeHints extends BindableRuntimeHintsRegistrar {
162+
static class ApplicationPropertiesRuntimeHints implements RuntimeHintsRegistrar {
161163

162-
ApplicationPropertiesRuntimeHints() {
163-
super(ApplicationProperties.class);
164+
@Override
165+
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
166+
BindableRuntimeHintsRegistrar.forTypes(ApplicationProperties.class).registerHints(hints, classLoader);
164167
}
165168

166169
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/structured/ElasticCommonSchemaProperties.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.boot.logging.structured;
1818

19+
import org.springframework.aot.hint.RuntimeHints;
20+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
1921
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
2022
import org.springframework.boot.context.properties.bind.Binder;
2123
import org.springframework.boot.json.JsonWriter;
@@ -92,10 +94,12 @@ Service withDefaults(Environment environment) {
9294

9395
}
9496

95-
static class ElasticCommonSchemaPropertiesRuntimeHints extends BindableRuntimeHintsRegistrar {
97+
static class ElasticCommonSchemaPropertiesRuntimeHints implements RuntimeHintsRegistrar {
9698

97-
ElasticCommonSchemaPropertiesRuntimeHints() {
98-
super(ElasticCommonSchemaProperties.class);
99+
@Override
100+
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
101+
BindableRuntimeHintsRegistrar.forTypes(ElasticCommonSchemaProperties.class)
102+
.registerHints(hints, classLoader);
99103
}
100104

101105
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/structured/GraylogExtendedLogFormatProperties.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
package org.springframework.boot.logging.structured;
1818

19+
import org.springframework.aot.hint.RuntimeHints;
20+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
1921
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
2022
import org.springframework.boot.context.properties.bind.Binder;
2123
import org.springframework.boot.json.JsonWriter;
@@ -92,10 +94,12 @@ void jsonMembers(JsonWriter.Members<?> members) {
9294

9395
}
9496

95-
static class GraylogExtendedLogFormatPropertiesRuntimeHints extends BindableRuntimeHintsRegistrar {
97+
static class GraylogExtendedLogFormatPropertiesRuntimeHints implements RuntimeHintsRegistrar {
9698

97-
GraylogExtendedLogFormatPropertiesRuntimeHints() {
98-
super(GraylogExtendedLogFormatProperties.class);
99+
@Override
100+
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
101+
BindableRuntimeHintsRegistrar.forTypes(GraylogExtendedLogFormatProperties.class)
102+
.registerHints(hints, classLoader);
99103
}
100104

101105
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/structured/StructuredLoggingJsonProperties.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
import java.util.function.UnaryOperator;
2828
import java.util.stream.Stream;
2929

30+
import org.springframework.aot.hint.RuntimeHints;
31+
import org.springframework.aot.hint.RuntimeHintsRegistrar;
3032
import org.springframework.boot.context.properties.PropertyMapper;
3133
import org.springframework.boot.context.properties.bind.BindableRuntimeHintsRegistrar;
3234
import org.springframework.boot.context.properties.bind.Binder;
@@ -146,10 +148,12 @@ enum Root {
146148

147149
}
148150

149-
static class StructuredLoggingJsonPropertiesRuntimeHints extends BindableRuntimeHintsRegistrar {
151+
static class StructuredLoggingJsonPropertiesRuntimeHints implements RuntimeHintsRegistrar {
150152

151-
StructuredLoggingJsonPropertiesRuntimeHints() {
152-
super(StructuredLoggingJsonProperties.class);
153+
@Override
154+
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
155+
BindableRuntimeHintsRegistrar.forTypes(StructuredLoggingJsonProperties.class)
156+
.registerHints(hints, classLoader);
153157
}
154158

155159
}

0 commit comments

Comments
 (0)