|
|
|
|
@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@@ -38,6 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|
|
|
|
* @author Rob Harrop |
|
|
|
|
* @author Juergen Hoeller |
|
|
|
|
* @author Chris Beams |
|
|
|
|
* @author Yanming Zhou |
|
|
|
|
*/ |
|
|
|
|
@SuppressWarnings("rawtypes") |
|
|
|
|
class BridgeMethodResolverTests { |
|
|
|
|
@ -97,6 +98,13 @@ class BridgeMethodResolverTests {
@@ -97,6 +98,13 @@ class BridgeMethodResolverTests {
|
|
|
|
|
assertThat(bridgedMethod.getParameterTypes()[0]).isEqualTo(Date.class); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void findBridgedMethodFromOriginalMethodNotInHierarchy() throws Exception { |
|
|
|
|
Method originalMethod = Adder.class.getMethod("add", Object.class); |
|
|
|
|
Method mostSpecificMethod = BridgeMethodResolver.getMostSpecificMethod(originalMethod, FakeAdder.class); |
|
|
|
|
assertThat(mostSpecificMethod).isSameAs(originalMethod); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void isBridgeMethodFor() throws Exception { |
|
|
|
|
Method bridged = MyBar.class.getDeclaredMethod("someMethod", String.class, Object.class); |
|
|
|
|
@ -406,6 +414,13 @@ class BridgeMethodResolverTests {
@@ -406,6 +414,13 @@ class BridgeMethodResolverTests {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class FakeAdder { |
|
|
|
|
|
|
|
|
|
public void add(Date date) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static class Enclosing<T> { |
|
|
|
|
|
|
|
|
|
public class Enclosed<S> { |
|
|
|
|
|