Browse Source

Find destroy methods in superclass interfaces

Related tests will be added in
https://github.com/spring-projects/spring-aot-smoke-tests.

Closes gh-32017
pull/32145/head
Sébastien Deleuze 2 years ago
parent
commit
338922f03d
  1. 4
      spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java

4
spring-beans/src/main/java/org/springframework/beans/factory/support/DisposableBeanAdapter.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-2024 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.
@ -261,7 +261,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable { @@ -261,7 +261,7 @@ class DisposableBeanAdapter implements DisposableBean, Runnable, Serializable {
if (destroyMethod != null) {
return destroyMethod;
}
for (Class<?> beanInterface : beanClass.getInterfaces()) {
for (Class<?> beanInterface : ClassUtils.getAllInterfacesForClass(beanClass)) {
destroyMethod = findDestroyMethod(beanInterface, methodName);
if (destroyMethod != null) {
return destroyMethod;

Loading…
Cancel
Save