Skip to content

Commit 5c77c37

Browse files
committed
Find destroy methods in superclass interfaces
Related tests will be added in https://github.com/spring-projects/spring-aot-smoke-tests. Closes gh-32006
1 parent ee04442 commit 5c77c37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2023 the original author or authors.
2+
* Copyright 2002-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -272,7 +272,7 @@ private Method determineDestroyMethod(String destroyMethodName) {
272272
if (destroyMethod != null) {
273273
return destroyMethod;
274274
}
275-
for (Class<?> beanInterface : beanClass.getInterfaces()) {
275+
for (Class<?> beanInterface : ClassUtils.getAllInterfacesForClass(beanClass)) {
276276
destroyMethod = findDestroyMethod(beanInterface, methodName);
277277
if (destroyMethod != null) {
278278
return destroyMethod;

0 commit comments

Comments
 (0)