Remove unused inner class in MethodSecurityMetadataSourceAdvisor

This commit is contained in:
Luke Taylor 2010-03-11 01:50:55 +00:00
parent 55de2cfcb1
commit c09cd3a9cb
2 changed files with 0 additions and 77 deletions

View File

@ -18,11 +18,9 @@ package org.springframework.security.access.intercept.aopalliance;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.Serializable;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Method;
import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.AbstractPointcutAdvisor;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
@ -129,44 +127,4 @@ public class MethodSecurityMetadataSourceAdvisor extends AbstractPointcutAdvisor
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();
}
}
}

View File

@ -74,39 +74,4 @@ public class MethodSecurityMetadataSourceAdvisorTests extends TestCase {
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);
}
}
}