From c45b501ed8af66843be84624dc2b8c8dc413b08a Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Thu, 28 Jul 2022 02:48:19 +0200 Subject: [PATCH] sad because java reflection is more protected :C --- .../main/java/fr/pandacube/lib/reflect/ReflectClass.java | 3 +++ .../main/java/fr/pandacube/lib/reflect/ReflectField.java | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectClass.java b/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectClass.java index 74ed707..1b24fe5 100644 --- a/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectClass.java +++ b/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectClass.java @@ -140,7 +140,10 @@ public class ReflectClass { * @param name the name of the field. * @return a {@link ReflectField} wrapping the requested {@link Field}. * @throws NoSuchFieldException if the requested field doesn’t exists in the wrapped class. + * @deprecated on Java 17, does not work due to module encapsulation, it is impossible to bypass the Java reflection + * API internal filtering. */ + @Deprecated(since = "Java 17") public ReflectField filteredField(String name) throws NoSuchFieldException { return field0(name, true); } diff --git a/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectField.java b/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectField.java index 3800550..5be4842 100644 --- a/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectField.java +++ b/pandalib-reflect/src/main/java/fr/pandacube/lib/reflect/ReflectField.java @@ -27,7 +27,11 @@ public final class ReflectField extends ReflectMember