diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AdviceMode.java b/spring-context/src/main/java/org/springframework/context/annotation/AdviceMode.java index c75a52c9e6..5f088533fb 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AdviceMode.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AdviceMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ package org.springframework.context.annotation; /** - * Enumeration used to determine whether JDK proxy-based or AspectJ weaving-based advice - * should be applied. + * Enumeration used to determine whether JDK proxy-based or + * AspectJ weaving-based advice should be applied. * * @author Chris Beams * @since 3.1 @@ -28,8 +28,14 @@ package org.springframework.context.annotation; */ public enum AdviceMode { + /** + * JDK proxy-based advice. + */ PROXY, + /** + * AspectJ weaving-based advice. + */ ASPECTJ } diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java b/spring-context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java index e031c1ed8a..4042e17050 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AdviceModeImportSelector.java @@ -70,14 +70,14 @@ public abstract class AdviceModeImportSelector implements AnnotationAttributes attributes = AnnotationConfigUtils.attributesFor(importingClassMetadata, annType); if (attributes == null) { throw new IllegalArgumentException(String.format( - "@%s is not present on importing class '%s' as expected", - annType.getSimpleName(), importingClassMetadata.getClassName())); + "@%s is not present on importing class '%s' as expected", + annType.getSimpleName(), importingClassMetadata.getClassName())); } - AdviceMode adviceMode = attributes.getEnum(this.getAdviceModeAttributeName()); + AdviceMode adviceMode = attributes.getEnum(getAdviceModeAttributeName()); String[] imports = selectImports(adviceMode); if (imports == null) { - throw new IllegalArgumentException(String.format("Unknown AdviceMode: '%s'", adviceMode)); + throw new IllegalArgumentException("Unknown AdviceMode: " + adviceMode); } return imports; }