From cfd37d948d935258c55dd403bb112328eb402cf5 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Thu, 1 Sep 2022 13:37:08 -0700 Subject: [PATCH] Reduce visibility of hint factory methods Reduce the visibility of hint factory methods that return a `Builder`. Since the `build()` method of the `Builder` is package-private the factory methods can also be package-private. --- .../java/org/springframework/aot/hint/ExecutableHint.java | 4 ++-- .../src/main/java/org/springframework/aot/hint/TypeHint.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java b/spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java index cd11fdc1b01..de51e2160e7 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/ExecutableHint.java @@ -48,7 +48,7 @@ public final class ExecutableHint extends MemberHint { * @param parameterTypes the parameter types of the constructor * @return a builder */ - public static Builder ofConstructor(List parameterTypes) { + static Builder ofConstructor(List parameterTypes) { return new Builder("", parameterTypes); } @@ -58,7 +58,7 @@ public final class ExecutableHint extends MemberHint { * @param parameterTypes the parameter types of the method * @return a builder */ - public static Builder ofMethod(String name, List parameterTypes) { + static Builder ofMethod(String name, List parameterTypes) { return new Builder(name, parameterTypes); } diff --git a/spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java b/spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java index 343964c211a..c336b558289 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/TypeHint.java @@ -68,7 +68,7 @@ public final class TypeHint implements ConditionalHint { * @param type the type to use * @return a builder */ - public static Builder of(TypeReference type) { + static Builder of(TypeReference type) { Assert.notNull(type, "'type' must not be null"); return new Builder(type); } @@ -145,7 +145,7 @@ public final class TypeHint implements ConditionalHint { private final Set memberCategories = new HashSet<>(); - public Builder(TypeReference type) { + Builder(TypeReference type) { this.type = type; }