Skip to content

Commit e9dc6be

Browse files
committed
Fix Javadoc for field reflection hints
Closes gh-34297
1 parent 6863b90 commit e9dc6be

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

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

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2024 the original author or authors.
2+
* Copyright 2002-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.
@@ -32,15 +32,19 @@
3232
public enum MemberCategory {
3333

3434
/**
35-
* A category that represents public {@linkplain Field fields}.
36-
* @see Class#getFields()
35+
* A category that represents reflective field access on public {@linkplain Field fields}.
36+
* @see Field#get(Object)
37+
* @see Field#set(Object, Object)
3738
*/
3839
PUBLIC_FIELDS,
3940

4041
/**
41-
* A category that represents {@linkplain Class#getDeclaredFields() declared
42-
* fields}: all fields defined by the class but not inherited fields.
42+
* A category that represents reflective field access on
43+
* {@linkplain Class#getDeclaredFields() declared fields}: all fields defined by the
44+
* class but not inherited fields.
4345
* @see Class#getDeclaredFields()
46+
* @see Field#get(Object)
47+
* @see Field#set(Object, Object)
4448
*/
4549
DECLARED_FIELDS,
4650

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-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.
@@ -199,8 +199,8 @@ public ReflectionHints registerForInterfaces(Class<?> type, Consumer<TypeHint.Bu
199199
}
200200

201201
/**
202-
* Register the need for reflection on the specified {@link Field}.
203-
* @param field the field that requires reflection
202+
* Register the need for reflective field access on the specified {@link Field}.
203+
* @param field the field that requires reflective access
204204
* @return {@code this}, to facilitate method chaining
205205
*/
206206
public ReflectionHints registerField(Field field) {

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,11 @@ public Builder onReachableType(Class<?> reachableType) {
182182
}
183183

184184
/**
185-
* Register the need for reflection on the field with the specified name.
185+
* Register the need for reflective access on the field with the specified name.
186186
* @param name the name of the field
187187
* @return {@code this}, to facilitate method chaining
188+
* @see java.lang.reflect.Field#get(Object)
189+
* @see java.lang.reflect.Field#set(Object, Object)
188190
*/
189191
public Builder withField(String name) {
190192
this.fields.add(name);

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

+1-3
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,7 @@ public FieldHintPredicate onField(String className, String fieldName) throws Cla
183183
}
184184

185185
/**
186-
* Return a predicate that checks whether a reflection hint is registered for the given field.
187-
* By default, unsafe or write access is not considered.
188-
* <p>The returned type exposes additional methods that refine the predicate behavior.
186+
* Return a predicate that checks whether a reflective field access hint is registered for the given field.
189187
* @param field the field
190188
* @return the {@link RuntimeHints} predicate
191189
*/

0 commit comments

Comments
 (0)