From aeeaa55d35b6ed52325504470ac77a03de3b9ba6 Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 7 Jun 2024 17:22:02 +0200 Subject: [PATCH] Deprecate a couple more methods in ReflectiveHierarchyBuildItem.Builder --- .../ReflectiveHierarchyBuildItem.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java index b4664c8645544..54b7c35d01ffe 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ReflectiveHierarchyBuildItem.java @@ -192,7 +192,7 @@ public static Builder builder(DotName className) { * @return a new {@link Builder} instance, initialized from the specified {@link Type} */ public static Builder builder(Type type) { - return new Builder().type(type); + return new Builder(type); } public static class Builder { @@ -205,10 +205,23 @@ public static class Builder { private String source = UNKNOWN_SOURCE; private boolean serialization; + /** + * @deprecated use {@link ReflectiveHierarchyBuildItem#builder(Type)}, + * {@link ReflectiveHierarchyBuildItem#builder(String)} or + * {@link ReflectiveHierarchyBuildItem#builder(DotName)} instead + */ + @Deprecated(since = "3.12", forRemoval = true) + public Builder() { + } + + private Builder(Type type) { + this.type = type; + } + /** * @deprecated use {@link ReflectiveHierarchyBuildItem#builder(Type)} instead */ - @Deprecated + @Deprecated(since = "3.12", forRemoval = true) public Builder type(Type type) { this.type = type; return this; @@ -219,7 +232,9 @@ public Builder type(Type type) { * * @param className a {@link DotName} representing the name of the class of the Type to be registered for reflection * @return this {@link Builder} instance + * @deprecated use {@link ReflectiveHierarchyBuildItem#builder(DotName)} instead */ + @Deprecated(since = "3.12", forRemoval = true) public Builder className(DotName className) { return type(Type.create(className, Type.Kind.CLASS)); } @@ -229,7 +244,9 @@ public Builder className(DotName className) { * * @param className the name of the class of the Type to be registered for reflection * @return this {@link Builder} instance + * @deprecated use {@link ReflectiveHierarchyBuildItem#builder(String)} instead */ + @Deprecated(since = "3.12", forRemoval = true) public Builder className(String className) { return className(DotName.createSimple(className)); }