---
title: "什么是Method.isBridge方法"
author: "sunflowers"
date: "2010-11-18T14:22:10Z"
tags: []
categories: ["编程语言"]
slug: "method-isbridge"
draft: false
lastmod: "2010-11-18T14:22:10Z"
id: 815011
url: "https://sunflowers.iteye.com/blog/815011"
---

什么是Method.isBridge方法：

 

 

 

Helper for resolving synthetic [`bridge Methods`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html#isBridge%28%29 "class or interface in java.lang.reflect") to the [`Method`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html "class or interface in java.lang.reflect") being bridged.

Given a synthetic [`bridge Method`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html#isBridge%28%29 "class or interface in java.lang.reflect") returns the [`Method`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html "class or interface in java.lang.reflect") 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`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html "class or interface in java.lang.reflect") may be invoked and/or used via reflection. When attempting to locate annotations on [`Methods`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html "class or interface in java.lang.reflect"), it is wise to check for bridge [`Methods`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html "class or interface in java.lang.reflect") as appropriate and find the bridged [`Method`](http://java.sun.com/j2se/1.5.0/docs/api/java/lang/reflect/Method.html "class or interface in java.lang.reflect").

See [The Java Language Specification](http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.12.4.5) for more details on the use of bridge methods.

Only usable on JDK 1.5 and higher. Use an appropriate [`JdkVersion`](http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/core/JdkVersion.html "class in org.springframework.core") check before calling this class, if a fallback for JDK 1.3/1.4 is desirable.

 

原文 [http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/core/BridgeMethodResolver.html](http://static.springsource.org/spring/docs/2.0.x/api/org/springframework/core/BridgeMethodResolver.html)