mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 08:24:13 +00:00
Catch InaccessibleObjectException next to IllegalAccessException
Closes gh-35190
This commit is contained in:
+2
-1
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.aop.aspectj;
|
||||
|
||||
import java.lang.reflect.InaccessibleObjectException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
import org.springframework.aop.framework.AopConfigException;
|
||||
@@ -66,7 +67,7 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
|
||||
throw new AopConfigException(
|
||||
"Unable to instantiate aspect class: " + this.aspectClass.getName(), ex);
|
||||
}
|
||||
catch (IllegalAccessException ex) {
|
||||
catch (IllegalAccessException | InaccessibleObjectException ex) {
|
||||
throw new AopConfigException(
|
||||
"Could not access aspect constructor: " + this.aspectClass.getName(), ex);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.aop.support;
|
||||
|
||||
import java.lang.reflect.InaccessibleObjectException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
@@ -367,7 +368,7 @@ public abstract class AopUtils {
|
||||
throw new AopInvocationException("AOP configuration seems to be invalid: tried calling method [" +
|
||||
method + "] on target [" + target + "]", ex);
|
||||
}
|
||||
catch (IllegalAccessException ex) {
|
||||
catch (IllegalAccessException | InaccessibleObjectException ex) {
|
||||
throw new AopInvocationException("Could not access method [" + method + "]", ex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user