Remove @Override from methods that override interfaces

Ensure JDK5 compatibility
This commit is contained in:
Rob Winch 2013-08-04 11:45:44 -05:00
parent 388a4dd9db
commit b13b87a1e7
12 changed files with 1 additions and 29 deletions

View File

@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
/**
* A base {@link SecurityBuilder} that ensures the object being built is only
* built one time.
*
*
* @param <O> the type of Object that is being built
*
* @author Rob Winch
@ -34,7 +34,6 @@ public abstract class AbstractSecurityBuilder<O> implements SecurityBuilder<O> {
/* (non-Javadoc)
* @see org.springframework.security.config.annotation.SecurityBuilder#build()
*/
@Override
public final O build() throws Exception {
if(building.compareAndSet(false, true)) {
object = doBuild();

View File

@ -44,7 +44,6 @@ public interface ObjectPostProcessor<T> {
* A do nothing implementation of the {@link ObjectPostProcessor}
*/
ObjectPostProcessor<Object> QUIESCENT_POSTPROCESSOR = new ObjectPostProcessor<Object>() {
@Override
public <T> T postProcess(T object) {
return object;
}

View File

@ -38,10 +38,8 @@ public abstract class SecurityConfigurerAdapter<O,B extends SecurityBuilder<O>>
private CompositeObjectPostProcessor objectPostProcessor = new CompositeObjectPostProcessor();
@Override
public void init(B builder) throws Exception {}
@Override
public void configure(B builder) throws Exception {}
/**
@ -110,7 +108,6 @@ public abstract class SecurityConfigurerAdapter<O,B extends SecurityBuilder<O>>
private static final class CompositeObjectPostProcessor implements ObjectPostProcessor<Object> {
private List<ObjectPostProcessor<? extends Object>> postProcessors = new ArrayList<ObjectPostProcessor<?>>();
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public Object postProcess(Object object) {
for(ObjectPostProcessor opp : postProcessors) {

View File

@ -51,7 +51,6 @@ final class AutowireBeanFactoryObjectPostProcessor implements ObjectPostProcesso
* @see org.springframework.security.config.annotation.web.Initializer#initialize(java.lang.Object)
*/
@SuppressWarnings("unchecked")
@Override
public <T> T postProcess(T object) {
T result = (T) autowireBeanFactory.initializeBean(object, null);
if(result instanceof DisposableBean) {
@ -63,7 +62,6 @@ final class AutowireBeanFactoryObjectPostProcessor implements ObjectPostProcesso
/* (non-Javadoc)
* @see org.springframework.beans.factory.DisposableBean#destroy()
*/
@Override
public void destroy() throws Exception {
for(DisposableBean disposable : disposableBeans) {
try {

View File

@ -46,7 +46,6 @@ class GlobalMethodSecurityAspectJAutoProxyRegistrar implements
* the value of the @{@link EnableGlobalMethodSecurity#proxyTargetClass()}
* attribute on the importing {@code @Configuration} class.
*/
@Override
public void registerBeanDefinitions(
AnnotationMetadata importingClassMetadata,
BeanDefinitionRegistry registry) {

View File

@ -80,7 +80,6 @@ public class GlobalMethodSecurityConfiguration implements ImportAware {
private static final Log logger = LogFactory.getLog(GlobalMethodSecurityConfiguration.class);
private ApplicationContext context;
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<Object>() {
@Override
public <T> T postProcess(T object) {
throw new IllegalStateException(ObjectPostProcessor.class.getName()+ " is a required bean. Ensure you have used @"+EnableGlobalMethodSecurity.class.getName());
}
@ -337,7 +336,6 @@ public class GlobalMethodSecurityConfiguration implements ImportAware {
/**
* Obtains the attributes from {@link EnableGlobalMethodSecurity} if this class was imported using the {@link EnableGlobalMethodSecurity} annotation.
*/
@Override
public final void setImportMetadata(AnnotationMetadata importMetadata) {
Map<String, Object> annotationAttributes = importMetadata
.getAnnotationAttributes(EnableGlobalMethodSecurity.class

View File

@ -34,7 +34,6 @@ import org.springframework.util.ClassUtils;
*/
final class GlobalMethodSecuritySelector implements ImportSelector {
@Override
public final String[] selectImports(AnnotationMetadata importingClassMetadata) {
Class<EnableGlobalMethodSecurity> annoType = EnableGlobalMethodSecurity.class;
Map<String, Object> annotationAttributes = importingClassMetadata.getAnnotationAttributes(annoType.getName(), false);

View File

@ -110,7 +110,6 @@ final class FilterComparator implements Comparator<Filter>, Serializable {
put(SwitchUserFilter.class, order);
}
@Override
public int compare(Filter lhs, Filter rhs) {
Integer left = getOrder(lhs.getClass());
Integer right = getOrder(rhs.getClass());

View File

@ -984,7 +984,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
/* (non-Javadoc)
* @see org.springframework.security.config.annotation.web.HttpBuilder#authenticationProvider(org.springframework.security.authentication.AuthenticationProvider)
*/
@Override
public HttpSecurity authenticationProvider(AuthenticationProvider authenticationProvider) {
getAuthenticationRegistry().authenticationProvider(authenticationProvider);
return this;
@ -993,7 +992,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
/* (non-Javadoc)
* @see org.springframework.security.config.annotation.web.HttpBuilder#userDetailsService(org.springframework.security.core.userdetails.UserDetailsService)
*/
@Override
public HttpSecurity userDetailsService(UserDetailsService userDetailsService) throws Exception {
getAuthenticationRegistry().userDetailsService(userDetailsService);
return this;
@ -1006,7 +1004,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
/* (non-Javadoc)
* @see org.springframework.security.config.annotation.web.HttpBuilder#addFilterAfter(javax.servlet.Filter, java.lang.Class)
*/
@Override
public HttpSecurity addFilterAfter(Filter filter, Class<? extends Filter> afterFilter) {
comparitor.registerAfter(filter.getClass(), afterFilter);
return addFilter(filter);
@ -1015,7 +1012,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
/* (non-Javadoc)
* @see org.springframework.security.config.annotation.web.HttpBuilder#addFilterBefore(javax.servlet.Filter, java.lang.Class)
*/
@Override
public HttpSecurity addFilterBefore(Filter filter, Class<? extends Filter> beforeFilter) {
comparitor.registerBefore(filter.getClass(), beforeFilter);
return addFilter(filter);
@ -1024,7 +1020,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
/* (non-Javadoc)
* @see org.springframework.security.config.annotation.web.HttpBuilder#addFilter(javax.servlet.Filter)
*/
@Override
public HttpSecurity addFilter(Filter filter) {
Class<? extends Filter> filterClass = filter.getClass();
if(!comparitor.isRegistered(filterClass)) {
@ -1219,7 +1214,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
* (non-Javadoc)
* @see org.springframework.security.config.annotation.web.HttpBuilder#getAuthenticationManager()
*/
@Override
public AuthenticationManager getAuthenticationManager() {
return authenticationManager;
}
@ -1281,7 +1275,6 @@ public final class HttpSecurity extends AbstractConfiguredSecurityBuilder<Defaul
this.requestMatchers = requestMatchers;
}
@Override
public boolean matches(HttpServletRequest request) {
for(RequestMatcher matcher : requestMatchers) {
if(matcher.matches(request)) {

View File

@ -158,7 +158,6 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
/* (non-Javadoc)
* @see org.springframework.context.annotation.ImportAware#setImportMetadata(org.springframework.core.type.AnnotationMetadata)
*/
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
Map<String, Object> enableWebSecurityAttrMap = importMetadata.getAnnotationAttributes(EnableWebSecurity.class.getName());
AnnotationAttributes enableWebSecurityAttrs = AnnotationAttributes.fromMap(enableWebSecurityAttrMap);
@ -182,7 +181,6 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
/* (non-Javadoc)
* @see org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.lang.ClassLoader)
*/
@Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = classLoader;
}

View File

@ -59,7 +59,6 @@ public abstract class WebSecurityConfigurerAdapter implements SecurityConfigurer
private ContentNegotiationStrategy contentNegotiationStrategy = new HeaderContentNegotiationStrategy();
private ObjectPostProcessor<Object> objectPostProcessor = new ObjectPostProcessor<Object>() {
@Override
public <T> T postProcess(T object) {
throw new IllegalStateException(ObjectPostProcessor.class.getName()+ " is a required bean. Ensure you have used @EnableWebSecurity and @Configuration");
}
@ -258,13 +257,11 @@ public abstract class WebSecurityConfigurerAdapter implements SecurityConfigurer
return parentAuthenticationBuilder.getDefaultUserDetailsService();
}
@Override
public void init(final WebSecurity web) throws Exception {
final HttpSecurity http = getHttp();
web
.addSecurityFilterChainBuilder(http)
.postBuildAction(new Runnable() {
@Override
public void run() {
FilterSecurityInterceptor securityInterceptor = http.getSharedObject(FilterSecurityInterceptor.class);
web.securityInterceptor(securityInterceptor);
@ -276,7 +273,6 @@ public abstract class WebSecurityConfigurerAdapter implements SecurityConfigurer
* Override this method to configure {@link WebSecurity}. For
* example, if you wish to ignore certain requests.
*/
@Override
public void configure(WebSecurity web) throws Exception {
}
@ -342,7 +338,6 @@ public abstract class WebSecurityConfigurerAdapter implements SecurityConfigurer
this.delegateBuilder = authentication;
}
@Override
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
if(delegate != null) {
return delegate.loadUserByUsername(username);
@ -377,7 +372,6 @@ public abstract class WebSecurityConfigurerAdapter implements SecurityConfigurer
this.delegateBuilder = authentication;
}
@Override
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
if(delegate != null) {
return delegate.authenticate(authentication);

View File

@ -37,7 +37,6 @@ public class ObjectPostProcessorTests {
class ListToLinkedListObjectPostProcessor implements ObjectPostProcessor<List<?>>{
@Override
public <O extends List<?>> O postProcess(O l) {
return (O) new LinkedList(l);
}