From d9c1811d21b421976fa50576b0f30f751056ebb1 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 5 Nov 2018 22:59:18 +0100 Subject: [PATCH] Deprecate NON_BRIDGED_METHODS constant as of 5.0.11 as well Issue: SPR-17464 --- .../springframework/util/ReflectionUtils.java | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java index 68a6ce5468..abd423c12f 100644 --- a/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java +++ b/spring-core/src/main/java/org/springframework/util/ReflectionUtils.java @@ -48,14 +48,21 @@ import org.springframework.lang.Nullable; public abstract class ReflectionUtils { /** - * Naming prefix for CGLIB-renamed methods. - * @see #isCglibRenamedMethod + * Pre-built MethodFilter that matches all non-bridge methods. + * @since 3.0 + * @deprecated as of 5.0.11, in favor of a custom {@link MethodFilter} */ - private static final String CGLIB_RENAMED_METHOD_PREFIX = "CGLIB$"; - - private static final Method[] NO_METHODS = {}; + @Deprecated + public static final MethodFilter NON_BRIDGED_METHODS = + (method -> !method.isBridge()); - private static final Field[] NO_FIELDS = {}; + /** + * Pre-built MethodFilter that matches all non-bridge non-synthetic methods + * which are not declared on {@code java.lang.Object}. + * @since 3.0.5 + */ + public static final MethodFilter USER_DECLARED_METHODS = + (method -> (!method.isBridge() && !method.isSynthetic() && method.getDeclaringClass() != Object.class)); /** * Pre-built FieldFilter that matches all non-static, non-final fields. @@ -65,18 +72,14 @@ public abstract class ReflectionUtils { /** - * Pre-built MethodFilter that matches all non-bridge methods. + * Naming prefix for CGLIB-renamed methods. + * @see #isCglibRenamedMethod */ - public static final MethodFilter NON_BRIDGED_METHODS = - (method -> !method.isBridge()); + private static final String CGLIB_RENAMED_METHOD_PREFIX = "CGLIB$"; + private static final Method[] NO_METHODS = {}; - /** - * Pre-built MethodFilter that matches all non-bridge non-synthetic methods - * which are not declared on {@code java.lang.Object}. - */ - public static final MethodFilter USER_DECLARED_METHODS = - (method -> (!method.isBridge() && !method.isSynthetic() && method.getDeclaringClass() != Object.class)); + private static final Field[] NO_FIELDS = {}; /** @@ -871,5 +874,4 @@ public abstract class ReflectionUtils { boolean matches(Field field); } - }