diff --git a/.gitignore b/.gitignore index 5d40a5584c..c79bac7342 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ integration-repo ivy-cache jxl.log jmx.log -spring-jdbc/derby.log +derby.log spring-test/test-output/ .gradle build @@ -19,8 +19,10 @@ build argfile* pom.xml -# IDEA metadata and output dirs +# IDEA artifacts and output dirs *.iml *.ipr *.iws out +test-output +atlassian-ide-plugin.xml diff --git a/build.gradle b/build.gradle index 746a290e88..b2e7af70c6 100644 --- a/build.gradle +++ b/build.gradle @@ -16,6 +16,14 @@ configure(allprojects) { ext.slf4jVersion = "1.6.1" ext.gradleScriptDir = "${rootProject.projectDir}/gradle" + if (rootProject.hasProperty("VERSION_QUALIFIER")) { + def qualifier = rootProject.getProperty("VERSION_QUALIFIER") + if (qualifier.startsWith("SPR-")) { // topic branch, e.g. SPR-1234 + // replace 3.2.0.BUILD-SNAPSHOT for 3.2.0.SPR-1234-SNAPSHOT + version = version.replace('BUILD', qualifier) + } + } + apply plugin: "propdeps" apply plugin: "java" apply plugin: "propdeps-eclipse" @@ -24,10 +32,35 @@ configure(allprojects) { group = "org.springframework" - sourceCompatibility=1.5 - targetCompatibility=1.5 + compileJava { + sourceCompatibility=1.5 + targetCompatibility=1.5 + } + compileTestJava { + sourceCompatibility=1.7 + targetCompatibility=1.7 + } - [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"] + [compileJava, compileTestJava]*.options*.compilerArgs = [ + "-Xlint:serial", + "-Xlint:varargs", + "-Xlint:cast", + "-Xlint:classfile", + "-Xlint:dep-ann", + "-Xlint:divzero", + "-Xlint:empty", + "-Xlint:finally", + "-Xlint:overrides", + "-Xlint:path", + "-Xlint:processing", + "-Xlint:static", + "-Xlint:try", + "-Xlint:-options", // intentionally disabled + "-Xlint:-fallthrough", // intentionally disabled + "-Xlint:-rawtypes", // TODO enable and fix warnings + "-Xlint:-deprecation", // TODO enable and fix warnings + "-Xlint:-unchecked" // TODO enable and fix warnings + ] sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"] @@ -41,7 +74,7 @@ configure(allprojects) { dependencies { testCompile("junit:junit:${junitVersion}") testCompile("org.hamcrest:hamcrest-all:1.3") - testCompile("org.easymock:easymock:${easymockVersion}") + testCompile("org.mockito:mockito-core:1.9.5") } ext.javadocLinks = [ @@ -67,7 +100,17 @@ configure(allprojects) { ] as String[] } -configure(subprojects) { subproject -> +configure(allprojects.findAll{it.name in ["spring", "spring-jms", "spring-orm", + "spring-orm-hibernate4", "spring-oxm", "spring-struts", "spring-test", + "spring-test-mvc", "spring-tx", "spring-web", "spring-webmvc", + "spring-webmvc-portlet", "spring-webmvc-tiles3"]}) { + dependencies { + testCompile("org.easymock:easymock:${easymockVersion}") + testCompile "org.easymock:easymockclassextension:${easymockVersion}" + } +} + +configure(subprojects - project(":spring-build-junit")) { subproject -> apply plugin: "merge" apply from: "${gradleScriptDir}/publish-maven.gradle" @@ -116,6 +159,34 @@ configure(subprojects) { subproject -> } } +configure(allprojects - project(":spring-build-junit")) { + dependencies { + testCompile(project(":spring-build-junit")) + } + + eclipse.classpath.file.whenMerged { classpath -> + classpath.entries.find{it.path == "/spring-build-junit"}.exported = false + } + + test.systemProperties.put("testGroups", properties.get("testGroups")) +} + +project("spring-build-junit") { + description = "Build-time JUnit dependencies and utilities" + + // NOTE: This is an internal project and is not published. + + dependencies { + compile("commons-logging:commons-logging:1.1.1") + compile("junit:junit:${junitVersion}") + compile("org.hamcrest:hamcrest-all:1.3") + compile("org.easymock:easymock:${easymockVersion}") + } + + // Don't actually generate any artifacts + configurations.archives.artifacts.clear() +} + project("spring-core") { description = "Spring Core" @@ -297,7 +368,6 @@ project("spring-tx") { optional("javax.resource:connector-api:1.5") optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1") optional("javax.ejb:ejb-api:3.0") - testCompile "org.easymock:easymockclassextension:${easymockVersion}" testCompile("javax.persistence:persistence-api:1.0") testCompile("org.aspectj:aspectjweaver:${aspectjVersion}") } @@ -306,6 +376,14 @@ project("spring-tx") { project("spring-oxm") { description = "Spring Object/XML Marshalling" apply from: "oxm.gradle" + + compileTestJava { + // necessary to avoid java.lang.VerifyError on jibx compilation + // see http://jira.codehaus.org/browse/JIBX-465 + sourceCompatibility=1.6 + targetCompatibility=1.6 + } + dependencies { compile(project(":spring-beans")) compile(project(":spring-core")) @@ -431,6 +509,14 @@ project("spring-web") { project("spring-orm") { description = "Spring Object/Relational Mapping" + + compileTestJava { + // necessary to avoid java.lang.VerifyError on toplink compilation + // TODO: remove this block when we remove toplink + sourceCompatibility=1.6 + targetCompatibility=1.6 + } + dependencies { compile("aopalliance:aopalliance:1.0") optional("org.hibernate:hibernate-core:3.3.2.GA") @@ -629,7 +715,6 @@ project("spring-test-mvc") { testCompile("javax.activation:activation:1.1") testCompile("javax.mail:mail:1.4") testCompile("javax.xml.bind:jaxb-api:2.2.6") - testCompile("org.easymock:easymockclassextension:${easymockVersion}") testCompile("org.apache.tiles:tiles-request-api:1.0.1") testCompile("org.apache.tiles:tiles-api:3.0.1") testCompile("org.apache.tiles:tiles-core:3.0.1") { diff --git a/gradle/jdiff/Null.java b/gradle/jdiff/Null.java index 019b71895d..2d8649e544 100644 --- a/gradle/jdiff/Null.java +++ b/gradle/jdiff/Null.java @@ -1,6 +1,6 @@ -/** +/** * This class is used only as a "null" argument for Javadoc when comparing - * two API files. Javadoc has to have a package, .java or .class file as an + * two API files. Javadoc has to have a package, .java or .class file as an * argument, even though JDiff doesn't use it. */ public class Null { diff --git a/import-into-idea.md b/import-into-idea.md index 15a4e9e62d..4bbac88504 100644 --- a/import-into-idea.md +++ b/import-into-idea.md @@ -1,10 +1,10 @@ -The following has been tested against Intellij IDEA 11.0.1 +The following has been tested against Intellij IDEA 12.0 ## Steps _Within your locally cloned spring-framework working directory:_ -1. Generate IDEA metadata with `./gradlew cleanIdea idea` +1. Generate IDEA metadata with `./gradlew :spring-oxm:compileTestJava cleanIdea idea` 2. Import into IDEA as usual 3. Set the Project JDK as appropriate 4. Add git support @@ -12,21 +12,21 @@ _Within your locally cloned spring-framework working directory:_ ## Known issues -1. MockServletContext and friends will fail to compile in spring-web. To fix this, uncheck the 'export' setting for all servlet-api and tomcat-servlet-api jars. The problem is that spring-web needs Servlet 2.5, but it's picking up Servlet 3.0 from projects that it depends on. -2. spring-context will fail to build because there's a duplicate instance of GroovyMessenger in spring-context/src/test/java/org/springframework/scripting/groovy/Messenger.groovy. The solution to this is not known. It's not a problem on Eclipse, because Eclipse doesn't automatically compile .groovy files like IDEA (apparently) does. - -There are no other known problems at this time. Please add to this list, and if you're ambitious, consider playing with the Gradle IDEA generation DSL to fix these problems automatically, e.g.: - -* http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaProject.html -* http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html -* http://gradle.org/docs/current/groovydoc/org/gradle/plugins/ide/idea/model/IdeaModule.html +1. `spring-aspects` does not compile out of the box due to references to aspect types unknown to IDEA. +See http://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, you may want to +exclude `spring-aspects` from the overall project to avoid compilation errors. +2. While all JUnit tests pass from the command line with Gradle, many will fail when run from IDEA. +Resolving this is a work in progress. If attempting to run all JUnit tests from within IDEA, you will +likely need to set the following VM options to avoid out of memory errors: + -XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m ## Tips -In any case, please do not check in your own generated .iml, .ipr, or .iws files. You'll notice these files are already intentionally in .gitignore. The same policy goes for eclipse metadata. +In any case, please do not check in your own generated .iml, .ipr, or .iws files. +You'll notice these files are already intentionally in .gitignore. The same policy goes for eclipse metadata. ## FAQ Q. What about IDEA's own [Gradle support](http://confluence.jetbrains.net/display/IDEADEV/Gradle+integration)? -A. Unknown. Please report back if you try it and it goes well for you. +A. Keep an eye on http://youtrack.jetbrains.com/issue/IDEA-53476 diff --git a/settings.gradle b/settings.gradle index 11ce95641f..8d4e147bcc 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,3 +22,4 @@ include "spring-web" include "spring-webmvc" include "spring-webmvc-portlet" include "spring-webmvc-tiles3" +include "spring-build-junit" diff --git a/spring-aop/src/main/java/org/springframework/aop/Advisor.java b/spring-aop/src/main/java/org/springframework/aop/Advisor.java index 21c9c8301b..8959552925 100644 --- a/spring-aop/src/main/java/org/springframework/aop/Advisor.java +++ b/spring-aop/src/main/java/org/springframework/aop/Advisor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2012 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. @@ -18,14 +18,14 @@ package org.springframework.aop; import org.aopalliance.aop.Advice; -/** +/** * Base interface holding AOP advice (action to take at a joinpoint) - * and a filter determining the applicability of the advice (such as + * and a filter determining the applicability of the advice (such as * a pointcut). This interface is not for use by Spring users, but to * allow for commonality in support for different types of advice. * *
Spring AOP is based around around advice delivered via method - * interception, compliant with the AOP Alliance interception API. + * interception, compliant with the AOP Alliance interception API. * The Advisor interface allows support for different types of advice, * such as before and after advice, which need not be * implemented using interception. @@ -50,7 +50,7 @@ public interface Advisor { * (for example, creating a mixin) or shared with all instances of * the advised class obtained from the same Spring bean factory. *
Note that this method is not currently used by the framework.
- * Typical Advisor implementations always return true.
+ * Typical Advisor implementations always return {@code true}.
* Use singleton/prototype bean definitions or appropriate programmatic
* proxy creation to ensure that Advisors have the correct lifecycle model.
* @return whether this advice is associated with a particular target instance
diff --git a/spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java b/spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java
index ac4b9ba227..46362c2b13 100644
--- a/spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -33,7 +33,7 @@ public interface AfterReturningAdvice extends AfterAdvice {
* @param returnValue the value returned by the method, if any
* @param method method being invoked
* @param args arguments to the method
- * @param target target of the method invocation. May be null.
+ * @param target target of the method invocation. May be {@code null}.
* @throws Throwable if this object wishes to abort the call.
* Any exception thrown will be returned to the caller if it's
* allowed by the method signature. Otherwise the exception
diff --git a/spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java b/spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java
index fa23500793..8c38ff4b81 100644
--- a/spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java
+++ b/spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -25,6 +25,7 @@ import org.springframework.core.NestedRuntimeException;
* @author Juergen Hoeller
* @since 2.0
*/
+@SuppressWarnings("serial")
public class AopInvocationException extends NestedRuntimeException {
/**
diff --git a/spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java b/spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java
index 4fcd874cb0..17f7645e7c 100644
--- a/spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -18,7 +18,7 @@ package org.springframework.aop;
import org.aopalliance.aop.Advice;
-/**
+/**
* Subinterface of AOP Alliance Advice that allows additional interfaces
* to be implemented by an Advice, and available via a proxy using that
* interceptor. This is a fundamental AOP concept called introduction.
@@ -37,7 +37,7 @@ import org.aopalliance.aop.Advice;
* @see IntroductionAdvisor
*/
public interface DynamicIntroductionAdvice extends Advice {
-
+
/**
* Does this introduction advice implement the given interface?
* @param intf the interface to check
diff --git a/spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java
index 9e71253ef0..b576aa4b21 100644
--- a/spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java
+++ b/spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -30,7 +30,7 @@ package org.springframework.aop;
* @see IntroductionInterceptor
*/
public interface IntroductionAdvisor extends Advisor, IntroductionInfo {
-
+
/**
* Return the filter determining which target classes this introduction
* should apply to.
@@ -39,7 +39,7 @@ public interface IntroductionAdvisor extends Advisor, IntroductionInfo {
* @return the class filter
*/
ClassFilter getClassFilter();
-
+
/**
* Can the advised interfaces be implemented by the introduction advice?
* Invoked before adding an IntroductionAdvisor.
diff --git a/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java
index 1363960890..ffefed7eee 100644
--- a/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java
+++ b/spring-aop/src/main/java/org/springframework/aop/IntroductionAwareMethodMatcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -33,10 +33,10 @@ public interface IntroductionAwareMethodMatcher extends MethodMatcher {
* instead of the 2-arg {@link #matches(java.lang.reflect.Method, Class)} method
* if the caller supports the extended IntroductionAwareMethodMatcher interface.
* @param method the candidate method
- * @param targetClass the target class (may be null, in which case
+ * @param targetClass the target class (may be {@code null}, in which case
* the candidate class must be taken to be the method's declaring class)
- * @param hasIntroductions true if the object on whose behalf we are
- * asking is the subject on one or more introductions; false otherwise
+ * @param hasIntroductions {@code true} if the object on whose behalf we are
+ * asking is the subject on one or more introductions; {@code false} otherwise
* @return whether or not this method matches statically
*/
boolean matches(Method method, Class targetClass, boolean hasIntroductions);
diff --git a/spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java b/spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java
index c10e63c81d..6ba69a833d 100644
--- a/spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java
+++ b/spring-aop/src/main/java/org/springframework/aop/IntroductionInfo.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -29,7 +29,7 @@ package org.springframework.aop;
* @since 1.1.1
*/
public interface IntroductionInfo {
-
+
/**
* Return the additional interfaces introduced by this Advisor or Advice.
* @return the introduced interfaces
diff --git a/spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java b/spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java
index 9383af683c..fb8b08e220 100644
--- a/spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/MethodBeforeAdvice.java
@@ -1,12 +1,12 @@
/*
- * Copyright 2002-2005 the original author or authors.
- *
+ * Copyright 2002-2012 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.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -28,12 +28,12 @@ import java.lang.reflect.Method;
* @author Rod Johnson
*/
public interface MethodBeforeAdvice extends BeforeAdvice {
-
+
/**
* Callback before a given method is invoked.
* @param method method being invoked
* @param args arguments to the method
- * @param target target of the method invocation. May be null.
+ * @param target target of the method invocation. May be {@code null}.
* @throws Throwable if this object wishes to abort the call.
* Any exception thrown will be returned to the caller if it's
* allowed by the method signature. Otherwise the exception
diff --git a/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java
index 40ebad2777..15526c1fc8 100644
--- a/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java
+++ b/spring-aop/src/main/java/org/springframework/aop/MethodMatcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -26,15 +26,15 @@ import java.lang.reflect.Method;
* also makes arguments for a particular call available, and any effects of running
* previous advice applying to the joinpoint.
*
- *
If an implementation returns false from its {@link #isRuntime()}
+ *
If an implementation returns {@code false} from its {@link #isRuntime()}
* method, evaluation can be performed statically, and the result will be the same
* for all invocations of this method, whatever their arguments. This means that
- * if the {@link #isRuntime()} method returns false, the 3-arg
+ * if the {@link #isRuntime()} method returns {@code false}, the 3-arg
* {@link #matches(java.lang.reflect.Method, Class, Object[])} method will never be invoked.
*
- *
If an implementation returns true from its 2-arg
+ *
If an implementation returns {@code true} from its 2-arg
* {@link #matches(java.lang.reflect.Method, Class)} method and its {@link #isRuntime()} method
- * returns true, the 3-arg {@link #matches(java.lang.reflect.Method, Class, Object[])}
+ * returns {@code true}, the 3-arg {@link #matches(java.lang.reflect.Method, Class, Object[])}
* method will be invoked immediately before each potential execution of the related advice,
* to decide whether the advice should run. All previous advice, such as earlier interceptors
* in an interceptor chain, will have run, so any state changes they have produced in
@@ -49,11 +49,11 @@ public interface MethodMatcher {
/**
* Perform static checking whether the given method matches. If this
- * returns false or if the {@link #isRuntime()} method
- * returns false, no runtime check (i.e. no.
+ * returns {@code false} or if the {@link #isRuntime()} method
+ * returns {@code false}, no runtime check (i.e. no.
* {@link #matches(java.lang.reflect.Method, Class, Object[])} call) will be made.
* @param method the candidate method
- * @param targetClass the target class (may be null, in which case
+ * @param targetClass the target class (may be {@code null}, in which case
* the candidate class must be taken to be the method's declaring class)
* @return whether or not this method matches statically
*/
@@ -62,7 +62,7 @@ public interface MethodMatcher {
/**
* Is this MethodMatcher dynamic, that is, must a final call be made on the
* {@link #matches(java.lang.reflect.Method, Class, Object[])} method at
- * runtime even if the 2-arg matches method returns true?
+ * runtime even if the 2-arg matches method returns {@code true}?
*
Can be invoked when an AOP proxy is created, and need not be invoked * again before each method invocation, * @return whether or not a runtime match via the 3-arg @@ -75,12 +75,12 @@ public interface MethodMatcher { * Check whether there a runtime (dynamic) match for this method, * which must have matched statically. *
This method is invoked only if the 2-arg matches method returns
- * true for the given method and target class, and if the
- * {@link #isRuntime()} method returns true. Invoked
+ * {@code true} for the given method and target class, and if the
+ * {@link #isRuntime()} method returns {@code true}. Invoked
* immediately before potential running of the advice, after any
* advice earlier in the advice chain has run.
* @param method the candidate method
- * @param targetClass the target class (may be null, in which case
+ * @param targetClass the target class (may be {@code null}, in which case
* the candidate class must be taken to be the method's declaring class)
* @param args arguments to the method
* @return whether there's a runtime match
diff --git a/spring-aop/src/main/java/org/springframework/aop/Pointcut.java b/spring-aop/src/main/java/org/springframework/aop/Pointcut.java
index cebbfa023c..489e7beb82 100644
--- a/spring-aop/src/main/java/org/springframework/aop/Pointcut.java
+++ b/spring-aop/src/main/java/org/springframework/aop/Pointcut.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -34,13 +34,13 @@ public interface Pointcut {
/**
* Return the ClassFilter for this pointcut.
- * @return the ClassFilter (never null)
+ * @return the ClassFilter (never {@code null})
*/
ClassFilter getClassFilter();
/**
* Return the MethodMatcher for this pointcut.
- * @return the MethodMatcher (never null)
+ * @return the MethodMatcher (never {@code null})
*/
MethodMatcher getMethodMatcher();
diff --git a/spring-aop/src/main/java/org/springframework/aop/PointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/PointcutAdvisor.java
index 02818d12e7..7b7c1e7864 100644
--- a/spring-aop/src/main/java/org/springframework/aop/PointcutAdvisor.java
+++ b/spring-aop/src/main/java/org/springframework/aop/PointcutAdvisor.java
@@ -1,12 +1,12 @@
/*
- * Copyright 2002-2005 the original author or authors.
- *
+ * Copyright 2002-2012 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.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java b/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java
index 00015a5d9e..935f745de4 100644
--- a/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java
+++ b/spring-aop/src/main/java/org/springframework/aop/ProxyMethodInvocation.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -40,22 +40,22 @@ public interface ProxyMethodInvocation extends MethodInvocation {
Object getProxy();
/**
- * Create a clone of this object. If cloning is done before proceed()
- * is invoked on this object, proceed() can be invoked once per clone
+ * Create a clone of this object. If cloning is done before {@code proceed()}
+ * is invoked on this object, {@code proceed()} can be invoked once per clone
* to invoke the joinpoint (and the rest of the advice chain) more than once.
* @return an invocable clone of this invocation.
- * proceed() can be called once per clone.
+ * {@code proceed()} can be called once per clone.
*/
MethodInvocation invocableClone();
/**
- * Create a clone of this object. If cloning is done before proceed()
- * is invoked on this object, proceed() can be invoked once per clone
+ * Create a clone of this object. If cloning is done before {@code proceed()}
+ * is invoked on this object, {@code proceed()} can be invoked once per clone
* to invoke the joinpoint (and the rest of the advice chain) more than once.
* @param arguments the arguments that the cloned invocation is supposed to use,
* overriding the original arguments
* @return an invocable clone of this invocation.
- * proceed() can be called once per clone.
+ * {@code proceed()} can be called once per clone.
*/
MethodInvocation invocableClone(Object[] arguments);
@@ -71,14 +71,14 @@ public interface ProxyMethodInvocation extends MethodInvocation {
*
Such attributes are not used within the AOP framework itself. They are
* just kept as part of the invocation object, for use in special interceptors.
* @param key the name of the attribute
- * @param value the value of the attribute, or null to reset it
+ * @param value the value of the attribute, or {@code null} to reset it
*/
void setUserAttribute(String key, Object value);
/**
* Return the value of the specified user attribute.
* @param key the name of the attribute
- * @return the value of the attribute, or null if not set
+ * @return the value of the attribute, or {@code null} if not set
* @see #setUserAttribute
*/
Object getUserAttribute(String key);
diff --git a/spring-aop/src/main/java/org/springframework/aop/TargetClassAware.java b/spring-aop/src/main/java/org/springframework/aop/TargetClassAware.java
index 5334ae26ff..e2eccfac57 100644
--- a/spring-aop/src/main/java/org/springframework/aop/TargetClassAware.java
+++ b/spring-aop/src/main/java/org/springframework/aop/TargetClassAware.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -32,7 +32,7 @@ public interface TargetClassAware {
/**
* Return the target class behind the implementing object
* (typically a proxy configuration or an actual proxy).
- * @return the target Class, or null if not known
+ * @return the target Class, or {@code null} if not known
*/
Class> getTargetClass();
diff --git a/spring-aop/src/main/java/org/springframework/aop/TargetSource.java b/spring-aop/src/main/java/org/springframework/aop/TargetSource.java
index f5be5fdb9b..9633b4b33b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/TargetSource.java
+++ b/spring-aop/src/main/java/org/springframework/aop/TargetSource.java
@@ -1,5 +1,5 @@
/*<
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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,16 +17,16 @@
package org.springframework.aop;
/**
- * A TargetSource is used to obtain the current "target" of
+ * A {@code TargetSource} is used to obtain the current "target" of
* an AOP invocation, which will be invoked via reflection if no around
* advice chooses to end the interceptor chain itself.
*
- *
If a TargetSource is "static", it will always return
+ *
If a {@code TargetSource} is "static", it will always return * the same target, allowing optimizations in the AOP framework. Dynamic * target sources can support pooling, hot swapping, etc. * *
Application developers don't usually need to work with
- * TargetSources directly: this is an AOP framework interface.
+ * {@code TargetSources} directly: this is an AOP framework interface.
*
* @author Rod Johnson
*/
@@ -34,8 +34,8 @@ public interface TargetSource extends TargetClassAware {
/**
* Return the type of targets returned by this {@link TargetSource}.
- *
Can return null, although certain usages of a
- * TargetSource might just work with a predetermined
+ *
Can return {@code null}, although certain usages of a + * {@code TargetSource} might just work with a predetermined * target class. * @return the type of targets returned by this {@link TargetSource} */ @@ -46,7 +46,7 @@ public interface TargetSource extends TargetClassAware { *
In that case, there will be no need to invoke
* {@link #releaseTarget(Object)}, and the AOP framework can cache
* the return value of {@link #getTarget()}.
- * @return true if the target is immutable
+ * @return {@code true} if the target is immutable
* @see #getTarget
*/
boolean isStatic();
diff --git a/spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java b/spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java
index 0b8c228a4a..248e2f6416 100644
--- a/spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java
+++ b/spring-aop/src/main/java/org/springframework/aop/TrueClassFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -23,10 +23,11 @@ import java.io.Serializable;
*
* @author Rod Johnson
*/
+@SuppressWarnings("serial")
class TrueClassFilter implements ClassFilter, Serializable {
-
+
public static final TrueClassFilter INSTANCE = new TrueClassFilter();
-
+
/**
* Enforce Singleton pattern.
*/
@@ -36,11 +37,11 @@ class TrueClassFilter implements ClassFilter, Serializable {
public boolean matches(Class clazz) {
return true;
}
-
+
/**
* Required to support serialization. Replaces with canonical
* instance on deserialization, protecting Singleton pattern.
- * Alternative to overriding equals().
+ * Alternative to overriding {@code equals()}.
*/
private Object readResolve() {
return INSTANCE;
diff --git a/spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java b/spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java
index 7be4d470a2..a8bf94dcae 100644
--- a/spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java
+++ b/spring-aop/src/main/java/org/springframework/aop/TrueMethodMatcher.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -24,10 +24,11 @@ import java.lang.reflect.Method;
*
* @author Rod Johnson
*/
+@SuppressWarnings("serial")
class TrueMethodMatcher implements MethodMatcher, Serializable {
-
+
public static final TrueMethodMatcher INSTANCE = new TrueMethodMatcher();
-
+
/**
* Enforce Singleton pattern.
*/
@@ -46,16 +47,16 @@ class TrueMethodMatcher implements MethodMatcher, Serializable {
// Should never be invoked as isRuntime returns false.
throw new UnsupportedOperationException();
}
-
+
/**
* Required to support serialization. Replaces with canonical
* instance on deserialization, protecting Singleton pattern.
- * Alternative to overriding equals().
+ * Alternative to overriding {@code equals()}.
*/
private Object readResolve() {
return INSTANCE;
}
-
+
@Override
public String toString() {
return "MethodMatcher.TRUE";
diff --git a/spring-aop/src/main/java/org/springframework/aop/TruePointcut.java b/spring-aop/src/main/java/org/springframework/aop/TruePointcut.java
index 0c6efcb70e..553b0e9d6d 100644
--- a/spring-aop/src/main/java/org/springframework/aop/TruePointcut.java
+++ b/spring-aop/src/main/java/org/springframework/aop/TruePointcut.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -23,10 +23,11 @@ import java.io.Serializable;
*
* @author Rod Johnson
*/
+@SuppressWarnings("serial")
class TruePointcut implements Pointcut, Serializable {
-
+
public static final TruePointcut INSTANCE = new TruePointcut();
-
+
/**
* Enforce Singleton pattern.
*/
@@ -40,11 +41,11 @@ class TruePointcut implements Pointcut, Serializable {
public MethodMatcher getMethodMatcher() {
return MethodMatcher.TRUE;
}
-
+
/**
* Required to support serialization. Replaces with canonical
* instance on deserialization, protecting Singleton pattern.
- * Alternative to overriding equals().
+ * Alternative to overriding {@code equals()}.
*/
private Object readResolve() {
return INSTANCE;
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
index 9cc93f3d28..515358c3e3 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
@@ -211,7 +211,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
public void setAspectName(String name) {
this.aspectName = name;
}
-
+
public String getAspectName() {
return this.aspectName;
}
@@ -268,7 +268,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
throw new UnsupportedOperationException("Only afterReturning advice can be used to bind a return value");
}
- /**
+ /**
* We need to hold the returning name at this level for argument binding calculations,
* this method allows the afterReturning advice subclass to set the name.
*/
@@ -302,7 +302,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
throw new UnsupportedOperationException("Only afterThrowing advice can be used to bind a thrown exception");
}
- /**
+ /**
* We need to hold the throwing name at this level for argument binding calculations,
* this method allows the afterThrowing advice subclass to set the name.
*/
@@ -347,8 +347,8 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
* on subsequent advice invocations can be as fast as possible.
*
If the first argument is of type JoinPoint or ProceedingJoinPoint then we * pass a JoinPoint in that position (ProceedingJoinPoint for around advice). - *
If the first argument is of type JoinPoint.StaticPart
- * then we pass a JoinPoint.StaticPart in that position.
+ *
If the first argument is of type {@code JoinPoint.StaticPart} + * then we pass a {@code JoinPoint.StaticPart} in that position. *
Remaining arguments have to be bound by pointcut evaluation at
* a given join point. We will get back a map from argument name to
* value. We need to calculate which advice parameter needs to be bound
@@ -365,11 +365,11 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
Class[] parameterTypes = this.aspectJAdviceMethod.getParameterTypes();
if (maybeBindJoinPoint(parameterTypes[0]) || maybeBindProceedingJoinPoint(parameterTypes[0])) {
numUnboundArgs--;
- }
+ }
else if (maybeBindJoinPointStaticPart(parameterTypes[0])) {
numUnboundArgs--;
}
-
+
if (numUnboundArgs > 0) {
// need to bind arguments by name as returned from the pointcut match
bindArgumentsByName(numUnboundArgs);
@@ -398,7 +398,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
}
else {
return false;
- }
+ }
}
protected boolean supportsProceedingJoinPoint() {
@@ -409,7 +409,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
if (candidateParameterType.equals(JoinPoint.StaticPart.class)) {
this.joinPointStaticPartArgumentIndex = 0;
return true;
- }
+ }
else {
return false;
}
@@ -422,7 +422,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
if (this.argumentNames != null) {
// We have been able to determine the arg names.
bindExplicitArguments(numArgumentsExpectingToBind);
- }
+ }
else {
throw new IllegalStateException("Advice method [" + this.aspectJAdviceMethod.getName() + "] " +
"requires " + numArgumentsExpectingToBind + " arguments to be bound by name, but " +
@@ -471,9 +471,9 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
// specified, and find the discovered argument types.
if (this.returningName != null) {
if (!this.argumentBindings.containsKey(this.returningName)) {
- throw new IllegalStateException("Returning argument name '"
+ throw new IllegalStateException("Returning argument name '"
+ this.returningName + "' was not bound in advice arguments");
- }
+ }
else {
Integer index = this.argumentBindings.get(this.returningName);
this.discoveredReturningType = this.aspectJAdviceMethod.getParameterTypes()[index];
@@ -482,9 +482,9 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
}
if (this.throwingName != null) {
if (!this.argumentBindings.containsKey(this.throwingName)) {
- throw new IllegalStateException("Throwing argument name '"
+ throw new IllegalStateException("Throwing argument name '"
+ this.throwingName + "' was not bound in advice arguments");
- }
+ }
else {
Integer index = this.argumentBindings.get(this.throwingName);
this.discoveredThrowingType = this.aspectJAdviceMethod.getParameterTypes()[index];
@@ -525,7 +525,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
pointcutParameterTypes[index] = methodParameterTypes[i];
index++;
}
-
+
this.pointcut.setParameterNames(pointcutParameterNames);
this.pointcut.setParameterTypes(pointcutParameterTypes);
}
@@ -549,7 +549,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
if (this.joinPointArgumentIndex != -1) {
adviceInvocationArgs[this.joinPointArgumentIndex] = jp;
numBound++;
- }
+ }
else if (this.joinPointStaticPartArgumentIndex != -1) {
adviceInvocationArgs[this.joinPointStaticPartArgumentIndex] = jp.getStaticPart();
numBound++;
@@ -582,8 +582,8 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
if (numBound != this.adviceInvocationArgumentCount) {
throw new IllegalStateException("Required to bind " + this.adviceInvocationArgumentCount
- + " arguments, but only bound " + numBound + " (JoinPointMatch " +
- (jpMatch == null ? "was NOT" : "WAS") +
+ + " arguments, but only bound " + numBound + " (JoinPointMatch " +
+ (jpMatch == null ? "was NOT" : "WAS") +
" bound in invocation)");
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java
index 0794a3fe1b..2f1e7aaa6b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectInstanceFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -34,13 +34,13 @@ public interface AspectInstanceFactory extends Ordered {
/**
* Create an instance of this factory's aspect.
- * @return the aspect instance (never null)
+ * @return the aspect instance (never {@code null})
*/
Object getAspectInstance();
/**
* Expose the aspect class loader that this factory uses.
- * @return the aspect class loader (never null)
+ * @return the aspect class loader (never {@code null})
*/
ClassLoader getAspectClassLoader();
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
index 7a9dba9612..42a2c6f729 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAdviceParameterNameDiscoverer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -36,82 +36,82 @@ import org.springframework.util.StringUtils;
/**
* {@link ParameterNameDiscoverer} implementation that tries to deduce parameter names
* for an advice method from the pointcut expression, returning, and throwing clauses.
- * If an unambiguous interpretation is not available, it returns null.
+ * If an unambiguous interpretation is not available, it returns {@code null}.
*
*
This class interprets arguments in the following way: *
thisJoinPoint to the advice, and the parameter name will
- * be assigned the value "thisJoinPoint".JoinPoint.StaticPart, it is assumed to be for passing
- * "thisJoinPointStaticPart" to the advice, and the parameter name
- * will be assigned the value "thisJoinPointStaticPart".Throwable+, then an
+ * there are no unbound arguments of type {@code Throwable+}, then an
* {@link IllegalArgumentException} is raised. If there is more than one
- * unbound argument of type Throwable+, then an
+ * unbound argument of type {@code Throwable+}, then an
* {@link AmbiguousBindingException} is raised. If there is exactly one
- * unbound argument of type Throwable+, then the corresponding
+ * unbound argument of type {@code Throwable+}, then the corresponding
* parameter name is assigned the value <throwingName>.a be the number of annotation-based pointcut
+ * examined. Let {@code a} be the number of annotation-based pointcut
* expressions (@annotation, @this, @target, @args,
* @within, @withincode) that are used in binding form. Usage in
* binding form has itself to be deduced: if the expression inside the
* pointcut is a single string literal that meets Java variable name
- * conventions it is assumed to be a variable name. If a is
- * zero we proceed to the next stage. If a > 1 then an
- * AmbiguousBindingException is raised. If a == 1,
- * and there are no unbound arguments of type Annotation+,
- * then an IllegalArgumentException is raised. if there is
+ * conventions it is assumed to be a variable name. If {@code a} is
+ * zero we proceed to the next stage. If {@code a} > 1 then an
+ * {@code AmbiguousBindingException} is raised. If {@code a} == 1,
+ * and there are no unbound arguments of type {@code Annotation+},
+ * then an {@code IllegalArgumentException} is raised. if there is
* exactly one such argument, then the corresponding parameter name is
* assigned the value from the pointcut expression.IllegalArgumentException is raised. If there is
+ * then an {@code IllegalArgumentException} is raised. If there is
* more than one unbound argument then an
- * AmbiguousBindingException is raised. If there is exactly
+ * {@code AmbiguousBindingException} is raised. If there is exactly
* one unbound argument then the corresponding parameter name is assigned
* the value <returningName>.this, target, and
- * args pointcut expressions used in the binding form (binding
+ * examined once more for {@code this}, {@code target}, and
+ * {@code args} pointcut expressions used in the binding form (binding
* forms are deduced as described for the annotation based pointcuts). If
* there remains more than one unbound argument of a primitive type (which
- * can only be bound in args) then an
- * AmbiguousBindingException is raised. If there is exactly
- * one argument of a primitive type, then if exactly one args
+ * can only be bound in {@code args}) then an
+ * {@code AmbiguousBindingException} is raised. If there is exactly
+ * one argument of a primitive type, then if exactly one {@code args}
* bound variable was found, we assign the corresponding parameter name
- * the variable name. If there were no args bound variables
- * found an IllegalStateException is raised. If there are
- * multiple args bound variables, an
- * AmbiguousBindingException is raised. At this point, if
+ * the variable name. If there were no {@code args} bound variables
+ * found an {@code IllegalStateException} is raised. If there are
+ * multiple {@code args} bound variables, an
+ * {@code AmbiguousBindingException} is raised. At this point, if
* there remains more than one unbound argument we raise an
- * AmbiguousBindingException. If there are no unbound arguments
+ * {@code AmbiguousBindingException}. If there are no unbound arguments
* remaining, we are done. If there is exactly one unbound argument
* remaining, and only one candidate variable name unbound from
- * this, target, or args, it is
+ * {@code this}, {@code target}, or {@code args}, it is
* assigned as the corresponding parameter name. If there are multiple
- * possibilities, an AmbiguousBindingException is raised.The behavior on raising an IllegalArgumentException or
- * AmbiguousBindingException is configurable to allow this discoverer
+ *
The behavior on raising an {@code IllegalArgumentException} or
+ * {@code AmbiguousBindingException} is configurable to allow this discoverer
* to be used as part of a chain-of-responsibility. By default the condition will
- * be logged and the getParameterNames(..) method will simply return
- * null. If the {@link #setRaiseExceptions(boolean) raiseExceptions}
- * property is set to true, the conditions will be thrown as
- * IllegalArgumentException and AmbiguousBindingException,
+ * be logged and the {@code getParameterNames(..)} method will simply return
+ * {@code null}. If the {@link #setRaiseExceptions(boolean) raiseExceptions}
+ * property is set to {@code true}, the conditions will be thrown as
+ * {@code IllegalArgumentException} and {@code AmbiguousBindingException},
* respectively.
*
*
Was that perfectly clear? ;) * *
Short version: If an unambiguous binding can be deduced, then it is.
- * If the advice requirements cannot possibly be satisfied, then This method converts back to This method converts back to {@code &&} for the AspectJ pointcut parser.
*/
private String replaceBooleanOperators(String pcExpr) {
String result = StringUtils.replace(pcExpr, " and ", " && ");
@@ -259,7 +260,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
ex);
return false;
}
- }
+ }
catch (BCException ex) {
logger.debug("PointcutExpression matching rejected target class", ex);
return false;
@@ -494,10 +495,10 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
/**
- * Handler for the Spring-specific This handler must be added to each pointcut object that needs to
- * handle the Pass the option...
*
* to the weaver; for example, specifying the following in a
- * " Note: the Note: the {@code getThis()} method returns the current Spring AOP proxy.
+ * The {@code getTarget()} method returns the current Spring AOP target (which may be
+ * {@code null} if there is no target), and is a plain POJO without any advice.
* If you want to call the object and have the advice take effect, use
- * Of course there is no such distinction between target and proxy in AspectJ.
@@ -50,7 +50,7 @@ import org.springframework.util.Assert;
* @since 2.0
*/
public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint, JoinPoint.StaticPart {
-
+
private final ProxyMethodInvocation methodInvocation;
private Object[] defensiveCopyOfArgs;
@@ -92,14 +92,14 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
}
/**
- * Returns the Spring AOP proxy. Cannot be It relies on implementation specific knowledge in AspectJ to break
* encapsulation and do something AspectJ was not designed to do: query
* the types of runtime tests that will be performed. The code here should
- * migrate to See .
@@ -137,7 +137,7 @@ class RuntimeTestWalker {
public void visit(MatchingContextBasedTest matchingContextTest) {
}
-
+
protected int getVarType(ReflectionVar v) {
try {
Field varTypeField = ReflectionVar.class.getDeclaredField("varType");
@@ -169,7 +169,7 @@ class RuntimeTestWalker {
this.matches = defaultMatches;
this.matchVarType = matchVarType;
}
-
+
public boolean instanceOfMatches(Test test) {
test.accept(this);
return matches;
@@ -236,7 +236,7 @@ class RuntimeTestWalker {
aTest.accept(this);
return this.testsSubtypeSensitiveVars;
}
-
+
@Override
public void visit(Instanceof i) {
ReflectionVar v = (ReflectionVar) i.getVar();
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java
index 8c0f70fe98..40049e978e 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/SimpleAspectInstanceFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -42,7 +42,7 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
}
/**
- * Return the specified aspect class (never The default implementation simply returns The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
* @param aspectClass the aspect class
*/
protected int getOrderForAspectClass(Class> aspectClass) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java
index 53e8600224..7f550a333d 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/SingletonAspectInstanceFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -30,7 +30,7 @@ import org.springframework.util.Assert;
* @see SimpleAspectInstanceFactory
*/
public class SingletonAspectInstanceFactory implements AspectInstanceFactory {
-
+
private final Object aspectInstance;
@@ -71,7 +71,7 @@ public class SingletonAspectInstanceFactory implements AspectInstanceFactory {
* Determine a fallback order for the case that the aspect instance
* does not express an instance-specific order through implementing
* the {@link org.springframework.core.Ordered} interface.
- * The default implementation simply returns The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
* @param aspectClass the aspect class
*/
protected int getOrderForAspectClass(Class> aspectClass) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java
index 984c46f4f9..adb8c4db37 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/TypePatternClassFilter.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -47,11 +47,11 @@ public class TypePatternClassFilter implements ClassFilter {
}
/**
- * Create a fully configured {@link TypePatternClassFilter} using the
+ * Create a fully configured {@link TypePatternClassFilter} using the
* given type pattern.
* @param typePattern the type pattern that AspectJ weaver should parse
- * @throws IllegalArgumentException if the supplied These conventions are established by AspectJ, not Spring AOP.
* @param typePattern the type pattern that AspectJ weaver should parse
- * @throws IllegalArgumentException if the supplied This method converts back to This method converts back to {@code &&} for the AspectJ pointcut parser.
*/
private String replaceBooleanOperators(String pcExpr) {
pcExpr = StringUtils.replace(pcExpr," and "," && ");
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java
index cb09937a39..5b3f48bce8 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AbstractAspectJAdvisorFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -58,7 +58,7 @@ import org.springframework.util.StringUtils;
* @since 2.0
*/
public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFactory {
-
+
protected static final ParameterNameDiscoverer ASPECTJ_ANNOTATION_PARAMETER_NAME_DISCOVERER =
new AspectJAnnotationParameterNameDiscoverer();
@@ -121,7 +121,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
/**
* We need to detect this as "code-style" AspectJ aspects should not be
- * interpreted by Spring AOP.
+ * interpreted by Spring AOP.
*/
private boolean compiledByAjc(Class> clazz) {
// The AJTypeSystem goes to great lengths to provide a uniform appearance between code-style and
@@ -154,11 +154,11 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
if (ajType.getPerClause().getKind() == PerClauseKind.PERCFLOWBELOW) {
throw new AopConfigException(aspectClass.getName() + " uses percflowbelow instantiation model: " +
"This is not supported in Spring AOP.");
- }
+ }
}
/**
- * The pointcut and advice annotations both have an "argNames" member which contains a
+ * The pointcut and advice annotations both have an "argNames" member which contains a
* comma-separated list of the argument names. We use this (if non-empty) to build the
* formal parameters for the pointcut.
*/
@@ -169,13 +169,13 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
if (pointcutParameterNames != null) {
pointcutParameterTypes = extractPointcutParameterTypes(pointcutParameterNames,annotatedMethod);
}
-
+
AspectJExpressionPointcut ajexp =
new AspectJExpressionPointcut(declarationScope,pointcutParameterNames,pointcutParameterTypes);
ajexp.setLocation(annotatedMethod.toString());
return ajexp;
}
-
+
/**
* Create the pointcut parameters needed by aspectj based on the given argument names
* and the argument types that are available from the adviceMethod. Needs to take into
@@ -326,10 +326,10 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
return names;
}
else {
- return null;
+ return null;
}
}
-
+
public String[] getParameterNames(Constructor ctor) {
throw new UnsupportedOperationException("Spring AOP cannot handle constructor advice");
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java
index d19a5d7c67..9eff81682b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AnnotationAwareAspectJAutoProxyCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -45,6 +45,7 @@ import org.springframework.util.Assert;
* @since 2.0
* @see org.springframework.aop.aspectj.annotation.AspectJAdvisorFactory
*/
+@SuppressWarnings("serial")
public class AnnotationAwareAspectJAutoProxyCreator extends AspectJAwareAdvisorAutoProxyCreator {
private List If no <aop:include> elements were used then "includePatterns" will be
- * Will simply return Will simply return {@code false} if the supposed aspect is
* invalid (such as an extension of a concrete aspect class).
* Will return true for some aspects that Spring AOP cannot process,
* such as those with unsupported instantiation models.
@@ -75,7 +75,7 @@ public interface AspectJAdvisorFactory {
* @param aif the aspect instance factory
* @param declarationOrderInAspect the declaration order within the aspect
* @param aspectName the name of the aspect
- * @return Note that this may instantiate multiple times if using a prototype,
- * which probably won't give the semantics you expect.
+ * which probably won't give the semantics you expect.
* Use a {@link LazySingletonAspectInstanceFactoryDecorator}
* to wrap this to ensure only one new aspect comes back.
*
@@ -56,7 +56,7 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
public BeanFactoryAspectInstanceFactory(BeanFactory beanFactory, String name) {
this(beanFactory, name, beanFactory.getType(name));
}
-
+
/**
* Create a BeanFactoryAspectInstanceFactory, providing a type that AspectJ should
* introspect to create AJType metadata. Use if the BeanFactory may consider the type
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java
index 433a33bb6b..b9863ab67a 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/InstantiationModelAwarePointcutAdvisorImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -41,23 +41,23 @@ class InstantiationModelAwarePointcutAdvisorImpl
implements InstantiationModelAwarePointcutAdvisor, AspectJPrecedenceInformation {
private final AspectJExpressionPointcut declaredPointcut;
-
+
private Pointcut pointcut;
-
+
private final MetadataAwareAspectInstanceFactory aspectInstanceFactory;
-
+
private final Method method;
-
+
private final boolean lazy;
-
+
private final AspectJAdvisorFactory atAspectJAdvisorFactory;
-
+
private Advice instantiatedAdvice;
private int declarationOrder;
-
+
private String aspectName;
-
+
private Boolean isBeforeAdvice;
private Boolean isAfterAdvice;
@@ -72,12 +72,12 @@ class InstantiationModelAwarePointcutAdvisorImpl
this.aspectInstanceFactory = aif;
this.declarationOrder = declarationOrderInAspect;
this.aspectName = aspectName;
-
+
if (aif.getAspectMetadata().isLazilyInstantiated()) {
// Static part of the pointcut is a lazy type.
Pointcut preInstantiationPointcut =
Pointcuts.union(aif.getAspectMetadata().getPerClausePointcut(), this.declaredPointcut);
-
+
// Make it dynamic: must mutate from pre-instantiation to post-instantiation state.
// If it's not a dynamic pointcut, it may be optimized out
// by the Spring AOP infrastructure after the first evaluation.
@@ -103,13 +103,13 @@ class InstantiationModelAwarePointcutAdvisorImpl
/**
* This is only of interest for Spring AOP: AspectJ instantiation semantics
- * are much richer. In AspectJ terminology, all a return of Resulting Advisors will need to be evaluated for targets.
* @param introductionField the field to introspect
- * @return The default implementation simply returns The default implementation simply returns {@code Ordered.LOWEST_PRECEDENCE}.
* @param aspectClass the aspect class
*/
@Override
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java
index aa279de07c..ef9014a144 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SingletonMetadataAwareAspectInstanceFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -54,7 +54,7 @@ public class SingletonMetadataAwareAspectInstanceFactory extends SingletonAspect
/**
* Check whether the aspect class carries an
* {@link org.springframework.core.annotation.Order} annotation,
- * falling back to Normally to be used through an AspectJAutoProxyCreator rather than directly.
*
*/
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java
index 0cb786cc25..dbfcbd380e 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJAwareAdvisorAutoProxyCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -43,6 +43,7 @@ import org.springframework.util.ClassUtils;
* @author Ramnivas Laddad
* @since 2.0
*/
+@SuppressWarnings("serial")
public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProxyCreator {
private static final Comparator DEFAULT_PRECEDENCE_COMPARATOR = new AspectJPrecedenceComparator();
@@ -72,22 +73,22 @@ public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProx
for (Advisor element : advisors) {
partiallyComparableAdvisors.add(
new PartiallyComparableAdvisorHolder(element, DEFAULT_PRECEDENCE_COMPARATOR));
- }
-
+ }
+
// sort it
List Given two pieces of advice, Given two pieces of advice, {@code a} and {@code b}:
* Note that use of this package does not require the use of the Note that use of this package does not require the use of the {@code ajc} compiler
* or AspectJ load-time weaver. It is intended to enable the use of a valuable subset of AspectJ
* functionality, with consistent semantics, with the proxy-based Spring AOP framework.
*
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java b/spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java
index 43de1f6446..6e58344f80 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/AbstractInterceptorDrivenBeanDefinitionDecorator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -40,7 +40,7 @@ import org.springframework.util.StringUtils;
* to the resulting bean.
*
* This base class controls the creation of the {@link ProxyFactoryBean} bean definition
- * and wraps the original as an inner-bean definition for the Chaining is correctly handled, ensuring that only one {@link ProxyFactoryBean} definition
@@ -48,7 +48,7 @@ import org.springframework.util.StringUtils;
* already created the {@link org.springframework.aop.framework.ProxyFactoryBean} then the
* interceptor is simply added to the existing definition.
*
- * Subclasses have only to create the Subclasses have only to create the {@code BeanDefinition} to the interceptor that
* they wish to add.
*
* @author Rob Harrop
@@ -60,7 +60,7 @@ public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator implement
public final BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definitionHolder, ParserContext parserContext) {
BeanDefinitionRegistry registry = parserContext.getRegistry();
-
+
// get the root bean name - will be the name of the generated proxy factory bean
String existingBeanName = definitionHolder.getBeanName();
BeanDefinition targetDefinition = definitionHolder.getBeanDefinition();
@@ -118,7 +118,7 @@ public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator implement
}
/**
- * Subclasses should implement this method to return the Only a single auto-proxy creator can be registered yet multiple concrete
- * implementations are available. Therefore this class wraps a simple escalation
+ * Only a single auto-proxy creator can be registered yet multiple concrete
+ * implementations are available. Therefore this class wraps a simple escalation
* protocol, allowing classes to request a particular auto-proxy creator and know
- * that class, Provides a {@link org.springframework.beans.factory.xml.BeanDefinitionParser} for the
- * The The {@code pointcut} tag allows for creation of named
* {@link AspectJExpressionPointcut} beans using a simple syntax:
* Using the Using the {@code advisor} tag you can configure an {@link org.springframework.aop.Advisor}
* and have it applied to all relevant beans in you {@link org.springframework.beans.factory.BeanFactory}
- * automatically. The Only a single auto-proxy creator can be registered and multiple tags may wish
* to register different concrete implementations. As such this class delegates to
@@ -42,12 +42,12 @@ import org.springframework.beans.factory.xml.ParserContext;
public abstract class AopNamespaceUtils {
/**
- * The Implements caching of Implements caching of {@code canApply} results per bean name.
* @param bean the bean instance
* @param beanName the name of the bean
* @see AopUtils#canApply(Advisor, Class)
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java b/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java
index 397c97b769..3c822cf2da 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -77,7 +77,7 @@ public interface Advised extends TargetClassAware {
* Set whether the proxy should be exposed by the AOP framework as a
* ThreadLocal for retrieval via the AopContext class. This is useful
* if an advised object needs to call another advised method on itself.
- * (If it uses Default is "false", for optimal performance.
*/
void setExposeProxy(boolean exposeProxy);
@@ -85,7 +85,7 @@ public interface Advised extends TargetClassAware {
/**
* Return whether the factory should expose the proxy as a ThreadLocal.
* This can be necessary if a target object needs to invoke a method on itself
- * benefitting from advice. (If it invokes a method on This will be wrapped in a DefaultPointcutAdvisor with a pointcut that always
- * applies, and returned from the Note that the given advice will apply to all invocations on the proxy,
- * even to the Note: The given advice will apply to all invocations on the proxy,
- * even to the Does nothing if the given interface isn't proxied.
* @param intf the interface to remove from the proxy
- * @return The The {@code currentProxy()} method is usable if the AOP framework is configured to
* expose the current proxy (not the default). It returns the AOP proxy in use. Target objects
- * or advice can use this to make advised calls, in the same way as Spring's AOP framework does not expose proxies by default, as there is a performance cost
@@ -42,7 +42,7 @@ public abstract class AopContext {
/**
* ThreadLocal holder for AOP proxy associated with this thread.
- * Will contain Note that the caller should be careful to keep the old value as appropriate.
- * @param proxy the proxy to expose (or Uses the AopProxy's default class loader (if necessary for proxy creation):
* usually, the thread context class loader.
- * @return the new proxy object (never Uses the given class loader (if necessary for proxy creation).
- * Proxies may or may not allow advice changes to be made.
* If they do not permit advice changes (for example, because
- * the configuration was frozen) a proxy should throw an
+ * the configuration was frozen) a proxy should throw an
* {@link AopConfigException} on an attempted advice change.
*
* @author Rod Johnson
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java
index 28e48adb4f..5ac4ed7f66 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -44,9 +44,9 @@ public abstract class AopProxyUtils {
* as long as possible without side effects, that is, just for singleton targets.
* @param candidate the instance to check (might be an AOP proxy)
* @return the target class (or the plain class of the given object as fallback;
- * never null
+ * If the advice requirements cannot possibly be satisfied, then {@code null}
* is returned. By setting the {@link #setRaiseExceptions(boolean) raiseExceptions}
- * property to true, descriptive exceptions will be thrown instead of
- * returning null in the case that the parameter names cannot be discovered.
+ * property to {@code true}, descriptive exceptions will be thrown instead of
+ * returning {@code null} in the case that the parameter names cannot be discovered.
*
* @author Adrian Colyer
* @since 2.0
@@ -191,14 +191,14 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
/**
* Indicate whether {@link IllegalArgumentException} and {@link AmbiguousBindingException}
* must be thrown as appropriate in the case of failing to deduce advice parameter names.
- * @param raiseExceptions true if exceptions are to be thrown
+ * @param raiseExceptions {@code true} if exceptions are to be thrown
*/
public void setRaiseExceptions(boolean raiseExceptions) {
this.raiseExceptions = raiseExceptions;
}
/**
- * If afterReturning advice binds the return value, the
+ * If {@code afterReturning} advice binds the return value, the
* returning variable name must be specified.
* @param returningName the name of the returning variable
*/
@@ -207,7 +207,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
}
/**
- * If afterThrowing advice binds the thrown value, the
+ * If {@code afterThrowing} advice binds the thrown value, the
* throwing variable name must be specified.
* @param throwingName the name of the throwing variable
*/
@@ -305,9 +305,9 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
/**
* An advice method can never be a constructor in Spring.
- * @return null
+ * @return {@code null}
* @throws UnsupportedOperationException if
- * {@link #setRaiseExceptions(boolean) raiseExceptions} has been set to true
+ * {@link #setRaiseExceptions(boolean) raiseExceptions} has been set to {@code true}
*/
public String[] getParameterNames(Constructor ctor) {
if (this.raiseExceptions) {
@@ -493,7 +493,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
}
/**
- * Given an args pointcut body (could be args or at_args),
+ * Given an args pointcut body (could be {@code args} or {@code at_args}),
* add any candidate variable names to the given list.
*/
private void maybeExtractVariableNamesFromArgs(String argsSpec, Listtrue if the given argument type is a subclass
+ * Return {@code true} if the given argument type is a subclass
* of the given supertype.
*/
private boolean isSubtypeOf(Class supertype, int argumentNumber) {
@@ -755,7 +755,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
/*
* Find the argument index with the given type, and bind the given
- * varName in that position.
+ * {@code varName} in that position.
*/
private void findAndBind(Class argumentType, String varName) {
for (int i = 0; i < this.argumentTypes.length; i++) {
@@ -790,6 +790,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
* Thrown in response to an ambiguous binding being detected when
* trying to resolve a method's parameter names.
*/
+ @SuppressWarnings("serial")
public static class AmbiguousBindingException extends RuntimeException {
/**
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java
index 148f71ce5d..fd5b0d64c4 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterAdvice.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -36,7 +36,7 @@ public class AspectJAfterAdvice extends AbstractAspectJAdvice implements MethodI
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
-
+
public Object invoke(MethodInvocation mi) throws Throwable {
try {
return mi.proceed();
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAopUtils.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAopUtils.java
index d8fe47d3e6..2155c81cd5 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAopUtils.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAopUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -32,7 +32,7 @@ import org.springframework.aop.BeforeAdvice;
public abstract class AspectJAopUtils {
/**
- * Return true if the advisor is a form of before advice.
+ * Return {@code true} if the advisor is a form of before advice.
*/
public static boolean isBeforeAdvice(Advisor anAdvisor) {
AspectJPrecedenceInformation precedenceInfo = getAspectJPrecedenceInformationFor(anAdvisor);
@@ -43,7 +43,7 @@ public abstract class AspectJAopUtils {
}
/**
- * Return true if the advisor is a form of after advice.
+ * Return {@code true} if the advisor is a form of after advice.
*/
public static boolean isAfterAdvice(Advisor anAdvisor) {
AspectJPrecedenceInformation precedenceInfo = getAspectJPrecedenceInformationFor(anAdvisor);
@@ -56,7 +56,7 @@ public abstract class AspectJAopUtils {
/**
* Return the AspectJPrecedenceInformation provided by this advisor or its advice.
* If neither the advisor nor the advice have precedence information, this method
- * will return null.
+ * will return {@code null}.
*/
public static AspectJPrecedenceInformation getAspectJPrecedenceInformationFor(Advisor anAdvisor) {
if (anAdvisor instanceof AspectJPrecedenceInformation) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
index 348b8449c3..7e101ea57d 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -76,6 +76,7 @@ import org.springframework.util.StringUtils;
* @author Dave Syer
* @since 2.0
*/
+@SuppressWarnings("serial")
public class AspectJExpressionPointcut extends AbstractExpressionPointcut
implements ClassFilter, IntroductionAwareMethodMatcher, BeanFactoryAware {
@@ -223,9 +224,9 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
/**
* If a pointcut expression has been specified in XML, the user cannot
- * write and as "&&" (though && will work).
- * We also allow and between two pointcut sub-expressions.
- * && for the AspectJ pointcut parser.
+ * write {@code and} as "&&" (though && will work).
+ * We also allow {@code and} between two pointcut sub-expressions.
+ * bean() pointcut designator
+ * Handler for the Spring-specific {@code bean()} pointcut designator
* extension to AspectJ.
* bean() PCD. Matching context is obtained
+ * handle the {@code bean()} PCD. Matching context is obtained
* automatically by examining a thread local variable and therefore a matching
* context need not be set on the pointcut.
*/
@@ -554,7 +555,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
String advisedBeanName = getCurrentProxiedBeanName();
if (advisedBeanName == null) { // no proxy creation in progress
// abstain; can't return YES, since that will make pointcut with negation fail
- return FuzzyBoolean.MAYBE;
+ return FuzzyBoolean.MAYBE;
}
if (BeanFactoryUtils.isGeneratedBeanName(advisedBeanName)) {
return FuzzyBoolean.NO;
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java
index 001b161fe4..70b6575076 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -21,10 +21,11 @@ import org.springframework.aop.support.AbstractGenericPointcutAdvisor;
/**
* Spring AOP Advisor that can be used for any AspectJ pointcut expression.
- *
+ *
* @author Rob Harrop
* @since 2.0
*/
+@SuppressWarnings("serial")
public class AspectJExpressionPointcutAdvisor extends AbstractGenericPointcutAdvisor {
private final AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java
index 5c92ae6b4d..3463e8cc61 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJProxyUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -30,14 +30,14 @@ import org.springframework.aop.interceptor.ExposeInvocationInterceptor;
* @since 2.0
*/
public abstract class AspectJProxyUtils {
-
+
/**
* Add special advisors if necessary to work with a proxy chain that contains AspectJ advisors.
* This will expose the current Spring AOP invocation (necessary for some AspectJ pointcut matching)
* and make available the current AspectJ JoinPoint. The call will have no effect if there are no
* AspectJ advisors in the advisor chain.
* @param advisors Advisors available
- * @return true if any special {@link Advisor Advisors} were added, otherwise false.
+ * @return {@code true} if any special {@link Advisor Advisors} were added, otherwise {@code false}.
*/
public static boolean makeAdvisorChainAspectJCapableIfNecessary(List-XmessageHandlerClass:org.springframework.aop.aspectj.AspectJWeaverMessageHandler
*
* META-INF/aop.xml file:
+ * "{@code META-INF/aop.xml} file:
*
* <weaver options="..."/>
*
@@ -44,9 +44,9 @@ import org.aspectj.bridge.IMessageHandler;
public class AspectJWeaverMessageHandler implements IMessageHandler {
private static final String AJ_ID = "[AspectJ] ";
-
+
private static final Log LOGGER = LogFactory.getLog("AspectJ Weaver");
-
+
public boolean handleMessage(IMessage message) throws AbortException {
Kind messageKind = message.getKind();
@@ -56,39 +56,39 @@ public class AspectJWeaverMessageHandler implements IMessageHandler {
LOGGER.debug(makeMessageFor(message));
return true;
}
- }
-
+ }
+
if (LOGGER.isInfoEnabled()) {
if ((messageKind == IMessage.INFO) || (messageKind == IMessage.WEAVEINFO)) {
LOGGER.info(makeMessageFor(message));
return true;
}
- }
-
+ }
+
if (LOGGER.isWarnEnabled()) {
if (messageKind == IMessage.WARNING) {
LOGGER.warn(makeMessageFor(message));
return true;
}
}
-
+
if (LOGGER.isErrorEnabled()) {
if (messageKind == IMessage.ERROR) {
LOGGER.error(makeMessageFor(message));
return true;
}
}
-
+
if (LOGGER.isFatalEnabled()) {
if (messageKind == IMessage.ABORT) {
LOGGER.fatal(makeMessageFor(message));
return true;
}
}
-
+
return false;
}
-
+
private String makeMessageFor(IMessage aMessage) {
return AJ_ID + aMessage.getMessage();
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java
index a60227a5df..27618c9b46 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/DeclareParentsAdvisor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -48,7 +48,7 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor {
* @param defaultImpl the default implementation class
*/
public DeclareParentsAdvisor(Class interfaceType, String typePattern, Class defaultImpl) {
- this(interfaceType, typePattern, defaultImpl,
+ this(interfaceType, typePattern, defaultImpl,
new DelegatePerTargetObjectIntroductionInterceptor(defaultImpl, interfaceType));
}
@@ -59,7 +59,7 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor {
* @param delegateRef the delegate implementation object
*/
public DeclareParentsAdvisor(Class interfaceType, String typePattern, Object delegateRef) {
- this(interfaceType, typePattern, delegateRef.getClass(),
+ this(interfaceType, typePattern, delegateRef.getClass(),
new DelegatingIntroductionInterceptor(delegateRef));
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java
index 6668a8b015..fbdcf09313 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/MethodInvocationProceedingJoinPoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -34,11 +34,11 @@ import org.springframework.util.Assert;
* Implementation of AspectJ ProceedingJoinPoint interface
* wrapping an AOP Alliance MethodInvocation.
*
- * getThis() method returns the current Spring AOP proxy.
- * The getTarget() method returns the current Spring AOP target (which may be
- * null if there is no target), and is a plain POJO without any advice.
+ * getThis(). A common example is casting the object to an
+ * {@code getThis()}. A common example is casting the object to an
* introduced interface in the implementation of an introduction.
*
* null.
+ * Returns the Spring AOP proxy. Cannot be {@code null}.
*/
public Object getThis() {
return this.methodInvocation.getProxy();
}
/**
- * Returns the Spring AOP target. May be null if there is no target.
+ * Returns the Spring AOP target. May be {@code null} if there is no target.
*/
public Object getTarget() {
return this.methodInvocation.getThis();
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java
index 1af86cc417..fa470759cd 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/RuntimeTestWalker.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -39,12 +39,12 @@ import org.springframework.util.ReflectionUtils;
/**
* This class encapsulates some AspectJ internal knowledge that should be
- * pushed back into the AspectJ project in a future release.
+ * pushed back into the AspectJ project in a future release.
*
* ShadowMatch.getVariablesInvolvedInRuntimeTest()
+ * migrate to {@code ShadowMatch.getVariablesInvolvedInRuntimeTest()}
* or some similar operation.
*
* null).
+ * Return the specified aspect class (never {@code null}).
*/
public final Class getAspectClass() {
return this.aspectClass;
@@ -81,7 +81,7 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
* Determine a fallback order for the case that the aspect instance
* does not express an instance-specific order through implementing
* the {@link org.springframework.core.Ordered} interface.
- * Ordered.LOWEST_PRECEDENCE.
+ * Ordered.LOWEST_PRECEDENCE.
+ * typePattern is null
- * or is recognized as invalid
+ * @throws IllegalArgumentException if the supplied {@code typePattern} is {@code null}
+ * or is recognized as invalid
*/
public TypePatternClassFilter(String typePattern) {
setTypePattern(typePattern);
@@ -68,12 +68,12 @@ public class TypePatternClassFilter implements ClassFilter {
*
* org.springframework.beans.ITestBean+
*
- * This will match the ITestBean interface and any class
+ * This will match the {@code ITestBean} interface and any class
* that implements it.
* typePattern is null
- * or is recognized as invalid
+ * @throws IllegalArgumentException if the supplied {@code typePattern} is {@code null}
+ * or is recognized as invalid
*/
public void setTypePattern(String typePattern) {
Assert.notNull(typePattern);
@@ -102,9 +102,9 @@ public class TypePatternClassFilter implements ClassFilter {
/**
* If a type pattern has been specified in XML, the user cannot
- * write and as "&&" (though && will work).
- * We also allow and between two sub-expressions.
- * && for the AspectJ pointcut parser.
+ * write {@code and} as "&&" (though && will work).
+ * We also allow {@code and} between two sub-expressions.
+ * null and all beans are included. If "includePatterns" is non-null,
+ * {@code null} and all beans are included. If "includePatterns" is non-null,
* then one of the patterns must match.
*/
protected boolean isEligibleAspectBean(String beanName) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java
index d6141af1ab..36bf115105 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJAdvisorFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -40,7 +40,7 @@ public interface AspectJAdvisorFactory {
/**
* Determine whether or not the given class is an aspect, as reported
* by AspectJ's {@link org.aspectj.lang.reflect.AjTypeSystem}.
- * false if the supposed aspect is
+ * null if the method is not an AspectJ advice method
+ * @return {@code null} if the method is not an AspectJ advice method
* or if it is a pointcut that will be used by other advice but will not
* create a Spring advice in its own right
*/
@@ -89,7 +89,7 @@ public interface AspectJAdvisorFactory {
* @param aif the aspect instance factory
* @param declarationOrderInAspect the declaration order within the aspect
* @param aspectName the name of the aspect
- * @return null if the method is not an AspectJ advice method
+ * @return {@code null} if the method is not an AspectJ advice method
* or if it is a pointcut that will be used by other advice but will not
* create a Spring advice in its own right
* @see org.springframework.aop.aspectj.AspectJAroundAdvice
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java
index cbe06d3c27..b160ded0b8 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectJProxyFactory.java
@@ -46,6 +46,7 @@ import org.springframework.util.ClassUtils;
* @see #getProxy(ClassLoader)
* @see org.springframework.aop.framework.ProxyFactory
*/
+@SuppressWarnings("serial")
public class AspectJProxyFactory extends ProxyCreatorSupport {
/** Cache for singleton aspect instances */
@@ -72,7 +73,7 @@ public class AspectJProxyFactory extends ProxyCreatorSupport {
}
/**
- * Create a new AspectJProxyFactory.
+ * Create a new {@code AspectJProxyFactory}.
* No target, only interfaces. Must add interceptors.
*/
public AspectJProxyFactory(Class[] interfaces) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java
index cde9f43ef3..ccf2aa610b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/AspectMetadata.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -55,8 +55,8 @@ public class AspectMetadata {
private final Pointcut perClausePointcut;
/**
- * The name of this aspect as defined to Spring (the bean name) -
- * allows us to determine if two pieces of advice come from the
+ * The name of this aspect as defined to Spring (the bean name) -
+ * allows us to determine if two pieces of advice come from the
* same aspect and hence their relative precedence.
*/
private String aspectName;
@@ -109,7 +109,7 @@ public class AspectMetadata {
}
/**
- * Extract contents from String of form pertarget(contents).
+ * Extract contents from String of form {@code pertarget(contents)}.
*/
private String findPerClause(Class> aspectClass) {
// TODO when AspectJ provides this, we can remove this hack. Hence we don't
@@ -144,7 +144,7 @@ public class AspectMetadata {
/**
* Return a Spring pointcut expression for a singleton aspect.
- * (e.g. Pointcut.TRUE if it's a singleton).
+ * (e.g. {@code Pointcut.TRUE} if it's a singleton).
*/
public Pointcut getPerClausePointcut() {
return this.perClausePointcut;
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java
index a640e36458..81a6c2a3ad 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/BeanFactoryAspectInstanceFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -27,7 +27,7 @@ import org.springframework.util.ClassUtils;
* backed by a Spring {@link org.springframework.beans.factory.BeanFactory}.
*
* true
+ * are much richer. In AspectJ terminology, all a return of {@code true}
* means here is that the aspect is not a SINGLETON.
*/
public boolean isPerInstance() {
return (getAspectMetadata().getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON);
}
-
+
/**
* Return the AspectJ AspectMetadata for this advisor.
*/
@@ -126,7 +126,7 @@ class InstantiationModelAwarePointcutAdvisorImpl
}
return this.instantiatedAdvice;
}
-
+
public boolean isLazy() {
return this.lazy;
}
@@ -140,7 +140,7 @@ class InstantiationModelAwarePointcutAdvisorImpl
return this.atAspectJAdvisorFactory.getAdvice(
this.method, pcut, this.aspectInstanceFactory, this.declarationOrder, this.aspectName);
}
-
+
public MetadataAwareAspectInstanceFactory getAspectInstanceFactory() {
return this.aspectInstanceFactory;
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java
index 297286cbf4..1c45cbc2f6 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/NotAnAtAspectException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -26,6 +26,7 @@ import org.springframework.aop.framework.AopConfigException;
* @author Rod Johnson
* @since 2.0
*/
+@SuppressWarnings("serial")
public class NotAnAtAspectException extends AopConfigException {
private Class> nonAspectClass;
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java
index c2e356678a..f8d684bc3b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/ReflectiveAspectJAdvisorFactory.java
@@ -144,7 +144,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
* for the given introduction field.
* null if not an Advisor
+ * @return {@code null} if not an Advisor
*/
private Advisor getDeclareParentsAdvisor(Field introductionField) {
DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class);
@@ -203,7 +203,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
return null;
}
- // If we get here, we know we have an AspectJ method.
+ // If we get here, we know we have an AspectJ method.
// Check that it's an AspectJ-annotated class
if (!isAspect(candidateAspectClass)) {
throw new AopConfigException("Advice must be declared inside an aspect type: " +
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java
index 33d19a8811..bb623b372b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/SimpleMetadataAwareAspectInstanceFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -53,7 +53,7 @@ public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstan
* Determine a fallback order for the case that the aspect instance
* does not express an instance-specific order through implementing
* the {@link org.springframework.core.Ordered} interface.
- * Ordered.LOWEST_PRECEDENCE.
+ * Ordered.LOWEST_PRECEDENCE.
+ * falling back to {@code Ordered.LOWEST_PRECEDENCE}.
* @see org.springframework.core.annotation.Order
*/
@Override
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/package-info.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/package-info.java
index b0f747284b..36b3f59f3d 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/package-info.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/package-info.java
@@ -2,7 +2,7 @@
/**
*
* Classes enabling AspectJ 5 @Annotated classes to be used in Spring AOP.
- *
+ *
* a and b:
+ *
- *
@@ -106,14 +106,14 @@ class AspectJPrecedenceComparator implements Comparator {
boolean oneOrOtherIsAfterAdvice =
(AspectJAopUtils.isAfterAdvice(advisor1) || AspectJAopUtils.isAfterAdvice(advisor2));
int adviceDeclarationOrderDelta = getAspectDeclarationOrder(advisor1) - getAspectDeclarationOrder(advisor2);
-
+
if (oneOrOtherIsAfterAdvice) {
// the advice declared last has higher precedence
if (adviceDeclarationOrderDelta < 0) {
// advice1 was declared before advice2
// so advice1 has lower precedence
return LOWER_PRECEDENCE;
- }
+ }
else if (adviceDeclarationOrderDelta == 0) {
return SAME_PRECEDENCE;
}
@@ -153,7 +153,7 @@ class AspectJPrecedenceComparator implements Comparator {
}
private int getAspectDeclarationOrder(Advisor anAdvisor) {
- AspectJPrecedenceInformation precedenceInfo =
+ AspectJPrecedenceInformation precedenceInfo =
AspectJAopUtils.getAspectJPrecedenceInformationFor(anAdvisor);
if (precedenceInfo != null) {
return precedenceInfo.getDeclarationOrder();
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/package-info.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/package-info.java
index 8355bc3082..99d336b05a 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/package-info.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/package-info.java
@@ -1,12 +1,11 @@
-
/**
*
* AspectJ integration package. Includes Spring AOP advice implementations for AspectJ 5
* annotation-style methods, and an AspectJExpressionPointcut: a Spring AOP Pointcut
* implementation that allows use of the AspectJ pointcut expression language with the Spring AOP
* runtime framework.
- *
- * a and b are defined in different
+ * a and b are defined in the same
- * aspect, then if one of a or b is a form of
+ * a nor b is a
+ * highest precedence. If neither {@code a} nor {@code b} is a
* form of after advice, then the advice declared first in the aspect has
* the highest precedence.ajc compiler
+ *
+ * target property
+ * and wraps the original as an inner-bean definition for the {@code target} property
* of {@link ProxyFactoryBean}.
*
* BeanDefinition to the interceptor that
+ * BeanDefinition
+ * Subclasses should implement this method to return the {@code BeanDefinition}
* for the interceptor they wish to apply to the bean being decorated.
*/
protected abstract BeanDefinition createInterceptorDefinition(Node node);
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java b/spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java
index 4fa6a8a552..85e59523a7 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/AdviceEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -20,7 +20,7 @@ import org.springframework.beans.factory.parsing.ParseState;
/**
* {@link ParseState} entry representing an advice element.
- *
+ *
* @author Mark Fisher
* @since 2.0
*/
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java b/spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java
index 36eda24329..374e40290a 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/AdvisorComponentDefinition.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -25,7 +25,7 @@ import org.springframework.util.Assert;
/**
* {@link org.springframework.beans.factory.parsing.ComponentDefinition}
* that bridges the gap between the advisor bean definition configured
- * by the <aop:advisor> tag and the component definition
+ * by the {@code <aop:advisor>} tag and the component definition
* infrastructure.
*
* @author Rob Harrop
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java b/spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java
index fa635ae7a9..13be36d8f3 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/AdvisorEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -20,7 +20,7 @@ import org.springframework.beans.factory.parsing.ParseState;
/**
* {@link ParseState} entry representing an advisor.
- *
+ *
* @author Mark Fisher
* @since 2.0
*/
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java b/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java
index dd568a51bd..3da1f13f0a 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/AopConfigUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -31,10 +31,10 @@ import org.springframework.util.Assert;
/**
* Utility class for handling registration of AOP auto-proxy creators.
*
- * or a subclass thereof, will eventually be resident
+ * that class, {@code or a subclass thereof}, will eventually be resident
* in the application context.
*
* @author Rob Harrop
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java
index 9f0dc56d03..611376efb9 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -21,21 +21,21 @@ import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
/**
- * NamespaceHandler for the aop namespace.
+ * {@code NamespaceHandler} for the {@code aop} namespace.
*
* <aop:config> tag. A config tag can include nested
- * pointcut, advisor and aspect tags.
+ * {@code <aop:config>} tag. A {@code config} tag can include nested
+ * {@code pointcut}, {@code advisor} and {@code aspect} tags.
*
- * pointcut tag allows for creation of named
+ *
* <aop:pointcut id="getNameCalls" expression="execution(* *..ITestBean.getName(..))"/>
*
*
- * advisor tag you can configure an {@link org.springframework.aop.Advisor}
+ * advisor tag supports both in-line and referenced
+ * automatically. The {@code advisor} tag supports both in-line and referenced
* {@link org.springframework.aop.Pointcut Pointcuts}:
*
*
@@ -56,8 +56,8 @@ public class AopNamespaceHandler extends NamespaceHandlerSupport {
/**
* Register the {@link BeanDefinitionParser BeanDefinitionParsers} for the
- * 'config', 'spring-configured', 'aspectj-autoproxy'
- * and 'scoped-proxy' tags.
+ * '{@code config}', '{@code spring-configured}', '{@code aspectj-autoproxy}'
+ * and '{@code scoped-proxy}' tags.
*/
public void init() {
// In 2.0 XSD as well as in 2.1 XSD.
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java
index ae9888dca4..73ff37197c 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/AopNamespaceUtils.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -25,7 +25,7 @@ import org.springframework.beans.factory.xml.ParserContext;
/**
* Utility class for handling registration of auto-proxy creators used internally
- * by the 'aop' namespace tags.
+ * by the '{@code aop}' namespace tags.
*
* proxy-target-class attribute as found on AOP-related XML tags.
+ * The {@code proxy-target-class} attribute as found on AOP-related XML tags.
*/
public static final String PROXY_TARGET_CLASS_ATTRIBUTE = "proxy-target-class";
/**
- * The expose-proxy attribute as found on AOP-related XML tags.
+ * The {@code expose-proxy} attribute as found on AOP-related XML tags.
*/
private static final String EXPOSE_PROXY_ATTRIBUTE = "expose-proxy";
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java b/spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java
index 0aca37520b..aa3d70d11e 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/AspectJAutoProxyBeanDefinitionParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -27,7 +27,7 @@ import org.springframework.beans.factory.xml.BeanDefinitionParser;
import org.springframework.beans.factory.xml.ParserContext;
/**
- * {@link BeanDefinitionParser} for the aspectj-autoproxy tag,
+ * {@link BeanDefinitionParser} for the {@code aspectj-autoproxy} tag,
* enabling the automatic application of @AspectJ-style aspects found in
* the {@link org.springframework.beans.factory.BeanFactory}.
*
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java b/spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java
index de8beff487..9f75cba9be 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/ConfigBeanDefinitionParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2008 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -49,7 +49,7 @@ import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils;
/**
- * {@link BeanDefinitionParser} for the <aop:config> tag.
+ * {@link BeanDefinitionParser} for the {@code <aop:config>} tag.
*
* @author Rob Harrop
* @author Juergen Hoeller
@@ -93,7 +93,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
private static final int ASPECT_INSTANCE_FACTORY_INDEX = 2;
private ParseState parseState = new ParseState();
-
+
public BeanDefinition parse(Element element, ParserContext parserContext) {
CompositeComponentDefinition compositeDef =
@@ -122,8 +122,8 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
/**
* Configures the auto proxy creator needed to support the {@link BeanDefinition BeanDefinitions}
- * created by the '<aop:config/>' tag. Will force class proxying if the
- * 'proxy-target-class' attribute is set to 'true'.
+ * created by the '{@code <aop:config/>}' tag. Will force class proxying if the
+ * '{@code proxy-target-class}' attribute is set to '{@code true}'.
* @see AopNamespaceUtils
*/
private void configureAutoProxyCreator(ParserContext parserContext, Element element) {
@@ -131,7 +131,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
}
/**
- * Parses the supplied <advisor> element and registers the resulting
+ * Parses the supplied {@code <advisor>} element and registers the resulting
* {@link org.springframework.aop.Advisor} and any resulting {@link org.springframework.aop.Pointcut}
* with the supplied {@link BeanDefinitionRegistry}.
*/
@@ -168,7 +168,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
/**
* Create a {@link RootBeanDefinition} for the advisor described in the supplied. Does not
- * parse any associated 'pointcut' or 'pointcut-ref' attributes.
+ * parse any associated '{@code pointcut}' or '{@code pointcut-ref}' attributes.
*/
private AbstractBeanDefinition createAdvisorBeanDefinition(Element advisorElement, ParserContext parserContext) {
RootBeanDefinition advisorDefinition = new RootBeanDefinition(DefaultBeanFactoryPointcutAdvisor.class);
@@ -257,9 +257,9 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
}
/**
- * Return true if the supplied node describes an advice type. May be one of:
- * 'before', 'after', 'after-returning',
- * 'after-throwing' or 'around'.
+ * Return {@code true} if the supplied node describes an advice type. May be one of:
+ * '{@code before}', '{@code after}', '{@code after-returning}',
+ * '{@code after-throwing}' or '{@code around}'.
*/
private boolean isAdviceNode(Node aNode, ParserContext parserContext) {
if (!(aNode instanceof Element)) {
@@ -273,7 +273,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
}
/**
- * Parse a 'declare-parents' element and register the appropriate
+ * Parse a '{@code declare-parents}' element and register the appropriate
* DeclareParentsAdvisor with the BeanDefinitionRegistry encapsulated in the
* supplied ParserContext.
*/
@@ -281,10 +281,10 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.rootBeanDefinition(DeclareParentsAdvisor.class);
builder.addConstructorArgValue(declareParentsElement.getAttribute(IMPLEMENT_INTERFACE));
builder.addConstructorArgValue(declareParentsElement.getAttribute(TYPE_PATTERN));
-
+
String defaultImpl = declareParentsElement.getAttribute(DEFAULT_IMPL);
String delegateRef = declareParentsElement.getAttribute(DELEGATE_REF);
-
+
if (StringUtils.hasText(defaultImpl) && !StringUtils.hasText(delegateRef)) {
builder.addConstructorArgValue(defaultImpl);
}
@@ -304,8 +304,8 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
}
/**
- * Parses one of 'before', 'after', 'after-returning',
- * 'after-throwing' or 'around' and registers the resulting
+ * Parses one of '{@code before}', '{@code after}', '{@code after-returning}',
+ * '{@code after-throwing}' or '{@code around}' and registers the resulting
* BeanDefinition with the supplied BeanDefinitionRegistry.
* @return the generated advice RootBeanDefinition
*/
@@ -427,7 +427,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
}
/**
- * Parses the supplied <pointcut> and registers the resulting
+ * Parses the supplied {@code <pointcut>} and registers the resulting
* Pointcut with the BeanDefinitionRegistry.
*/
private AbstractBeanDefinition parsePointcut(Element pointcutElement, ParserContext parserContext) {
@@ -435,7 +435,7 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
String expression = pointcutElement.getAttribute(EXPRESSION);
AbstractBeanDefinition pointcutDefinition = null;
-
+
try {
this.parseState.push(new PointcutEntry(id));
pointcutDefinition = createPointcutDefinition(expression);
@@ -460,8 +460,8 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
}
/**
- * Parses the pointcut or pointcut-ref attributes of the supplied
- * {@link Element} and add a pointcut property as appropriate. Generates a
+ * Parses the {@code pointcut} or {@code pointcut-ref} attributes of the supplied
+ * {@link Element} and add a {@code pointcut} property as appropriate. Generates a
* {@link org.springframework.beans.factory.config.BeanDefinition} for the pointcut if necessary
* and returns its bean name, otherwise returns the bean name of the referred pointcut.
*/
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java b/spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java
index c308d5b833..10f6327e5c 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/PointcutEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -20,7 +20,7 @@ import org.springframework.beans.factory.parsing.ParseState;
/**
* {@link ParseState} entry representing a pointcut.
- *
+ *
* @author Mark Fisher
* @since 2.0
*/
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java b/spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java
index ac118d7096..0d2daf364f 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/ScopedProxyBeanDefinitionDecorator.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -27,7 +27,7 @@ import org.springframework.beans.factory.xml.ParserContext;
/**
* {@link BeanDefinitionDecorator} responsible for parsing the
- * <aop:scoped-proxy/> tag.
+ * {@code <aop:scoped-proxy/>} tag.
*
* @author Rob Harrop
* @author Juergen Hoeller
@@ -47,7 +47,7 @@ class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator {
proxyTargetClass = Boolean.valueOf(ele.getAttribute(PROXY_TARGET_CLASS));
}
}
-
+
// Register the original bean definition as it will be referenced by the scoped proxy
// and is relevant for tooling (validation, navigation).
BeanDefinitionHolder holder =
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java b/spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java
index cf22fddded..9e6baee932 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java
@@ -33,6 +33,7 @@ import org.springframework.util.ClassUtils;
* @author Juergen Hoeller
* @since 3.2
*/
+@SuppressWarnings("serial")
public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
implements BeanPostProcessor, BeanClassLoaderAware, Ordered {
@@ -93,7 +94,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
/**
* Check whether the given bean is eligible for advising with this
* post-processor's {@link Advisor}.
- * canApply results per bean name.
+ * this, the invocation will not be advised).
+ * (If it uses {@code this}, the invocation will not be advised).
* this no advice
+ * benefitting from advice. (If it invokes a method on {@code this} no advice
* will apply.) Getting the proxy is analogous to an EJB calling getEJBObject().
* @see AopContext
*/
@@ -110,7 +110,7 @@ public interface Advised extends TargetClassAware {
/**
* Return the advisors applying to this proxy.
- * @return a list of Advisors applying to this proxy (never null)
+ * @return a list of Advisors applying to this proxy (never {@code null})
*/
Advisor[] getAdvisors();
@@ -124,7 +124,7 @@ public interface Advised extends TargetClassAware {
*/
void addAdvisor(Advisor advisor) throws AopConfigException;
- /**
+ /**
* Add an Advisor at the specified position in the chain.
* @param advisor the advisor to add at the specified position in the chain
* @param pos position in chain (0 is head). Must be valid.
@@ -135,7 +135,7 @@ public interface Advised extends TargetClassAware {
/**
* Remove the given advisor.
* @param advisor the advisor to remove
- * @return true if the advisor was removed; false
+ * @return {@code true} if the advisor was removed; {@code false}
* if the advisor was not found and hence could not be removed
*/
boolean removeAdvisor(Advisor advisor);
@@ -165,7 +165,7 @@ public interface Advised extends TargetClassAware {
* @param a the advisor to replace
* @param b the advisor to replace it with
* @return whether it was replaced. If the advisor wasn't found in the
- * list of advisors, this method returns false and does nothing.
+ * list of advisors, this method returns {@code false} and does nothing.
* @throws AopConfigException in case of invalid advice
*/
boolean replaceAdvisor(Advisor a, Advisor b) throws AopConfigException;
@@ -174,9 +174,9 @@ public interface Advised extends TargetClassAware {
/**
* Add the given AOP Alliance advice to the tail of the advice (interceptor) chain.
* getAdvisors() method in this wrapped form.
+ * applies, and returned from the {@code getAdvisors()} method in this wrapped form.
* toString() method! Use appropriate advice implementations
+ * even to the {@code toString()} method! Use appropriate advice implementations
* or specify appropriate pointcuts to apply to a narrower set of methods.
* @param advice advice to add to the tail of the chain
* @throws AopConfigException in case of invalid advice
@@ -191,7 +191,7 @@ public interface Advised extends TargetClassAware {
* with a pointcut that always applies, and returned from the {@link #getAdvisors()}
* method in this wrapped form.
* toString() method! Use appropriate advice implementations
+ * even to the {@code toString()} method! Use appropriate advice implementations
* or specify appropriate pointcuts to apply to a narrower set of methods.
* @param pos index from 0 (head)
* @param advice advice to add at the specified position in the advice chain
@@ -202,8 +202,8 @@ public interface Advised extends TargetClassAware {
/**
* Remove the Advisor containing the given advice.
* @param advice the advice to remove
- * @return true of the advice was found and removed;
- * false if there was no such advice
+ * @return {@code true} of the advice was found and removed;
+ * {@code false} if there was no such advice
*/
boolean removeAdvice(Advice advice);
@@ -219,7 +219,7 @@ public interface Advised extends TargetClassAware {
/**
- * As toString() will normally be delegated to the target,
+ * As {@code toString()} will normally be delegated to the target,
* this returns the equivalent for the AOP proxy.
* @return a string description of the proxy configuration
*/
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java b/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java
index ebb59896ec..e5f89177b6 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/AdvisedSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -184,7 +184,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
}
/**
- * Return the advisor chain factory to use (never null).
+ * Return the advisor chain factory to use (never {@code null}).
*/
public AdvisorChainFactory getAdvisorChainFactory() {
return this.advisorChainFactory;
@@ -221,7 +221,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
* Remove a proxied interface.
* true if the interface was removed; false
+ * @return {@code true} if the interface was removed; {@code false}
* if the interface was not found and hence could not be removed
*/
public boolean removeInterface(Class intf) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopConfigException.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopConfigException.java
index 46cd1075ac..26a45a4657 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/AopConfigException.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopConfigException.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2006 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -24,6 +24,7 @@ import org.springframework.core.NestedRuntimeException;
* @author Rod Johnson
* @since 13.03.2003
*/
+@SuppressWarnings("serial")
public class AopConfigException extends NestedRuntimeException {
/**
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java
index 299ebfa31a..13a86ecb89 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -21,9 +21,9 @@ import org.springframework.core.NamedThreadLocal;
/**
* Class containing static methods used to obtain information about the current AOP invocation.
*
- * currentProxy() method is usable if the AOP framework is configured to
+ * getEJBObject()
+ * or advice can use this to make advised calls, in the same way as {@code getEJBObject()}
* can be used in EJBs. They can also use it to find advice configuration.
*
* null unless the "exposeProxy" property on
+ * Will contain {@code null} unless the "exposeProxy" property on
* the controlling proxy configuration has been set to "true".
* @see ProxyConfig#setExposeProxy
*/
@@ -53,7 +53,7 @@ public abstract class AopContext {
* Try to return the current AOP proxy. This method is usable only if the
* calling method has been invoked via AOP, and the AOP framework has been set
* to expose proxies. Otherwise, this method will throw an IllegalStateException.
- * @return Object the current AOP proxy (never returns null)
+ * @return Object the current AOP proxy (never returns {@code null})
* @throws IllegalStateException if the proxy cannot be found, because the
* method was invoked outside an AOP invocation context, or because the
* AOP framework has not been configured to expose the proxy
@@ -68,10 +68,10 @@ public abstract class AopContext {
}
/**
- * Make the given proxy available via the currentProxy() method.
+ * Make the given proxy available via the {@code currentProxy()} method.
* null to reset it)
- * @return the old proxy, which may be null if none was bound
+ * @param proxy the proxy to expose (or {@code null} to reset it)
+ * @return the old proxy, which may be {@code null} if none was bound
* @see #currentProxy()
*/
static Object setCurrentProxy(Object proxy) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxy.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxy.java
index 2fe5af6c35..80c6690564 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxy.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxy.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -33,20 +33,20 @@ public interface AopProxy {
* Create a new proxy object.
* null)
- * @see java.lang.Thread#getContextClassLoader()
+ * @return the new proxy object (never {@code null})
+ * @see Thread#getContextClassLoader()
*/
Object getProxy();
/**
* Create a new proxy object.
* null will simply be passed down and thus lead to the low-level
+ * {@code null} will simply be passed down and thus lead to the low-level
* proxy facility's default, which is usually different from the default chosen
* by the AopProxy implementation's {@link #getProxy()} method.
* @param classLoader the class loader to create the proxy with
- * (or null for the low-level proxy facility's default)
- * @return the new proxy object (never null)
+ * (or {@code null} for the low-level proxy facility's default)
+ * @return the new proxy object (never {@code null})
*/
Object getProxy(ClassLoader classLoader);
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java
index d97934f16c..9a2e2298e4 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/AopProxyFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2007 the original author or authors.
+ * Copyright 2002-2012 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.
@@ -35,7 +35,7 @@ package org.springframework.aop.framework;
*
* null)
+ * never {@code null})
* @see org.springframework.aop.TargetClassAware#getTargetClass()
- * @see org.springframework.aop.framework.Advised#getTargetSource()
+ * @see Advised#getTargetSource()
*/
public static Class> ultimateTargetClass(Object candidate) {
Assert.notNull(candidate, "Candidate object must not be null");
@@ -112,7 +112,7 @@ public abstract class AopProxyUtils {
* i.e. all non-Advised interfaces that the proxy implements.
* @param proxy the proxy to analyze (usually a JDK dynamic proxy)
* @return all user-specified interfaces that the proxy implements,
- * in the original order (never null or empty)
+ * in the original order (never {@code null} or empty)
* @see Advised
*/
public static Class[] proxiedUserInterfaces(Object proxy) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java b/spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
index bbf7015e0a..5801458ff0 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
@@ -234,7 +234,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
}
/**
- * Checks to see whether the supplied Class has already been validated and
+ * Checks to see whether the supplied {@code Class} has already been validated and
* validates it if not.
*/
private void validateClassIfNecessary(Class> proxySuperClass) {
@@ -249,7 +249,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
}
/**
- * Checks for final methods on the Class and writes warnings to the log
+ * Checks for final methods on the {@code Class} and writes warnings to the log
* for each one found.
*/
private void doValidateClass(Class> proxySuperClass) {
@@ -376,7 +376,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
* Method interceptor used for static targets with no advice chain. The call
* is passed directly back to the target. Used when the proxy needs to be
* exposed and it can't be determined that the method won't return
- * this.
+ * {@code this}.
*/
private static class StaticUnadvisedInterceptor implements MethodInterceptor, Serializable {
@@ -509,7 +509,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
/**
- * Dispatcher for the equals method.
+ * Dispatcher for the {@code equals} method.
* Ensures that the method call is always handled by this class.
*/
private static class EqualsInterceptor implements MethodInterceptor, Serializable {
@@ -541,7 +541,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
/**
- * Dispatcher for the hashCode method.
+ * Dispatcher for the {@code hashCode} method.
* Ensures that the method call is always handled by this class.
*/
private static class HashCodeInterceptor implements MethodInterceptor, Serializable {
@@ -609,7 +609,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
oldProxy = AopContext.setCurrentProxy(proxy);
setProxyContext = true;
}
- // May be null. Get as late as possible to minimize the time we
+ // May be null Get as late as possible to minimize the time we
// "own" the target, in case it comes from a pool.
target = getTarget();
if (target != null) {
@@ -745,11 +745,11 @@ final class CglibAopProxy implements AopProxy, Serializable {
* invoke the advice chain. Otherwise a DyanmicAdvisedInterceptor is
* used.
* this
- * or when ProxyFactory.getExposeProxy() returns false,
+ * this then a
+ * If it possible for the method to return {@code this} then a
* StaticUnadvisedInterceptor is used for static targets - the
* DynamicUnadvisedInterceptor already considers this.