diff --git a/spring-core/src/main/java/org/springframework/aot/hint/MemberCategory.java b/spring-core/src/main/java/org/springframework/aot/hint/MemberCategory.java index 4025366932..38c2178d22 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/MemberCategory.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/MemberCategory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2024 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,22 +32,22 @@ import java.lang.reflect.Method; public enum MemberCategory { /** - * A category that represents introspection on public {@linkplain Field fields}. - * @deprecated with no replacement since introspection is included - * when {@link ReflectionHints#registerType(Class, MemberCategory...) adding a reflection hint for a type}. - * Use {@link #INVOKE_PUBLIC_FIELDS} if getting/setting field values is required. - * @see Class#getFields() + * A category that represents reflective field access on public {@linkplain Field fields}. + * @deprecated in favor of @link #INVOKE_PUBLIC_FIELDS} with similar semantics. + * @see Field#get(Object) + * @see Field#set(Object, Object) */ @Deprecated(since = "7.0", forRemoval = true) PUBLIC_FIELDS, /** - * A category that represents introspection on {@linkplain Class#getDeclaredFields() declared - * fields}: all fields defined by the class but not inherited fields. - * @deprecated with no replacement since introspection is included - * when {@link ReflectionHints#registerType(Class, MemberCategory...) adding a reflection hint for a type}. - * Use {@link #INVOKE_DECLARED_FIELDS} if getting/setting field values is required. + * A category that represents reflective field access on + * {@linkplain Class#getDeclaredFields() declared fields}: all fields defined by the + * class but not inherited fields. + * @deprecated in favor of @link #INVOKE_DECLARED_FIELDS} with similar semantics. * @see Class#getDeclaredFields() + * @see Field#get(Object) + * @see Field#set(Object, Object) */ @Deprecated(since = "7.0", forRemoval = true) DECLARED_FIELDS, diff --git a/spring-core/src/main/java/org/springframework/aot/hint/ReflectionHints.java b/spring-core/src/main/java/org/springframework/aot/hint/ReflectionHints.java index e66aaec411..2a6ba90aaa 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/ReflectionHints.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/ReflectionHints.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2023 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -198,8 +198,8 @@ public class ReflectionHints { } /** - * Register the need for reflection on the specified {@link Field}. - * @param field the field that requires reflection + * Register the need for reflective field access on the specified {@link Field}. + * @param field the field that requires reflective access * @return {@code this}, to facilitate method chaining */ public ReflectionHints registerField(Field field) { 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 4502e502f5..b23f8d8355 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 @@ -180,9 +180,11 @@ public final class TypeHint implements ConditionalHint { } /** - * Register the need for reflection on the field with the specified name. + * Register the need for reflective access on the field with the specified name. * @param name the name of the field * @return {@code this}, to facilitate method chaining + * @see java.lang.reflect.Field#get(Object) + * @see java.lang.reflect.Field#set(Object, Object) */ public Builder withField(String name) { this.fields.add(name); diff --git a/spring-core/src/main/java/org/springframework/aot/hint/predicate/ReflectionHintsPredicates.java b/spring-core/src/main/java/org/springframework/aot/hint/predicate/ReflectionHintsPredicates.java index 5dd427af89..6b9f6541c6 100644 --- a/spring-core/src/main/java/org/springframework/aot/hint/predicate/ReflectionHintsPredicates.java +++ b/spring-core/src/main/java/org/springframework/aot/hint/predicate/ReflectionHintsPredicates.java @@ -290,9 +290,7 @@ public class ReflectionHintsPredicates { } /** - * Return a predicate that checks whether a reflection hint is registered for the given field. - * By default, unsafe or write access is not considered. - *

The returned type exposes additional methods that refine the predicate behavior. + * Return a predicate that checks whether a reflective field access hint is registered for the given field. * @param field the field * @return the {@link RuntimeHints} predicate * @deprecated since 7.0 in favor of {@link #onFieldInvocation(Field)}