mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Catch InaccessibleObjectException next to IllegalAccessException
Closes gh-35190
This commit is contained in:
+1
-2
@@ -17,7 +17,6 @@
|
||||
package org.springframework.test.context.bean.override.convention;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -58,7 +57,7 @@ final class TestBeanOverrideHandler extends BeanOverrideHandler {
|
||||
ReflectionUtils.makeAccessible(this.factoryMethod);
|
||||
return this.factoryMethod.invoke(null);
|
||||
}
|
||||
catch (IllegalAccessException | InvocationTargetException ex) {
|
||||
catch (Throwable ex) {
|
||||
throw new IllegalStateException(
|
||||
"Failed to invoke @TestBean factory method: " + this.factoryMethod, ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user