Skip to content

Commit

Permalink
BridgeMethodResolver properly handles bridge methods in interfaces
Browse files Browse the repository at this point in the history
Issue: SPR-9330
  • Loading branch information
jhoeller committed Jan 18, 2013
1 parent ed952cc commit 8c9383d
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,6 @@
import java.util.List;
import java.util.Map;

import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import org.springframework.util.ReflectionUtils;

Expand Down Expand Up @@ -145,7 +144,7 @@ static boolean isBridgeMethodFor(Method bridgeMethod, Method candidateMethod, Ma
private static Method findGenericDeclaration(Method bridgeMethod) {
// Search parent types for method that has same signature as bridge.
Class superclass = bridgeMethod.getDeclaringClass().getSuperclass();
while (!Object.class.equals(superclass)) {
while (superclass != null && !Object.class.equals(superclass)) {
Method method = searchForMatch(superclass, bridgeMethod);
if (method != null && !method.isBridge()) {
return method;
Expand Down Expand Up @@ -219,8 +218,6 @@ private static Method searchForMatch(Class type, Method bridgeMethod) {
* @return whether signatures match as described
*/
public static boolean isVisibilityBridgeMethodPair(Method bridgeMethod, Method bridgedMethod) {
Assert.isTrue(bridgeMethod != null);
Assert.isTrue(bridgedMethod != null);
if (bridgeMethod == bridgedMethod) {
return true;
}
Expand Down

0 comments on commit 8c9383d

Please sign in to comment.