Skip to content

Commit 444e06f

Browse files
committed
Harmonize visibility of RuntimeHints builders
Closes gh-28835
1 parent 87b83e8 commit 444e06f

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

spring-core/src/main/java/org/springframework/aot/hint/ResourceBundleHint.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public final class ResourceBundleHint implements ConditionalHint {
3333
private final String baseName;
3434

3535
@Nullable
36-
private TypeReference reachableType;
36+
private final TypeReference reachableType;
3737

3838

3939
ResourceBundleHint(Builder builder) {
@@ -83,6 +83,10 @@ public static class Builder {
8383
@Nullable
8484
private TypeReference reachableType;
8585

86+
Builder(String baseName) {
87+
this.baseName = baseName;
88+
}
89+
8690
/**
8791
* Make this hint conditional on the fact that the specified type
8892
* can be resolved.

spring-core/src/main/java/org/springframework/aot/hint/ResourceHints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public ResourceHints registerType(Class<?> type) {
137137
* @return {@code this}, to facilitate method chaining
138138
*/
139139
public ResourceHints registerResourceBundle(String baseName, @Nullable Consumer<ResourceBundleHint.Builder> resourceHint) {
140-
ResourceBundleHint.Builder builder = new ResourceBundleHint.Builder().baseName(baseName);
140+
ResourceBundleHint.Builder builder = new ResourceBundleHint.Builder(baseName);
141141
if (resourceHint != null) {
142142
resourceHint.accept(builder);
143143
}

spring-core/src/main/java/org/springframework/aot/hint/ResourcePatternHints.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public static class Builder {
7171

7272
private final Set<ResourcePatternHint> excludes = new LinkedHashSet<>();
7373

74+
Builder() {
75+
}
76+
7477
/**
7578
* Includes the resources matching the specified pattern.
7679
* @param reachableType the type that should be reachable for this hint to apply

0 commit comments

Comments
 (0)