Browse Source

BridgeMethodResolver properly resolves all declared interfaces

Issue: SPR-16288
pull/1610/merge
Juergen Hoeller 8 years ago
parent
commit
69c882cfbc
  1. 7
      spring-core/src/main/java/org/springframework/core/BridgeMethodResolver.java
  2. 16
      spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java

7
spring-core/src/main/java/org/springframework/core/BridgeMethodResolver.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -192,7 +192,10 @@ public abstract class BridgeMethodResolver { @@ -192,7 +192,10 @@ public abstract class BridgeMethodResolver {
return method;
}
else {
return searchInterfaces(ifc.getInterfaces(), bridgeMethod);
method = searchInterfaces(ifc.getInterfaces(), bridgeMethod);
if (method != null) {
return method;
}
}
}
return null;

16
spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -782,7 +782,7 @@ public class BridgeMethodResolverTests { @@ -782,7 +782,7 @@ public class BridgeMethodResolverTests {
}
@SuppressWarnings({ "unused", "unchecked" })
@SuppressWarnings({"unused", "unchecked"})
public static abstract class GenericEventBroadcasterImpl<T extends Event>
extends GenericBroadcasterImpl implements EventBroadcaster {
@ -847,10 +847,10 @@ public class BridgeMethodResolverTests { @@ -847,10 +847,10 @@ public class BridgeMethodResolverTests {
}
@SuppressWarnings("unchecked")
public static class MessageBroadcasterImpl extends
GenericEventBroadcasterImpl<MessageEvent>
implements MessageBroadcaster {
@SuppressWarnings({"serial", "unchecked"})
public static class MessageBroadcasterImpl extends GenericEventBroadcasterImpl<MessageEvent>
implements Serializable, // implement an unrelated interface first (SPR-16288)
MessageBroadcaster {
public MessageBroadcasterImpl() {
super(NewMessageEvent.class);
@ -1005,8 +1005,8 @@ public class BridgeMethodResolverTests { @@ -1005,8 +1005,8 @@ public class BridgeMethodResolverTests {
}
public static class HibernateRepositoryRegistry extends
SettableRepositoryRegistry<GenericHibernateRepository<?, ?>> {
public static class HibernateRepositoryRegistry
extends SettableRepositoryRegistry<GenericHibernateRepository<?, ?>> {
@Override
public void injectInto(GenericHibernateRepository<?, ?> rep) {

Loading…
Cancel
Save