From e15d7a78cd04e03965082f082817a7eaf3179555 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Mon, 18 Aug 2008 13:13:18 +0000 Subject: [PATCH] SEC-956: Remove MapBasedMethodDefinitionSource.lookupAttributes http://jira.springframework.org/browse/SEC-956. Done. --- .../MapBasedMethodDefinitionSource.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/core/src/main/java/org/springframework/security/intercept/method/MapBasedMethodDefinitionSource.java b/core/src/main/java/org/springframework/security/intercept/method/MapBasedMethodDefinitionSource.java index 48f60260e0..bc0a68f1d7 100644 --- a/core/src/main/java/org/springframework/security/intercept/method/MapBasedMethodDefinitionSource.java +++ b/core/src/main/java/org/springframework/security/intercept/method/MapBasedMethodDefinitionSource.java @@ -236,45 +236,6 @@ public class MapBasedMethodDefinitionSource extends AbstractFallbackMethodDefini || (mappedName.startsWith("*") && methodName.endsWith(mappedName.substring(1, mappedName.length()))); } - protected ConfigAttributeDefinition lookupAttributes(Method method) { - List attributesToReturn = new ArrayList(); - - // Add attributes explicitly defined for this method invocation - merge(attributesToReturn, (ConfigAttributeDefinition) this.methodMap.get(method)); - - // Add attributes explicitly defined for this method invocation's interfaces - Class[] interfaces = method.getDeclaringClass().getInterfaces(); - - for (int i = 0; i < interfaces.length; i++) { - Class clazz = interfaces[i]; - - try { - // Look for the method on the current interface - Method interfaceMethod = clazz.getDeclaredMethod(method.getName(), (Class[]) method.getParameterTypes()); - ConfigAttributeDefinition interfaceAssigned = - (ConfigAttributeDefinition) this.methodMap.get(interfaceMethod); - merge(attributesToReturn, interfaceAssigned); - } catch (Exception e) { - // skip this interface - } - } - - // Return null if empty, as per abstract superclass contract - if (attributesToReturn.size() == 0) { - return null; - } - - return new ConfigAttributeDefinition(attributesToReturn); - } - - private void merge(List attributes, ConfigAttributeDefinition toMerge) { - if (toMerge == null) { - return; - } - - attributes.addAll(toMerge.getConfigAttributes()); - } - public void setBeanClassLoader(ClassLoader beanClassLoader) { Assert.notNull(beanClassLoader, "Bean class loader required"); this.beanClassLoader = beanClassLoader;