Browse Source

Polishing

pull/1904/merge
Juergen Hoeller 8 years ago
parent
commit
025fd2962e
  1. 4
      spring-context/src/main/java/org/springframework/context/annotation/AdviceMode.java
  2. 8
      spring-context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java

4
spring-context/src/main/java/org/springframework/context/annotation/AdviceMode.java

@ -17,8 +17,8 @@
package org.springframework.context.annotation; package org.springframework.context.annotation;
/** /**
* Enumeration used to determine whether JDK proxy-based or AspectJ weaving-based advice * Enumeration used to determine whether JDK proxy-based or
* should be applied. * AspectJ weaving-based advice should be applied.
* *
* @author Chris Beams * @author Chris Beams
* @since 3.1 * @since 3.1

8
spring-context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java

@ -70,14 +70,14 @@ public abstract class AdviceModeImportSelector<A extends Annotation> implements
AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(importingClassMetadata, annType); AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(importingClassMetadata, annType);
if (attributes == null) { if (attributes == null) {
throw new IllegalArgumentException(String.format( throw new IllegalArgumentException(String.format(
"@%s is not present on importing class '%s' as expected", "@%s is not present on importing class '%s' as expected",
annType.getSimpleName(), importingClassMetadata.getClassName())); annType.getSimpleName(), importingClassMetadata.getClassName()));
} }
AdviceMode adviceMode = attributes.getEnum(this.getAdviceModeAttributeName()); AdviceMode adviceMode = attributes.getEnum(getAdviceModeAttributeName());
String[] imports = selectImports(adviceMode); String[] imports = selectImports(adviceMode);
if (imports == null) { if (imports == null) {
throw new IllegalArgumentException(String.format("Unknown AdviceMode: '%s'", adviceMode)); throw new IllegalArgumentException("Unknown AdviceMode: " + adviceMode);
} }
return imports; return imports;
} }

Loading…
Cancel
Save