mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-15 23:03:32 +00:00
SEC-1295: Placing Security on Roo Aspected method fails. Added suggested fix - check for null target and use Signature.declaredType instead.
This commit is contained in:
parent
7e0c7ffc0e
commit
8a0f69b955
@ -55,7 +55,14 @@ public abstract class AbstractMethodSecurityMetadataSource implements MethodSecu
|
||||
|
||||
if (object instanceof JoinPoint) {
|
||||
JoinPoint jp = (JoinPoint) object;
|
||||
Class<?> targetClass = jp.getTarget().getClass();
|
||||
Class<?> targetClass;
|
||||
|
||||
if (jp.getTarget() != null) {
|
||||
targetClass = jp.getTarget().getClass();
|
||||
} else {
|
||||
// SEC-1295: target may be null if an ITD is in use
|
||||
targetClass = jp.getSignature().getDeclaringType();
|
||||
}
|
||||
String targetMethodName = jp.getStaticPart().getSignature().getName();
|
||||
Class<?>[] types = ((CodeSignature) jp.getStaticPart().getSignature()).getParameterTypes();
|
||||
Class<?> declaringType = ((CodeSignature) jp.getStaticPart().getSignature()).getDeclaringType();
|
||||
|
Loading…
x
Reference in New Issue
Block a user