Jelajahi Sumber

Remove SPR-11251 workaround from WebSecurityConfiguration

Fixes gh-3348
Rob Winch 9 tahun lalu
induk
melakukan
5d6e8bc3c8

+ 2 - 19
config/src/main/java/org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.java

@@ -197,7 +197,7 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
 
 	/*
 	 * (non-Javadoc)
-	 * 
+	 *
 	 * @see org.springframework.context.annotation.ImportAware#setImportMetadata(org.
 	 * springframework.core.type.AnnotationMetadata)
 	 */
@@ -206,23 +206,6 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
 				.getAnnotationAttributes(EnableWebSecurity.class.getName());
 		AnnotationAttributes enableWebSecurityAttrs = AnnotationAttributes
 				.fromMap(enableWebSecurityAttrMap);
-		if (enableWebSecurityAttrs == null) {
-			// search parent classes
-			Class<?> currentClass = ClassUtils.resolveClassName(
-					importMetadata.getClassName(), beanClassLoader);
-			for (Class<?> classToInspect = currentClass; classToInspect != null; classToInspect = classToInspect
-					.getSuperclass()) {
-				EnableWebSecurity enableWebSecurityAnnotation = AnnotationUtils
-						.findAnnotation(classToInspect, EnableWebSecurity.class);
-				if (enableWebSecurityAnnotation == null) {
-					continue;
-				}
-				enableWebSecurityAttrMap = AnnotationUtils
-						.getAnnotationAttributes(enableWebSecurityAnnotation);
-				enableWebSecurityAttrs = AnnotationAttributes
-						.fromMap(enableWebSecurityAttrMap);
-			}
-		}
 		debugEnabled = enableWebSecurityAttrs.getBoolean("debug");
 		if (webSecurity != null) {
 			webSecurity.debug(debugEnabled);
@@ -231,7 +214,7 @@ public class WebSecurityConfiguration implements ImportAware, BeanClassLoaderAwa
 
 	/*
 	 * (non-Javadoc)
-	 * 
+	 *
 	 * @see
 	 * org.springframework.beans.factory.BeanClassLoaderAware#setBeanClassLoader(java.
 	 * lang.ClassLoader)