Skip to content

Commit 338922f

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-32017
1 parent fad857e commit 338922f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: 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.
@@ -261,7 +261,7 @@ private Method determineDestroyMethod(String destroyMethodName) {
261261
if (destroyMethod != null) {
262262
return destroyMethod;
263263
}
264-
for (Class<?> beanInterface : beanClass.getInterfaces()) {
264+
for (Class<?> beanInterface : ClassUtils.getAllInterfacesForClass(beanClass)) {
265265
destroyMethod = findDestroyMethod(beanInterface, methodName);
266266
if (destroyMethod != null) {
267267
return destroyMethod;

0 commit comments

Comments
 (0)