bridge Methods to the
Method being bridged.
Given a synthetic bridge Method returns the Method
being bridged. A bridge method may be created by the compiler when extending a
parameterized type whose methods have parameterized arguments. During runtime
invocation the bridge Method may be invoked and/or used via reflection.
When attempting to locate annotations on Methods, it is wise to check
for bridge Methods as appropriate and find the bridged Method.
See The Java Language Specification for more details on the use of bridge methods.
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Method | Returns: the original method (either the bridged method or the passed-in method if no more specific one could be found)the method to introspect against its declaring class bridgeMethod)Find the local original method for the supplied |
| private static Method | findGenericDeclaration(Method bridgeMethod)
Searches for the generic |
| public static Method | Returns: the original method (either the bridged method or the passed-in method if no more specific one could be found)the method to introspect against the given target class bridgeMethod, Class<?> the target class to find methods on targetClass)Determine the most specific method for the supplied |
| private static boolean | isBridgedCandidateFor(Method candidateMethod, Method bridgeMethod)
Returns |
| pack-priv static boolean | |
| private static boolean | isResolvedTypeMatch(Method genericMethod, Method candidateMethod, Class<?> declaringClass)
Returns |
| public static boolean | Returns: whether signatures match as describedCompare the signatures of the bridge method and the method which it bridges. |
| private static Method | |
| private static Method | Returns: the bridged method, ornull if none foundthe List of candidate Methods candidateMethods, Method the bridge method bridgeMethod)Searches for the bridged method in the given candidates. |
| private static Method | |
| private static Method |
| cache | back to summary |
|---|---|
| private static final Map<Object, Method> cache | |
| BridgeMethodResolver | back to summary |
|---|---|
| private BridgeMethodResolver() | |
| findBridgedMethod | back to summary |
|---|---|
| public static Method findBridgedMethod(Method bridgeMethod) Find the local original method for the supplied It is safe to call this method passing in a non-bridge
| |
| findGenericDeclaration | back to summary |
|---|---|
| private static Method findGenericDeclaration(Method bridgeMethod) Searches for the generic
| |
| getMostSpecificMethod | back to summary |
|---|---|
| public static Method getMostSpecificMethod(Method bridgeMethod, Class<?> targetClass) Determine the most specific method for the supplied This is effectively a combination of
| |
| isBridgedCandidateFor | back to summary |
|---|---|
| private static boolean isBridgedCandidateFor(Method candidateMethod, Method bridgeMethod) Returns | |
| isBridgeMethodFor | back to summary |
|---|---|
| pack-priv static boolean isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Class<?> declaringClass) Determines whether the bridge | |
| isResolvedTypeMatch | back to summary |
|---|---|
| private static boolean isResolvedTypeMatch(Method genericMethod, Method candidateMethod, Class<?> declaringClass) Returns | |
| isVisibilityBridgeMethodPair | back to summary |
|---|---|
| public static boolean isVisibilityBridgeMethodPair(Method bridgeMethod, Method bridgedMethod) Compare the signatures of the bridge method and the method which it bridges. If the parameter and return types are the same, it is a 'visibility' bridge method introduced in Java 6 to fix https://bugs.openjdk.org/browse/JDK-6342411. See also https://stas-blogspot.blogspot.com/2010/03/java-bridge-methods-explained.html
| |
| resolveBridgeMethod | back to summary |
|---|---|
| private static Method resolveBridgeMethod(Method bridgeMethod, Class<?> targetClass) | |
| searchCandidates | back to summary |
|---|---|
| private static Method searchCandidates(List<Method> candidateMethods, Method bridgeMethod) Searches for the bridged method in the given candidates. | |
| searchForMatch | back to summary |
|---|---|
| private static Method searchForMatch(Class<?> type, Method bridgeMethod) If the supplied
| |
| searchInterfaces | back to summary |
|---|---|
private static Method searchInterfaces(Class<?>[] interfaces, Method bridgeMethod)
| |