Merge branch '6.2.x'

This commit is contained in:
Brian Clozel
2025-01-21 17:27:54 +01:00
4 changed files with 18 additions and 18 deletions

View File

@@ -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,

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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.
* <p>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)}