Skip to content

Commit d9c1811

Browse files
committed
Deprecate NON_BRIDGED_METHODS constant as of 5.0.11 as well
Issue: SPR-17464
1 parent 5e7a8b2 commit d9c1811

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

spring-core/src/main/java/org/springframework/util/ReflectionUtils.java

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,21 @@
4848
public abstract class ReflectionUtils {
4949

5050
/**
51-
* Naming prefix for CGLIB-renamed methods.
52-
* @see #isCglibRenamedMethod
51+
* Pre-built MethodFilter that matches all non-bridge methods.
52+
* @since 3.0
53+
* @deprecated as of 5.0.11, in favor of a custom {@link MethodFilter}
5354
*/
54-
private static final String CGLIB_RENAMED_METHOD_PREFIX = "CGLIB$";
55-
56-
private static final Method[] NO_METHODS = {};
55+
@Deprecated
56+
public static final MethodFilter NON_BRIDGED_METHODS =
57+
(method -> !method.isBridge());
5758

58-
private static final Field[] NO_FIELDS = {};
59+
/**
60+
* Pre-built MethodFilter that matches all non-bridge non-synthetic methods
61+
* which are not declared on {@code java.lang.Object}.
62+
* @since 3.0.5
63+
*/
64+
public static final MethodFilter USER_DECLARED_METHODS =
65+
(method -> (!method.isBridge() && !method.isSynthetic() && method.getDeclaringClass() != Object.class));
5966

6067
/**
6168
* Pre-built FieldFilter that matches all non-static, non-final fields.
@@ -65,18 +72,14 @@ public abstract class ReflectionUtils {
6572

6673

6774
/**
68-
* Pre-built MethodFilter that matches all non-bridge methods.
75+
* Naming prefix for CGLIB-renamed methods.
76+
* @see #isCglibRenamedMethod
6977
*/
70-
public static final MethodFilter NON_BRIDGED_METHODS =
71-
(method -> !method.isBridge());
78+
private static final String CGLIB_RENAMED_METHOD_PREFIX = "CGLIB$";
7279

80+
private static final Method[] NO_METHODS = {};
7381

74-
/**
75-
* Pre-built MethodFilter that matches all non-bridge non-synthetic methods
76-
* which are not declared on {@code java.lang.Object}.
77-
*/
78-
public static final MethodFilter USER_DECLARED_METHODS =
79-
(method -> (!method.isBridge() && !method.isSynthetic() && method.getDeclaringClass() != Object.class));
82+
private static final Field[] NO_FIELDS = {};
8083

8184

8285
/**
@@ -871,5 +874,4 @@ public interface FieldFilter {
871874
boolean matches(Field field);
872875
}
873876

874-
875877
}

0 commit comments

Comments
 (0)