Remove unused inner class in MethodSecurityMetadataSourceAdvisor
This commit is contained in:
parent
55de2cfcb1
commit
c09cd3a9cb
|
@ -18,11 +18,9 @@ package org.springframework.security.access.intercept.aopalliance;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.ObjectInputStream;
|
import java.io.ObjectInputStream;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.lang.reflect.AccessibleObject;
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
import org.aopalliance.aop.Advice;
|
import org.aopalliance.aop.Advice;
|
||||||
import org.aopalliance.intercept.MethodInvocation;
|
|
||||||
import org.springframework.aop.Pointcut;
|
import org.springframework.aop.Pointcut;
|
||||||
import org.springframework.aop.support.AbstractPointcutAdvisor;
|
import org.springframework.aop.support.AbstractPointcutAdvisor;
|
||||||
import org.springframework.aop.support.StaticMethodMatcherPointcut;
|
import org.springframework.aop.support.StaticMethodMatcherPointcut;
|
||||||
|
@ -129,44 +127,4 @@ public class MethodSecurityMetadataSourceAdvisor extends AbstractPointcutAdvisor
|
||||||
return attributeSource.getAttributes(m, targetClass) != null;
|
return attributeSource.getAttributes(m, targetClass) != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Represents a <code>MethodInvocation</code>.
|
|
||||||
* <p>
|
|
||||||
* Required as <code>MethodSecurityMetadataSource</code> only supports lookup of configuration attributes for
|
|
||||||
* <code>MethodInvocation</code>s.
|
|
||||||
*/
|
|
||||||
class InternalMethodInvocation implements MethodInvocation {
|
|
||||||
private Method method;
|
|
||||||
private Class<?> targetClass;
|
|
||||||
|
|
||||||
public InternalMethodInvocation(Method method, Class<?> targetClass) {
|
|
||||||
this.method = method;
|
|
||||||
this.targetClass = targetClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected InternalMethodInvocation() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object[] getArguments() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Method getMethod() {
|
|
||||||
return this.method;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AccessibleObject getStaticPart() {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object getThis() {
|
|
||||||
return this.targetClass;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Object proceed() throws Throwable {
|
|
||||||
throw new UnsupportedOperationException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,39 +74,4 @@ public class MethodSecurityMetadataSourceAdvisorTests extends TestCase {
|
||||||
assertTrue(true);
|
assertTrue(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testUnsupportedOperations() throws Throwable {
|
|
||||||
Class<TargetObject> clazz = TargetObject.class;
|
|
||||||
Method method = clazz.getMethod("countLength", new Class[] {String.class});
|
|
||||||
|
|
||||||
MethodSecurityMetadataSourceAdvisor.InternalMethodInvocation imi = new MethodSecurityMetadataSourceAdvisor(getInterceptor()).new InternalMethodInvocation(method, clazz);
|
|
||||||
|
|
||||||
try {
|
|
||||||
imi.getArguments();
|
|
||||||
fail("Should have thrown UnsupportedOperationException");
|
|
||||||
} catch (UnsupportedOperationException expected) {
|
|
||||||
assertTrue(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
imi.getStaticPart();
|
|
||||||
fail("Should have thrown UnsupportedOperationException");
|
|
||||||
} catch (UnsupportedOperationException expected) {
|
|
||||||
assertTrue(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
imi.proceed();
|
|
||||||
fail("Should have thrown UnsupportedOperationException");
|
|
||||||
} catch (UnsupportedOperationException expected) {
|
|
||||||
assertTrue(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
new MethodSecurityMetadataSourceAdvisor(getInterceptor()).new InternalMethodInvocation();
|
|
||||||
fail("Should have thrown UnsupportedOperationException");
|
|
||||||
} catch (UnsupportedOperationException expected) {
|
|
||||||
assertTrue(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue