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/CONTRIBUTING.md b/CONTRIBUTING.md
index f06867ea7d..71739dc400 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -47,17 +47,13 @@ future pull requests as well, simply so the Spring Framework team knows
immediately that this process is complete.
-## Create your branch from `master`
+## Create your branch from `3.2.x`
-At any given time, Spring Framework's `master` branch represents the version
-currently under development. For example, if 3.1.1 was the latest Spring
-Framework release, `master` represents 3.2.0 development, and the `3.1.x`
-branch represents 3.1.2 development.
-
-Create your topic branch to be submitted as a pull request from `master`. The
-Spring team will consider your pull request for backporting to maintenance
-versions (e.g. 3.1.2) on a case-by-case basis; you don't need to worry about
-submitting anything for backporting.
+If your pull request addresses a bug or improvement, please create your branch
+Spring Framework's `3.2.x` branch. `master` is reserved for work on new features
+for the next major version of the framework. Rest assured that if your pull
+request is accepted and merged into `3.2.x`, these changes will also eventually
+be merged into `master`.
## Use short branch names
diff --git a/build.gradle b/build.gradle
index fd4a12d057..7cc210cf45 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.6
+ targetCompatibility=1.6
+ }
+ 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"))
@@ -335,10 +413,11 @@ project("spring-jms") {
compile(project(":spring-tx"))
optional(project(":spring-oxm"))
compile("aopalliance:aopalliance:1.0")
- optional("org.codehaus.jackson:jackson-mapper-asl:1.4.2")
provided("org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1")
optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
optional("javax.resource:connector-api:1.5")
+ optional("org.codehaus.jackson:jackson-mapper-asl:1.4.2")
+ optional("com.fasterxml.jackson.core:jackson-databind:2.0.1")
}
}
@@ -430,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")
@@ -628,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..8e5ccc1fa6 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,11 +34,12 @@ 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}
*/
+ @Override
Class> getTargetClass();
/**
@@ -46,7 +47,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..1d622196f7 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,24 +23,26 @@ import java.io.Serializable;
*
* @author Rod Johnson
*/
+@SuppressWarnings("serial")
class TrueClassFilter implements ClassFilter, Serializable {
-
+
public static final TrueClassFilter INSTANCE = new TrueClassFilter();
-
+
/**
* Enforce Singleton pattern.
*/
private TrueClassFilter() {
}
+ @Override
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..b4722cdf00 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,38 +24,42 @@ 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.
*/
private TrueMethodMatcher() {
}
+ @Override
public boolean isRuntime() {
return false;
}
+ @Override
public boolean matches(Method method, Class targetClass) {
return true;
}
+ @Override
public boolean matches(Method method, Class targetClass, Object[] args) {
// 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..1a44c2ac26 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,28 +23,31 @@ import java.io.Serializable;
*
* @author Rod Johnson
*/
+@SuppressWarnings("serial")
class TruePointcut implements Pointcut, Serializable {
-
+
public static final TruePointcut INSTANCE = new TruePointcut();
-
+
/**
* Enforce Singleton pattern.
*/
private TruePointcut() {
}
+ @Override
public ClassFilter getClassFilter() {
return ClassFilter.TRUE;
}
+ @Override
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..3a6436c7f8 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
@@ -203,6 +203,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
return this.aspectInstanceFactory.getAspectClassLoader();
}
+ @Override
public int getOrder() {
return this.aspectInstanceFactory.getOrder();
}
@@ -211,7 +212,8 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
public void setAspectName(String name) {
this.aspectName = name;
}
-
+
+ @Override
public String getAspectName() {
return this.aspectName;
}
@@ -223,6 +225,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
this.declarationOrder = order;
}
+ @Override
public int getDeclarationOrder() {
return this.declarationOrder;
}
@@ -268,7 +271,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 +305,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 +350,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 +368,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 +401,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
}
else {
return false;
- }
+ }
}
protected boolean supportsProceedingJoinPoint() {
@@ -409,7 +412,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
if (candidateParameterType.equals(JoinPoint.StaticPart.class)) {
this.joinPointStaticPartArgumentIndex = 0;
return true;
- }
+ }
else {
return false;
}
@@ -422,7 +425,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 +474,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 +485,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 +528,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
pointcutParameterTypes[index] = methodParameterTypes[i];
index++;
}
-
+
this.pointcut.setParameterNames(pointcutParameterNames);
this.pointcut.setParameterTypes(pointcutParameterTypes);
}
@@ -549,7 +552,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 +585,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)");
}
@@ -678,6 +681,7 @@ public abstract class AbstractAspectJAdvice implements Advice, AspectJPrecedence
this.adviceMethod = adviceMethod;
}
+ @Override
public boolean matches(Method method, Class targetClass) {
return !this.adviceMethod.equals(method);
}
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..0fbeed07b8 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:
*
*
If the first parameter of the method is of type {@link JoinPoint}
* or {@link ProceedingJoinPoint}, it is assumed to be for passing
- * thisJoinPoint to the advice, and the parameter name will
- * be assigned the value "thisJoinPoint".
+ * {@code thisJoinPoint} to the advice, and the parameter name will
+ * be assigned the value {@code "thisJoinPoint"}.
*
If the first parameter of the method is of type
- * JoinPoint.StaticPart, it is assumed to be for passing
- * "thisJoinPointStaticPart" to the advice, and the parameter name
- * will be assigned the value "thisJoinPointStaticPart".
+ * {@code JoinPoint.StaticPart}, it is assumed to be for passing
+ * {@code "thisJoinPointStaticPart"} to the advice, and the parameter name
+ * will be assigned the value {@code "thisJoinPointStaticPart"}.
*
If a {@link #setThrowingName(String) throwingName} has been set, and
- * there are no unbound arguments of type 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>.
*
If there remain unbound arguments, then the pointcut expression is
- * examined. Let 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.
*
If a returningName has been set, and there are no unbound arguments
- * then an 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>.
*
If there remain unbound arguments, then the pointcut expression is
- * examined once more for 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.
+ * possibilities, an {@code 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 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
*/
@@ -222,6 +222,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
* @param method the target {@link Method}
* @return the parameter names
*/
+ @Override
public String[] getParameterNames(Method method) {
this.argumentTypes = method.getParameterTypes();
this.numberOfRemainingUnboundArguments = this.argumentTypes.length;
@@ -305,10 +306,11 @@ 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}
*/
+ @Override
public String[] getParameterNames(Constructor ctor) {
if (this.raiseExceptions) {
throw new UnsupportedOperationException("An advice method can never be a constructor");
@@ -493,7 +495,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, List varNames) {
@@ -700,7 +702,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
// 1 primitive arg, and one candidate...
for (int i = 0; i < this.argumentTypes.length; i++) {
if (isUnbound(i) && this.argumentTypes[i].isPrimitive()) {
- bindParameterName(i, (String) varNames.get(0));
+ bindParameterName(i, varNames.get(0));
break;
}
}
@@ -726,7 +728,7 @@ public class AspectJAdviceParameterNameDiscoverer implements ParameterNameDiscov
}
/*
- * Return true 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 +757,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 +792,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..c6669af251 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,8 @@ public class AspectJAfterAdvice extends AbstractAspectJAdvice implements MethodI
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
-
+
+ @Override
public Object invoke(MethodInvocation mi) throws Throwable {
try {
return mi.proceed();
@@ -46,10 +47,12 @@ public class AspectJAfterAdvice extends AbstractAspectJAdvice implements MethodI
}
}
+ @Override
public boolean isBeforeAdvice() {
return false;
}
+ @Override
public boolean isAfterAdvice() {
return true;
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterReturningAdvice.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterReturningAdvice.java
index 2f9396c230..6ae24d5d7b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterReturningAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterReturningAdvice.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,10 +40,12 @@ public class AspectJAfterReturningAdvice extends AbstractAspectJAdvice implement
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
+ @Override
public boolean isBeforeAdvice() {
return false;
}
+ @Override
public boolean isAfterAdvice() {
return true;
}
@@ -53,6 +55,7 @@ public class AspectJAfterReturningAdvice extends AbstractAspectJAdvice implement
setReturningNameNoCheck(name);
}
+ @Override
public void afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable {
if (shouldInvokeOnReturnValueOf(method, returnValue)) {
invokeAdviceMethod(getJoinPointMatch(), returnValue, null);
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterThrowingAdvice.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterThrowingAdvice.java
index 6b9b611b96..a7bef4b213 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterThrowingAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAfterThrowingAdvice.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.
@@ -37,10 +37,12 @@ public class AspectJAfterThrowingAdvice extends AbstractAspectJAdvice implements
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
+ @Override
public boolean isBeforeAdvice() {
return false;
}
+ @Override
public boolean isAfterAdvice() {
return true;
}
@@ -50,6 +52,7 @@ public class AspectJAfterThrowingAdvice extends AbstractAspectJAdvice implements
setThrowingNameNoCheck(name);
}
+ @Override
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/AspectJAroundAdvice.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAroundAdvice.java
index 3048103a10..b9c546342b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAroundAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJAroundAdvice.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.
@@ -41,10 +41,12 @@ public class AspectJAroundAdvice extends AbstractAspectJAdvice implements Method
super(aspectJAroundAdviceMethod, pointcut, aif);
}
+ @Override
public boolean isBeforeAdvice() {
return false;
}
+ @Override
public boolean isAfterAdvice() {
return false;
}
@@ -55,6 +57,7 @@ public class AspectJAroundAdvice extends AbstractAspectJAdvice implements Method
}
+ @Override
public Object invoke(MethodInvocation mi) throws Throwable {
if (!(mi instanceof ProxyMethodInvocation)) {
throw new IllegalStateException("MethodInvocation is not a Spring ProxyMethodInvocation: " + mi);
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..2f92de4f8f 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 {
@@ -154,16 +155,19 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
this.pointcutParameterTypes = types;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
+ @Override
public ClassFilter getClassFilter() {
checkReadyToMatch();
return this;
}
+ @Override
public MethodMatcher getMethodMatcher() {
checkReadyToMatch();
return this;
@@ -223,9 +227,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.
- *
This method converts back to && for the AspectJ pointcut parser.
+ * write {@code and} as "&&" (though && will work).
+ * We also allow {@code and} between two pointcut sub-expressions.
+ *
This method converts back to {@code &&} for the AspectJ pointcut parser.
*/
private String replaceBooleanOperators(String pcExpr) {
String result = StringUtils.replace(pcExpr, " and ", " && ");
@@ -243,6 +247,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
return this.pointcutExpression;
}
+ @Override
public boolean matches(Class targetClass) {
checkReadyToMatch();
try {
@@ -259,13 +264,14 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
ex);
return false;
}
- }
+ }
catch (BCException ex) {
logger.debug("PointcutExpression matching rejected target class", ex);
return false;
}
}
+ @Override
public boolean matches(Method method, Class targetClass, boolean beanHasIntroductions) {
checkReadyToMatch();
Method targetMethod = AopUtils.getMostSpecificMethod(method, targetClass);
@@ -286,15 +292,18 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
}
}
+ @Override
public boolean matches(Method method, Class targetClass) {
return matches(method, targetClass, false);
}
+ @Override
public boolean isRuntime() {
checkReadyToMatch();
return this.pointcutExpression.mayNeedDynamicTest();
}
+ @Override
public boolean matches(Method method, Class targetClass, Object[] args) {
checkReadyToMatch();
ShadowMatch shadowMatch = getShadowMatch(AopUtils.getMostSpecificMethod(method, targetClass), method);
@@ -494,10 +503,10 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
/**
- * Handler for the Spring-specific bean() pointcut designator
+ * Handler for the Spring-specific {@code bean()} pointcut designator
* extension to AspectJ.
*
This handler must be added to each pointcut object that needs to
- * handle the 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.
*/
@@ -505,10 +514,12 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
private static final String BEAN_DESIGNATOR_NAME = "bean";
+ @Override
public String getDesignatorName() {
return BEAN_DESIGNATOR_NAME;
}
+ @Override
public ContextBasedMatcher parse(String expression) {
return new BeanNameContextMatcher(expression);
}
@@ -530,22 +541,27 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
this.expressionPattern = new NamePattern(expression);
}
+ @Override
public boolean couldMatchJoinPointsInType(Class someClass) {
return (contextMatch(someClass) == FuzzyBoolean.YES);
}
+ @Override
public boolean couldMatchJoinPointsInType(Class someClass, MatchingContext context) {
return (contextMatch(someClass) == FuzzyBoolean.YES);
}
+ @Override
public boolean matchesDynamically(MatchingContext context) {
return true;
}
+ @Override
public FuzzyBoolean matchesStatically(MatchingContext context) {
return contextMatch(null);
}
+ @Override
public boolean mayNeedDynamicTest() {
return false;
}
@@ -554,7 +570,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;
@@ -610,18 +626,22 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
this.other = other;
}
+ @Override
public boolean alwaysMatches() {
return primary.alwaysMatches();
}
+ @Override
public boolean maybeMatches() {
return primary.maybeMatches();
}
+ @Override
public boolean neverMatches() {
return primary.neverMatches();
}
+ @Override
public JoinPointMatch matchesJoinPoint(Object thisObject,
Object targetObject, Object[] args) {
try {
@@ -631,6 +651,7 @@ public class AspectJExpressionPointcut extends AbstractExpressionPointcut
}
}
+ @Override
public void setMatchingContext(MatchingContext aMatchContext) {
primary.setMatchingContext(aMatchContext);
other.setMatchingContext(aMatchContext);
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..5354360cd4 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,15 +21,17 @@ 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();
+ @Override
public Pointcut getPointcut() {
return this.pointcut;
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJMethodBeforeAdvice.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJMethodBeforeAdvice.java
index 503119714f..6f7ce26b39 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJMethodBeforeAdvice.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJMethodBeforeAdvice.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.
@@ -35,14 +35,17 @@ public class AspectJMethodBeforeAdvice extends AbstractAspectJAdvice implements
super(aspectJBeforeAdviceMethod, pointcut, aif);
}
+ @Override
public void before(Method method, Object[] args, Object target) throws Throwable {
invokeAdviceMethod(getJoinPointMatch(), null, null);
}
+ @Override
public boolean isBeforeAdvice() {
return true;
}
+ @Override
public boolean isAfterAdvice() {
return false;
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJPointcutAdvisor.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJPointcutAdvisor.java
index 2b8950a0e6..14ad6c67a9 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJPointcutAdvisor.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJPointcutAdvisor.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.
@@ -56,18 +56,22 @@ public class AspectJPointcutAdvisor implements PointcutAdvisor, Ordered {
}
+ @Override
public boolean isPerInstance() {
return true;
}
+ @Override
public Advice getAdvice() {
return this.advice;
}
+ @Override
public Pointcut getPointcut() {
return this.pointcut;
}
+ @Override
public int getOrder() {
if (this.order != null) {
return this.order;
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 advisors) {
// Don't add advisors to an empty list; may indicate that proxying is just not required
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java
index 8932259dc3..c6e568b7d8 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJWeaverMessageHandler.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.
@@ -27,13 +27,13 @@ import org.aspectj.bridge.IMessageHandler;
* Implementation of AspectJ's {@link IMessageHandler} interface that
* routes AspectJ weaving messages through the same logging system as the
* regular Spring messages.
- *
+ *
*
to the weaver; for example, specifying the following in a
- * "META-INF/aop.xml file:
+ * "{@code META-INF/aop.xml} file:
*
*
<weaver options="..."/>
*
@@ -44,10 +44,11 @@ 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");
-
+ private static final Log LOGGER = LogFactory.getLog("AspectJ Weaver");
+
+
+ @Override
public boolean handleMessage(IMessage message) throws AbortException {
Kind messageKind = message.getKind();
@@ -56,52 +57,55 @@ 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();
}
+ @Override
public boolean isIgnoring(Kind messageKind) {
// We want to see everything, and allow configuration of log levels dynamically.
return false;
}
+ @Override
public void dontIgnore(Kind messageKind) {
// We weren't ignoring anything anyway...
}
+ @Override
public void ignore(Kind kind) {
// We weren't ignoring anything anyway...
}
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..0d1a84247b 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));
}
@@ -77,6 +77,7 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor {
// Excludes methods implemented.
ClassFilter exclusion = new ClassFilter() {
+ @Override
public boolean matches(Class clazz) {
return !(introducedInterface.isAssignableFrom(clazz));
}
@@ -87,22 +88,27 @@ public class DeclareParentsAdvisor implements IntroductionAdvisor {
}
+ @Override
public ClassFilter getClassFilter() {
return this.typePatternClassFilter;
}
+ @Override
public void validateInterfaces() throws IllegalArgumentException {
// Do nothing
}
+ @Override
public boolean isPerInstance() {
return true;
}
+ @Override
public Advice getAdvice() {
return this.advice;
}
+ @Override
public Class[] getInterfaces() {
return new Class[] {this.introducedInterface};
}
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..952706078e 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.
*
- *
Note: the 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.
+ *
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
- * 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.
*
*
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;
@@ -72,14 +72,17 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
this.methodInvocation = methodInvocation;
}
+ @Override
public void set$AroundClosure(AroundClosure aroundClosure) {
throw new UnsupportedOperationException();
}
+ @Override
public Object proceed() throws Throwable {
return this.methodInvocation.invocableClone().proceed();
}
+ @Override
public Object proceed(Object[] arguments) throws Throwable {
Assert.notNull(arguments, "Argument array passed to proceed cannot be null");
if (arguments.length != this.methodInvocation.getArguments().length) {
@@ -92,19 +95,22 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
}
/**
- * Returns the Spring AOP proxy. Cannot be null.
+ * Returns the Spring AOP proxy. Cannot be {@code null}.
*/
+ @Override
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.
*/
+ @Override
public Object getTarget() {
return this.methodInvocation.getThis();
}
+ @Override
public Object[] getArgs() {
if (this.defensiveCopyOfArgs == null) {
Object[] argsSource = this.methodInvocation.getArguments();
@@ -114,6 +120,7 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
return this.defensiveCopyOfArgs;
}
+ @Override
public Signature getSignature() {
if (this.signature == null) {
this.signature = new MethodSignatureImpl();
@@ -121,6 +128,7 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
return signature;
}
+ @Override
public SourceLocation getSourceLocation() {
if (this.sourceLocation == null) {
this.sourceLocation = new SourceLocationImpl();
@@ -128,23 +136,28 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
return this.sourceLocation;
}
+ @Override
public String getKind() {
return ProceedingJoinPoint.METHOD_EXECUTION;
}
+ @Override
public int getId() {
// TODO: It's just an adapter but returning 0 might still have side effects...
return 0;
}
+ @Override
public JoinPoint.StaticPart getStaticPart() {
return this;
}
+ @Override
public String toShortString() {
return "execution(" + getSignature().toShortString() + ")";
}
+ @Override
public String toLongString() {
return "execution(" + getSignature().toLongString() + ")";
}
@@ -161,34 +174,42 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
private volatile String[] parameterNames;
+ @Override
public String getName() {
return methodInvocation.getMethod().getName();
}
+ @Override
public int getModifiers() {
return methodInvocation.getMethod().getModifiers();
}
+ @Override
public Class getDeclaringType() {
return methodInvocation.getMethod().getDeclaringClass();
}
+ @Override
public String getDeclaringTypeName() {
return methodInvocation.getMethod().getDeclaringClass().getName();
}
+ @Override
public Class getReturnType() {
return methodInvocation.getMethod().getReturnType();
}
+ @Override
public Method getMethod() {
return methodInvocation.getMethod();
}
+ @Override
public Class[] getParameterTypes() {
return methodInvocation.getMethod().getParameterTypes();
}
+ @Override
public String[] getParameterNames() {
if (this.parameterNames == null) {
this.parameterNames = (new LocalVariableTableParameterNameDiscoverer()).getParameterNames(getMethod());
@@ -196,14 +217,17 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
return this.parameterNames;
}
+ @Override
public Class[] getExceptionTypes() {
return methodInvocation.getMethod().getExceptionTypes();
}
+ @Override
public String toShortString() {
return toString(false, false, false, false);
}
+ @Override
public String toLongString() {
return toString(true, true, true, true);
}
@@ -267,6 +291,7 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
*/
private class SourceLocationImpl implements SourceLocation {
+ @Override
public Class getWithinType() {
if (methodInvocation.getThis() == null) {
throw new UnsupportedOperationException("No source location joinpoint available: target is null");
@@ -274,14 +299,17 @@ public class MethodInvocationProceedingJoinPoint implements ProceedingJoinPoint,
return methodInvocation.getThis().getClass();
}
+ @Override
public String getFileName() {
throw new UnsupportedOperationException();
}
+ @Override
public int getLine() {
throw new UnsupportedOperationException();
}
+ @Override
public int getColumn() {
throw new UnsupportedOperationException();
}
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..7d52c03615 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.
*
*
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 ShadowMatch.getVariablesInvolvedInRuntimeTest()
+ * migrate to {@code ShadowMatch.getVariablesInvolvedInRuntimeTest()}
* or some similar operation.
*
*
See .
@@ -106,38 +106,47 @@ class RuntimeTestWalker {
protected static final int AT_TARGET_VAR = 4;
protected static final int AT_ANNOTATION_VAR = 8;
+ @Override
public void visit(And e) {
e.getLeft().accept(this);
e.getRight().accept(this);
}
+ @Override
public void visit(Or e) {
e.getLeft().accept(this);
e.getRight().accept(this);
}
+ @Override
public void visit(Not e) {
e.getBody().accept(this);
}
+ @Override
public void visit(Instanceof i) {
}
+ @Override
public void visit(Literal literal) {
}
+ @Override
public void visit(Call call) {
}
+ @Override
public void visit(FieldGetCall fieldGetCall) {
}
+ @Override
public void visit(HasAnnotation hasAnnotation) {
}
+ @Override
public void visit(MatchingContextBasedTest matchingContextTest) {
}
-
+
protected int getVarType(ReflectionVar v) {
try {
Field varTypeField = ReflectionVar.class.getDeclaredField("varType");
@@ -169,7 +178,7 @@ class RuntimeTestWalker {
this.matches = defaultMatches;
this.matchVarType = matchVarType;
}
-
+
public boolean instanceOfMatches(Test test) {
test.accept(this);
return matches;
@@ -236,7 +245,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..dfb36d6a72 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,13 +42,14 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
}
/**
- * Return the specified aspect class (never null).
+ * Return the specified aspect class (never {@code null}).
*/
public final Class getAspectClass() {
return this.aspectClass;
}
+ @Override
public final Object getAspectInstance() {
try {
return this.aspectClass.newInstance();
@@ -61,6 +62,7 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
}
}
+ @Override
public ClassLoader getAspectClassLoader() {
return this.aspectClass.getClassLoader();
}
@@ -73,6 +75,7 @@ public class SimpleAspectInstanceFactory implements AspectInstanceFactory {
* @see org.springframework.core.Ordered
* @see #getOrderForAspectClass
*/
+ @Override
public int getOrder() {
return getOrderForAspectClass(this.aspectClass);
}
@@ -81,7 +84,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.
- *
The default implementation simply returns Ordered.LOWEST_PRECEDENCE.
+ *
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..1e8f723efb 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;
@@ -44,10 +44,12 @@ public class SingletonAspectInstanceFactory implements AspectInstanceFactory {
}
+ @Override
public final Object getAspectInstance() {
return this.aspectInstance;
}
+ @Override
public ClassLoader getAspectClassLoader() {
return this.aspectInstance.getClass().getClassLoader();
}
@@ -60,6 +62,7 @@ public class SingletonAspectInstanceFactory implements AspectInstanceFactory {
* @see org.springframework.core.Ordered
* @see #getOrderForAspectClass
*/
+ @Override
public int getOrder() {
if (this.aspectInstance instanceof Ordered) {
return ((Ordered) this.aspectInstance).getOrder();
@@ -71,7 +74,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 Ordered.LOWEST_PRECEDENCE.
+ *
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..f2893fc583 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 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.
*
These conventions are established by AspectJ, not Spring AOP.
* @param typePattern the type pattern that AspectJ weaver should parse
- * @throws IllegalArgumentException if the supplied 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);
@@ -93,6 +93,7 @@ public class TypePatternClassFilter implements ClassFilter {
* @return whether the advice should apply to this candidate target class
* @throws IllegalStateException if no {@link #setTypePattern(String)} has been set
*/
+ @Override
public boolean matches(Class clazz) {
if (this.aspectJTypePatternMatcher == null) {
throw new IllegalStateException("No 'typePattern' has been set via ctor/setter.");
@@ -102,9 +103,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.
- *
This method converts back to && for the AspectJ pointcut parser.
+ * write {@code and} as "&&" (though && will work).
+ * We also allow {@code and} between two sub-expressions.
+ *
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..add6c5fac2 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();
@@ -111,6 +111,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
* is that aspects written in the code-style (AspectJ language) also have the annotation present
* when compiled by ajc with the -1.5 flag, yet they cannot be consumed by Spring AOP.
*/
+ @Override
public boolean isAspect(Class> clazz) {
return (hasAspectAnnotation(clazz) && !compiledByAjc(clazz));
}
@@ -121,7 +122,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
@@ -135,6 +136,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
return false;
}
+ @Override
public void validate(Class> aspectClass) throws AopConfigException {
// If the parent has the annotation and isn't abstract it's an error
if (aspectClass.getSuperclass().getAnnotation(Aspect.class) != null &&
@@ -154,11 +156,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 +171,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
@@ -309,6 +311,7 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
*/
private static class AspectJAnnotationParameterNameDiscoverer implements ParameterNameDiscoverer {
+ @Override
public String[] getParameterNames(Method method) {
if (method.getParameterTypes().length == 0) {
return new String[0];
@@ -326,10 +329,11 @@ public abstract class AbstractAspectJAdvisorFactory implements AspectJAdvisorFac
return names;
}
else {
- return null;
+ return null;
}
}
-
+
+ @Override
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 includePatterns;
@@ -103,7 +104,7 @@ public class AnnotationAwareAspectJAutoProxyCreator extends AspectJAwareAdvisorA
/**
* Check whether the given aspect bean is eligible for auto-proxying.
*
If no <aop:include> elements were used then "includePatterns" will be
- * 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}.
- *
Will simply return false if the supposed aspect is
+ *
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 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..855af77216 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}.
*
*
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
@@ -72,10 +72,12 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
}
+ @Override
public Object getAspectInstance() {
return this.beanFactory.getBean(this.name);
}
+ @Override
public ClassLoader getAspectClassLoader() {
if (this.beanFactory instanceof ConfigurableBeanFactory) {
return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader();
@@ -85,6 +87,7 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
}
}
+ @Override
public AspectMetadata getAspectMetadata() {
return this.aspectMetadata;
}
@@ -99,6 +102,7 @@ public class BeanFactoryAspectInstanceFactory implements MetadataAwareAspectInst
* @see org.springframework.core.Ordered
* @see org.springframework.core.annotation.Order
*/
+ @Override
public int getOrder() {
Class> type = this.beanFactory.getType(this.name);
if (type != null) {
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..2d16ece7c5 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.
@@ -97,19 +97,21 @@ class InstantiationModelAwarePointcutAdvisorImpl
* The pointcut for Spring AOP to use. Actual behaviour of the pointcut will change
* depending on the state of the advice.
*/
+ @Override
public Pointcut getPointcut() {
return this.pointcut;
}
/**
* This is only of interest for Spring AOP: AspectJ instantiation semantics
- * are much richer. In AspectJ terminology, all a return of true
+ * are much richer. In AspectJ terminology, all a return of {@code true}
* means here is that the aspect is not a SINGLETON.
*/
+ @Override
public boolean isPerInstance() {
return (getAspectMetadata().getAjType().getPerClause().getKind() != PerClauseKind.SINGLETON);
}
-
+
/**
* Return the AspectJ AspectMetadata for this advisor.
*/
@@ -120,17 +122,20 @@ class InstantiationModelAwarePointcutAdvisorImpl
/**
* Lazily instantiate advice if necessary.
*/
+ @Override
public synchronized Advice getAdvice() {
if (this.instantiatedAdvice == null) {
this.instantiatedAdvice = instantiateAdvice(this.declaredPointcut);
}
return this.instantiatedAdvice;
}
-
+
+ @Override
public boolean isLazy() {
return this.lazy;
}
+ @Override
public synchronized boolean isAdviceInstantiated() {
return (this.instantiatedAdvice != null);
}
@@ -140,7 +145,7 @@ class InstantiationModelAwarePointcutAdvisorImpl
return this.atAspectJAdvisorFactory.getAdvice(
this.method, pcut, this.aspectInstanceFactory, this.declarationOrder, this.aspectName);
}
-
+
public MetadataAwareAspectInstanceFactory getAspectInstanceFactory() {
return this.aspectInstanceFactory;
}
@@ -149,18 +154,22 @@ class InstantiationModelAwarePointcutAdvisorImpl
return this.declaredPointcut;
}
+ @Override
public int getOrder() {
return this.aspectInstanceFactory.getOrder();
}
+ @Override
public String getAspectName() {
return this.aspectName;
}
+ @Override
public int getDeclarationOrder() {
return this.declarationOrder;
}
+ @Override
public boolean isBeforeAdvice() {
if (this.isBeforeAdvice == null) {
determineAdviceType();
@@ -168,6 +177,7 @@ class InstantiationModelAwarePointcutAdvisorImpl
return this.isBeforeAdvice;
}
+ @Override
public boolean isAfterAdvice() {
if (this.isAfterAdvice == null) {
determineAdviceType();
@@ -245,6 +255,7 @@ class InstantiationModelAwarePointcutAdvisorImpl
this.preInstantiationPointcut.getMethodMatcher().matches(method, targetClass);
}
+ @Override
public boolean matches(Method method, Class targetClass, Object[] args) {
// This can match only on declared pointcut.
return (isAspectMaterialized() && this.declaredPointcut.matches(method, targetClass));
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/LazySingletonAspectInstanceFactoryDecorator.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/LazySingletonAspectInstanceFactoryDecorator.java
index 39d28fff7e..36bb4eeb42 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/LazySingletonAspectInstanceFactoryDecorator.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/annotation/LazySingletonAspectInstanceFactoryDecorator.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,6 +42,7 @@ public class LazySingletonAspectInstanceFactoryDecorator implements MetadataAwar
}
+ @Override
public synchronized Object getAspectInstance() {
if (this.materialized == null) {
synchronized (this) {
@@ -57,14 +58,17 @@ public class LazySingletonAspectInstanceFactoryDecorator implements MetadataAwar
return (this.materialized != null);
}
+ @Override
public ClassLoader getAspectClassLoader() {
return this.maaif.getAspectClassLoader();
}
+ @Override
public AspectMetadata getAspectMetadata() {
return this.maaif.getAspectMetadata();
}
+ @Override
public int getOrder() {
return this.maaif.getOrder();
}
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..35ed1e2847 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
@@ -75,6 +75,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
new InstanceComparator(
Around.class, Before.class, After.class, AfterReturning.class, AfterThrowing.class),
new Converter() {
+ @Override
public Annotation convert(Method method) {
AspectJAnnotation> annotation = AbstractAspectJAdvisorFactory.findAspectJAnnotationOnMethod(method);
return annotation == null ? null : annotation.getAnnotation();
@@ -82,6 +83,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
}));
comparator.addComparator(new ConvertingComparator(
new Converter() {
+ @Override
public String convert(Method method) {
return method.getName();
}
@@ -90,6 +92,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
}
+ @Override
public List getAdvisors(MetadataAwareAspectInstanceFactory maaif) {
final Class> aspectClass = maaif.getAspectMetadata().getAspectClass();
final String aspectName = maaif.getAspectMetadata().getAspectName();
@@ -128,6 +131,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
private List getAdvisorMethods(Class> aspectClass) {
final List methods = new LinkedList();
ReflectionUtils.doWithMethods(aspectClass, new ReflectionUtils.MethodCallback() {
+ @Override
public void doWith(Method method) throws IllegalArgumentException {
// Exclude pointcuts
if (AnnotationUtils.getAnnotation(method, Pointcut.class) == null) {
@@ -144,7 +148,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
* for the given introduction field.
*
Resulting Advisors will need to be evaluated for targets.
* @param introductionField the field to introspect
- * @return null if not an Advisor
+ * @return {@code null} if not an Advisor
*/
private Advisor getDeclareParentsAdvisor(Field introductionField) {
DeclareParents declareParents = introductionField.getAnnotation(DeclareParents.class);
@@ -164,6 +168,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
}
+ @Override
public Advisor getAdvisor(Method candidateAdviceMethod, MetadataAwareAspectInstanceFactory aif,
int declarationOrderInAspect, String aspectName) {
@@ -191,6 +196,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
}
+ @Override
public Advice getAdvice(Method candidateAdviceMethod, AspectJExpressionPointcut ajexp,
MetadataAwareAspectInstanceFactory aif, int declarationOrderInAspect, String aspectName) {
@@ -203,7 +209,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: " +
@@ -272,6 +278,7 @@ public class ReflectiveAspectJAdvisorFactory extends AbstractAspectJAdvisorFacto
public SyntheticInstantiationAdvisor(final MetadataAwareAspectInstanceFactory aif) {
super(aif.getAspectMetadata().getPerClausePointcut(), new MethodBeforeAdvice() {
+ @Override
public void before(Method method, Object[] args, Object target) {
// Simply instantiate the aspect
aif.getAspectInstance();
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..70ff5e6532 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.
@@ -45,6 +45,7 @@ public class SimpleMetadataAwareAspectInstanceFactory extends SimpleAspectInstan
}
+ @Override
public final AspectMetadata getAspectMetadata() {
return this.metadata;
}
@@ -53,7 +54,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.
- *
The default implementation simply returns Ordered.LOWEST_PRECEDENCE.
+ *
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..31f1e18f27 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.
@@ -47,6 +47,7 @@ public class SingletonMetadataAwareAspectInstanceFactory extends SingletonAspect
}
+ @Override
public final AspectMetadata getAspectMetadata() {
return this.metadata;
}
@@ -54,7 +55,7 @@ public class SingletonMetadataAwareAspectInstanceFactory extends SingletonAspect
/**
* Check whether the aspect class carries an
* {@link org.springframework.core.annotation.Order} annotation,
- * falling back to 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.
- *
+ *
*
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..847b1932af 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 sorted =
- (List) PartialOrder.sort(partiallyComparableAdvisors);
+ PartialOrder.sort(partiallyComparableAdvisors);
if (sorted == null) {
// TODO: work harder to give a better error message here.
throw new IllegalArgumentException("Advice precedence circularity error");
}
-
+
// extract results again
List result = new LinkedList();
for (PartiallyComparableAdvisorHolder pcAdvisor : sorted) {
result.add(pcAdvisor.getAdvisor());
}
-
+
return result;
}
@@ -130,11 +131,13 @@ public class AspectJAwareAdvisorAutoProxyCreator extends AbstractAdvisorAutoProx
this.comparator = comparator;
}
+ @Override
public int compareTo(Object obj) {
Advisor otherAdvisor = ((PartiallyComparableAdvisorHolder) obj).advisor;
return this.comparator.compare(this.advisor, otherAdvisor);
}
+ @Override
public int fallbackCompareTo(Object obj) {
return 0;
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java
index c293f0be72..2e2134675b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.java
+++ b/spring-aop/src/main/java/org/springframework/aop/aspectj/autoproxy/AspectJPrecedenceComparator.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,15 +27,15 @@ import org.springframework.util.Assert;
/**
* Orders AspectJ advice/advisors by precedence (not invocation order).
*
- *
Given two pieces of advice, a and b:
+ *
Given two pieces of advice, {@code a} and {@code b}:
*
- *
if a and b are defined in different
+ *
if {@code a} and {@code b} are defined in different
* aspects, then the advice in the aspect with the lowest order
* value has the highest precedence
- *
if a and b are defined in the same
- * aspect, then if one of a or b is a form of
+ *
if {@code a} and {@code b} are defined in the same
+ * aspect, then if one of {@code a} or {@code b} is a form of
* after advice, then the advice declared last in the aspect has the
- * highest precedence. If neither 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.
*
@@ -76,6 +76,7 @@ class AspectJPrecedenceComparator implements Comparator {
}
+ @Override
public int compare(Object o1, Object o2) {
if (!(o1 instanceof Advisor && o2 instanceof Advisor)) {
throw new IllegalArgumentException(
@@ -106,14 +107,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 +154,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.
- *
- *
Note that use of this package does not require the use of the ajc compiler
+ *
+ *
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..65169d1a8d 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 target property
+ * and wraps the original as an inner-bean definition for the {@code target} property
* of {@link ProxyFactoryBean}.
*
*
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 BeanDefinition to the interceptor that
+ *
Subclasses have only to create the {@code BeanDefinition} to the interceptor that
* they wish to add.
*
* @author Rob Harrop
@@ -58,9 +58,10 @@ import org.springframework.util.StringUtils;
*/
public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator implements BeanDefinitionDecorator {
+ @Override
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 +119,7 @@ public abstract class AbstractInterceptorDrivenBeanDefinitionDecorator implement
}
/**
- * Subclasses should implement this method to return the 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..bd86b2ea2e 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
@@ -91,6 +91,7 @@ public class AdvisorComponentDefinition extends AbstractComponentDefinition {
}
+ @Override
public String getName() {
return this.advisorBeanName;
}
@@ -110,6 +111,7 @@ public class AdvisorComponentDefinition extends AbstractComponentDefinition {
return this.beanReferences;
}
+ @Override
public Object getSource() {
return this.advisorDefinition.getSource();
}
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.
*
- *
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, 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..459c394219 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.
*
*
Provides a {@link org.springframework.beans.factory.xml.BeanDefinitionParser} for the
- * <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.
*
- *
The pointcut tag allows for creation of named
+ *
The {@code pointcut} tag allows for creation of named
* {@link AspectJExpressionPointcut} beans using a simple syntax:
*
Using the advisor tag you can configure an {@link org.springframework.aop.Advisor}
+ *
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 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,9 +56,10 @@ 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.
*/
+ @Override
public void init() {
// In 2.0 XSD as well as in 2.1 XSD.
registerBeanDefinitionParser("config", new ConfigBeanDefinitionParser());
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.
*
*
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 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..95371f59b7 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}.
*
@@ -37,6 +37,7 @@ import org.springframework.beans.factory.xml.ParserContext;
*/
class AspectJAutoProxyBeanDefinitionParser implements BeanDefinitionParser {
+ @Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
AopNamespaceUtils.registerAspectJAnnotationAutoProxyCreatorIfNecessary(parserContext, element);
extendBeanDefinition(element, parserContext);
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..c7cb6735d6 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,8 +93,9 @@ class ConfigBeanDefinitionParser implements BeanDefinitionParser {
private static final int ASPECT_INSTANCE_FACTORY_INDEX = 2;
private ParseState parseState = new ParseState();
-
+
+ @Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
CompositeComponentDefinition compositeDef =
new CompositeComponentDefinition(element.getTagName(), parserContext.extractSource(element));
@@ -122,8 +123,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 +132,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 +169,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 +258,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 +274,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 +282,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 +305,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 +428,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 +436,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 +461,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/MethodLocatingFactoryBean.java b/spring-aop/src/main/java/org/springframework/aop/config/MethodLocatingFactoryBean.java
index 5891bc8455..abb26930cb 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/MethodLocatingFactoryBean.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/MethodLocatingFactoryBean.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.
@@ -57,6 +57,7 @@ public class MethodLocatingFactoryBean implements FactoryBean, BeanFacto
this.methodName = methodName;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
if (!StringUtils.hasText(this.targetBeanName)) {
throw new IllegalArgumentException("Property 'targetBeanName' is required");
@@ -78,14 +79,17 @@ public class MethodLocatingFactoryBean implements FactoryBean, BeanFacto
}
+ @Override
public Method getObject() throws Exception {
return this.method;
}
+ @Override
public Class getObjectType() {
return Method.class;
}
+ @Override
public boolean isSingleton() {
return true;
}
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/PointcutComponentDefinition.java b/spring-aop/src/main/java/org/springframework/aop/config/PointcutComponentDefinition.java
index cd1c0f9f59..3cbf472e58 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/PointcutComponentDefinition.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/PointcutComponentDefinition.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.
@@ -46,6 +46,7 @@ public class PointcutComponentDefinition extends AbstractComponentDefinition {
}
+ @Override
public String getName() {
return this.pointcutBeanName;
}
@@ -60,6 +61,7 @@ public class PointcutComponentDefinition extends AbstractComponentDefinition {
return new BeanDefinition[] {this.pointcutDefinition};
}
+ @Override
public Object getSource() {
return this.pointcutDefinition.getSource();
}
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..0acf968b51 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
@@ -39,6 +39,7 @@ class ScopedProxyBeanDefinitionDecorator implements BeanDefinitionDecorator {
private static final String PROXY_TARGET_CLASS = "proxy-target-class";
+ @Override
public BeanDefinitionHolder decorate(Node node, BeanDefinitionHolder definition, ParserContext parserContext) {
boolean proxyTargetClass = true;
if (node instanceof Element) {
@@ -47,7 +48,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/config/SimpleBeanFactoryAwareAspectInstanceFactory.java b/spring-aop/src/main/java/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.java
index 6ffc8c8868..64cc673bab 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/SimpleBeanFactoryAwareAspectInstanceFactory.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.
@@ -47,6 +47,7 @@ public class SimpleBeanFactoryAwareAspectInstanceFactory implements AspectInstan
this.aspectBeanName = aspectBeanName;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
if (!StringUtils.hasText(this.aspectBeanName)) {
@@ -59,10 +60,12 @@ public class SimpleBeanFactoryAwareAspectInstanceFactory implements AspectInstan
* Look up the aspect bean from the {@link BeanFactory} and returns it.
* @see #setAspectBeanName
*/
+ @Override
public Object getAspectInstance() {
return this.beanFactory.getBean(this.aspectBeanName);
}
+ @Override
public ClassLoader getAspectClassLoader() {
if (this.beanFactory instanceof ConfigurableBeanFactory) {
return ((ConfigurableBeanFactory) this.beanFactory).getBeanClassLoader();
@@ -72,6 +75,7 @@ public class SimpleBeanFactoryAwareAspectInstanceFactory implements AspectInstan
}
}
+ @Override
public int getOrder() {
if (this.beanFactory.isSingleton(this.aspectBeanName) &&
this.beanFactory.isTypeMatch(this.aspectBeanName, Ordered.class)) {
diff --git a/spring-aop/src/main/java/org/springframework/aop/config/SpringConfiguredBeanDefinitionParser.java b/spring-aop/src/main/java/org/springframework/aop/config/SpringConfiguredBeanDefinitionParser.java
index 36c2a9c911..59aed08e0e 100644
--- a/spring-aop/src/main/java/org/springframework/aop/config/SpringConfiguredBeanDefinitionParser.java
+++ b/spring-aop/src/main/java/org/springframework/aop/config/SpringConfiguredBeanDefinitionParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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.
@@ -50,6 +50,7 @@ class SpringConfiguredBeanDefinitionParser implements BeanDefinitionParser {
"org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect";
+ @Override
public BeanDefinition parse(Element element, ParserContext parserContext) {
if (!parserContext.getRegistry().containsBeanDefinition(BEAN_CONFIGURER_ASPECT_BEAN_NAME)) {
RootBeanDefinition def = new RootBeanDefinition();
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..f65ae62508 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 {
@@ -49,6 +50,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
private final Map eligibleBeans = new ConcurrentHashMap(64);
+ @Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
}
@@ -57,15 +59,18 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
return bean;
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
if (bean instanceof AopInfrastructureBean) {
// Ignore AOP infrastructure such as scoped proxies.
@@ -93,7 +98,7 @@ public abstract class AbstractAdvisingBeanPostProcessor extends ProxyConfig
/**
* Check whether the given bean is eligible for advising with this
* post-processor's {@link Advisor}.
- *
Implements caching of canApply results per bean name.
+ *
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/AbstractSingletonProxyFactoryBean.java b/spring-aop/src/main/java/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.java
index 18d8d25d15..261d1cab60 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/AbstractSingletonProxyFactoryBean.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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.
@@ -122,6 +122,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
this.proxyClassLoader = classLoader;
}
+ @Override
public void setBeanClassLoader(ClassLoader classLoader) {
if (this.proxyClassLoader == null) {
this.proxyClassLoader = classLoader;
@@ -129,6 +130,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
}
+ @Override
public void afterPropertiesSet() {
if (this.target == null) {
throw new IllegalArgumentException("Property 'target' is required");
@@ -190,6 +192,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
}
+ @Override
public Object getObject() {
if (this.proxy == null) {
throw new FactoryBeanNotInitializedException();
@@ -197,6 +200,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
return this.proxy;
}
+ @Override
public Class> getObjectType() {
if (this.proxy != null) {
return this.proxy.getClass();
@@ -213,6 +217,7 @@ public abstract class AbstractSingletonProxyFactoryBean extends ProxyConfig
return null;
}
+ @Override
public final boolean isSingleton() {
return true;
}
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 this, the invocation will not be advised).
+ * (If it uses {@code this}, the invocation will not be advised).
*
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 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.
*
This will be wrapped in a DefaultPointcutAdvisor with a pointcut that always
- * applies, and returned from the getAdvisors() method in this wrapped form.
+ * applies, and returned from the {@code getAdvisors()} method in this wrapped form.
*
Note that the given advice will apply to all invocations on the proxy,
- * even to the 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.
*
Note: The given advice will apply to all invocations on the proxy,
- * even to the 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..5cf6828d66 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.
@@ -137,10 +137,12 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
setTargetSource(new SingletonTargetSource(target));
}
+ @Override
public void setTargetSource(TargetSource targetSource) {
this.targetSource = (targetSource != null ? targetSource : EMPTY_TARGET_SOURCE);
}
+ @Override
public TargetSource getTargetSource() {
return this.targetSource;
}
@@ -162,14 +164,17 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
this.targetSource = EmptyTargetSource.forClass(targetClass);
}
+ @Override
public Class> getTargetClass() {
return this.targetSource.getTargetClass();
}
+ @Override
public void setPreFiltered(boolean preFiltered) {
this.preFiltered = preFiltered;
}
+ @Override
public boolean isPreFiltered() {
return this.preFiltered;
}
@@ -184,7 +189,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,17 +226,19 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
* Remove a proxied interface.
*
Does nothing if the given interface isn't proxied.
* @param intf the interface to remove from the proxy
- * @return 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) {
return this.interfaces.remove(intf);
}
+ @Override
public Class[] getProxiedInterfaces() {
return this.interfaces.toArray(new Class[this.interfaces.size()]);
}
+ @Override
public boolean isInterfaceProxied(Class intf) {
for (Class proxyIntf : this.interfaces) {
if (intf.isAssignableFrom(proxyIntf)) {
@@ -242,15 +249,18 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
}
+ @Override
public final Advisor[] getAdvisors() {
return this.advisorArray;
}
+ @Override
public void addAdvisor(Advisor advisor) {
int pos = this.advisors.size();
addAdvisor(pos, advisor);
}
+ @Override
public void addAdvisor(int pos, Advisor advisor) throws AopConfigException {
if (advisor instanceof IntroductionAdvisor) {
validateIntroductionAdvisor((IntroductionAdvisor) advisor);
@@ -258,6 +268,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
addAdvisorInternal(pos, advisor);
}
+ @Override
public boolean removeAdvisor(Advisor advisor) {
int index = indexOf(advisor);
if (index == -1) {
@@ -269,6 +280,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
}
}
+ @Override
public void removeAdvisor(int index) throws AopConfigException {
if (isFrozen()) {
throw new AopConfigException("Cannot remove Advisor: Configuration is frozen.");
@@ -292,11 +304,13 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
adviceChanged();
}
+ @Override
public int indexOf(Advisor advisor) {
Assert.notNull(advisor, "Advisor must not be null");
return this.advisors.indexOf(advisor);
}
+ @Override
public boolean replaceAdvisor(Advisor a, Advisor b) throws AopConfigException {
Assert.notNull(a, "Advisor a must not be null");
Assert.notNull(b, "Advisor b must not be null");
@@ -388,6 +402,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
}
+ @Override
public void addAdvice(Advice advice) throws AopConfigException {
int pos = this.advisors.size();
addAdvice(pos, advice);
@@ -396,6 +411,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
/**
* Cannot add introductions this way unless the advice implements IntroductionInfo.
*/
+ @Override
public void addAdvice(int pos, Advice advice) throws AopConfigException {
Assert.notNull(advice, "Advice must not be null");
if (advice instanceof IntroductionInfo) {
@@ -412,6 +428,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
}
}
+ @Override
public boolean removeAdvice(Advice advice) throws AopConfigException {
int index = indexOf(advice);
if (index == -1) {
@@ -423,6 +440,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
}
}
+ @Override
public int indexOf(Advice advice) {
Assert.notNull(advice, "Advice must not be null");
for (int i = 0; i < this.advisors.size(); i++) {
@@ -554,6 +572,7 @@ public class AdvisedSupport extends ProxyConfig implements Advised {
}
+ @Override
public String toProxyConfigString() {
return toString();
}
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.
*
- *
The currentProxy() method is usable if the AOP framework is configured to
+ *
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 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.
*
*
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 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.
*
Note that the caller should be careful to keep the old value as appropriate.
- * @param proxy the proxy to expose (or 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.
*
Uses the AopProxy's default class loader (if necessary for proxy creation):
* usually, the thread context class loader.
- * @return the new proxy object (never null)
- * @see java.lang.Thread#getContextClassLoader()
+ * @return the new proxy object (never {@code null})
+ * @see Thread#getContextClassLoader()
*/
Object getProxy();
/**
* Create a new proxy object.
*
Uses the given class loader (if necessary for proxy creation).
- * 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;
*
*
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)
+ * 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..6ee9f6d450 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
@@ -146,10 +146,12 @@ final class CglibAopProxy implements AopProxy, Serializable {
}
+ @Override
public Object getProxy() {
return getProxy(null);
}
+ @Override
public Object getProxy(ClassLoader classLoader) {
if (logger.isDebugEnabled()) {
logger.debug("Creating CGLIB proxy: target source is " + this.advised.getTargetSource());
@@ -234,7 +236,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 +251,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 +378,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 {
@@ -386,6 +388,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.target = target;
}
+ @Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
Object retVal = methodProxy.invoke(this.target, args);
return processReturnType(proxy, this.target, method, retVal);
@@ -405,6 +408,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.target = target;
}
+ @Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
Object oldProxy = null;
try {
@@ -432,6 +436,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.targetSource = targetSource;
}
+ @Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
Object target = this.targetSource.getTarget();
try {
@@ -456,6 +461,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.targetSource = targetSource;
}
+ @Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
Object oldProxy = null;
Object target = this.targetSource.getTarget();
@@ -485,6 +491,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.target = target;
}
+ @Override
public Object loadObject() {
return this.target;
}
@@ -502,6 +509,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.advised = advised;
}
+ @Override
public Object loadObject() throws Exception {
return this.advised;
}
@@ -509,7 +517,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 {
@@ -520,6 +528,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.advised = advised;
}
+ @Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) {
Object other = args[0];
if (proxy == other) {
@@ -541,7 +550,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 {
@@ -552,6 +561,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.advised = advised;
}
+ @Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) {
return CglibAopProxy.class.hashCode() * 13 + this.advised.getTargetSource().hashCode();
}
@@ -575,6 +585,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.targetClass = targetClass;
}
+ @Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
MethodInvocation invocation = new CglibMethodInvocation(proxy, this.target, method, args,
this.targetClass, this.adviceChain, methodProxy);
@@ -598,6 +609,7 @@ final class CglibAopProxy implements AopProxy, Serializable {
this.advised = advised;
}
+ @Override
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
Object oldProxy = null;
boolean setProxyContext = false;
@@ -609,7 +621,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,15 +757,16 @@ final class CglibAopProxy implements AopProxy, Serializable {
* invoke the advice chain. Otherwise a DyanmicAdvisedInterceptor is
* used.
*
For non-advised methods:
- *
Where it can be determined that the method will not return this
- * or when ProxyFactory.getExposeProxy() returns false,
+ *
Where it can be determined that the method will not return {@code this}
+ * or when {@code ProxyFactory.getExposeProxy()} returns {@code false},
* then a Dispatcher is used. For static targets, the StaticDispatcher is used;
* and for dynamic targets, a DynamicUnadvisedInterceptor is used.
- * If it possible for the method to return 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.
*
*/
+ @Override
public int accept(Method method) {
if (AopUtils.isFinalizeMethod(method)) {
logger.debug("Found finalize() method - using NO_OVERRIDE");
diff --git a/spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java b/spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java
index 806e3602bc..3eef11bd9b 100644
--- a/spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.java
+++ b/spring-aop/src/main/java/org/springframework/aop/framework/DefaultAdvisorChainFactory.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,8 +43,10 @@ import org.springframework.aop.support.MethodMatchers;
* @author Adrian Colyer
* @since 2.0.3
*/
+@SuppressWarnings("serial")
public class DefaultAdvisorChainFactory implements AdvisorChainFactory, Serializable {
+ @Override
public List
- *
+ *
*
If you are using Spring 2.0, you can also use the following style of configuration for
* public static fields.
- *
+ *
*
*
* @author Juergen Hoeller
@@ -142,15 +142,18 @@ public class FieldRetrievingFactoryBean
* nor "targetField" have been specified.
* This allows for concise bean definitions with just an id/name.
*/
+ @Override
public void setBeanName(String beanName) {
this.beanName = StringUtils.trimAllWhitespace(BeanFactoryUtils.originalBeanName(beanName));
}
+ @Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = classLoader;
}
+ @Override
public void afterPropertiesSet() throws ClassNotFoundException, NoSuchFieldException {
if (this.targetClass != null && this.targetObject != null) {
throw new IllegalArgumentException("Specify either targetClass or targetObject, not both");
@@ -159,7 +162,7 @@ public class FieldRetrievingFactoryBean
if (this.targetClass == null && this.targetObject == null) {
if (this.targetField != null) {
throw new IllegalArgumentException(
- "Specify targetClass or targetObject in combination with targetField");
+ "Specify targetClass or targetObject in combination with targetField");
}
// If no other property specified, consider bean name as static field expression.
@@ -191,6 +194,7 @@ public class FieldRetrievingFactoryBean
}
+ @Override
public Object getObject() throws IllegalAccessException {
if (this.fieldObject == null) {
throw new FactoryBeanNotInitializedException();
@@ -206,10 +210,12 @@ public class FieldRetrievingFactoryBean
}
}
+ @Override
public Class> getObjectType() {
return (this.fieldObject != null ? this.fieldObject.getType() : null);
}
+ @Override
public boolean isSingleton() {
return false;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java
index f0d5b59a92..f508e3fff1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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.
@@ -61,7 +61,7 @@ public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor {
* @param beanClass the class of the bean to be instantiated
* @param beanName the name of the bean
* @return the bean object to expose instead of a default instance of the target bean,
- * or null to proceed with default instantiation
+ * or {@code null} to proceed with default instantiation
* @throws org.springframework.beans.BeansException in case of errors
* @see org.springframework.beans.factory.support.AbstractBeanDefinition#hasBeanClass
* @see org.springframework.beans.factory.support.AbstractBeanDefinition#getFactoryMethodName
@@ -76,9 +76,9 @@ public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor {
* for a typical example.
* @param bean the bean instance created, with properties not having been set yet
* @param beanName the name of the bean
- * @return true if properties should be set on the bean; false
- * if property population should be skipped. Normal implementations should return true.
- * Returning false will also prevent any subsequent InstantiationAwareBeanPostProcessor
+ * @return {@code true} if properties should be set on the bean; {@code false}
+ * if property population should be skipped. Normal implementations should return {@code true}.
+ * Returning {@code false} will also prevent any subsequent InstantiationAwareBeanPostProcessor
* instances being invoked on this bean instance.
* @throws org.springframework.beans.BeansException in case of errors
*/
@@ -91,13 +91,13 @@ public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor {
*
Also allows for replacing the property values to apply, typically through
* creating a new MutablePropertyValues instance based on the original PropertyValues,
* adding or removing specific values.
- * @param pvs the property values that the factory is about to apply (never null)
+ * @param pvs the property values that the factory is about to apply (never {@code null})
* @param pds the relevant property descriptors for the target bean (with ignored
* dependency types - which the factory handles specifically - already filtered out)
* @param bean the bean instance created, but whose properties have not yet been set
* @param beanName the name of the bean
* @return the actual property values to apply to to the given bean
- * (can be the passed-in PropertyValues instance), or null
+ * (can be the passed-in PropertyValues instance), or {@code null}
* to skip property population
* @throws org.springframework.beans.BeansException in case of errors
* @see org.springframework.beans.MutablePropertyValues
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.java
index 49eeaaf532..3e02846fcb 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessorAdapter.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.
@@ -39,26 +39,32 @@ import org.springframework.beans.PropertyValues;
*/
public abstract class InstantiationAwareBeanPostProcessorAdapter implements SmartInstantiationAwareBeanPostProcessor {
+ @Override
public Class> predictBeanType(Class> beanClass, String beanName) {
return null;
}
+ @Override
public Constructor>[] determineCandidateConstructors(Class> beanClass, String beanName) throws BeansException {
return null;
}
+ @Override
public Object getEarlyBeanReference(Object bean, String beanName) throws BeansException {
return bean;
}
+ @Override
public Object postProcessBeforeInstantiation(Class> beanClass, String beanName) throws BeansException {
return null;
}
+ @Override
public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
return true;
}
+ @Override
public PropertyValues postProcessPropertyValues(
PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName)
throws BeansException {
@@ -66,10 +72,12 @@ public abstract class InstantiationAwareBeanPostProcessorAdapter implements Smar
return pvs;
}
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java
index 7ceb21f753..736868bed3 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ListFactoryBean.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 @@ public class ListFactoryBean extends AbstractFactoryBean {
/**
* Set the class to use for the target List. Can be populated with a fully
* qualified class name when defined in a Spring application context.
- *
Default is a java.util.ArrayList.
+ *
Default is a {@code java.util.ArrayList}.
* @see java.util.ArrayList
*/
public void setTargetListClass(Class targetListClass) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java
index 51440d47da..0e6ad68f07 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/MethodInvokingFactoryBean.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.ClassUtils;
/**
* {@link FactoryBean} which returns a value which is the result of a static or instance
- * method invocation. For most use cases it is better to just use the container's
+ * method invocation. For most use cases it is better to just use the container's
* built-in factory method support for the same purpose, since that is smarter at
* converting arguments. This factory bean is still useful though when you need to
* call a method which doesn't return any value (for example, a static class method
@@ -55,7 +55,7 @@ import org.springframework.util.ClassUtils;
*
*
This class depends on {@link #afterPropertiesSet()} being called once
* all properties have been set, as per the InitializingBean contract.
- *
+ *
*
An example (in an XML based bean factory definition) of a bean definition
* which uses this class to call a static factory method:
*
@@ -82,7 +82,7 @@ import org.springframework.util.ClassUtils;
* </list>
* </property>
* </bean>
- *
+ *
* @author Colin Sampaleanu
* @author Juergen Hoeller
* @since 21.11.2003
@@ -110,10 +110,12 @@ public class MethodInvokingFactoryBean extends ArgumentConvertingMethodInvoker
this.singleton = singleton;
}
+ @Override
public boolean isSingleton() {
return this.singleton;
}
+ @Override
public void setBeanClassLoader(ClassLoader classLoader) {
this.beanClassLoader = classLoader;
}
@@ -123,6 +125,7 @@ public class MethodInvokingFactoryBean extends ArgumentConvertingMethodInvoker
return ClassUtils.forName(className, this.beanClassLoader);
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
if (beanFactory instanceof ConfigurableBeanFactory) {
this.beanFactory = (ConfigurableBeanFactory) beanFactory;
@@ -145,6 +148,7 @@ public class MethodInvokingFactoryBean extends ArgumentConvertingMethodInvoker
}
+ @Override
public void afterPropertiesSet() throws Exception {
prepare();
if (this.singleton) {
@@ -178,6 +182,7 @@ public class MethodInvokingFactoryBean extends ArgumentConvertingMethodInvoker
* to "true", otherwise returns the value returned from invoking the
* specified method on the fly.
*/
+ @Override
public Object getObject() throws Exception {
if (this.singleton) {
if (!this.initialized) {
@@ -194,8 +199,9 @@ public class MethodInvokingFactoryBean extends ArgumentConvertingMethodInvoker
/**
* Return the type of object that this FactoryBean creates,
- * or null if not known in advance.
+ * or {@code null} if not known in advance.
*/
+ @Override
public Class> getObjectType() {
if (!isPrepared()) {
// Not fully initialized yet -> return null to indicate "not known yet".
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java
index d2fc8ab259..5c3ed77257 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ObjectFactoryCreatingFactoryBean.java
@@ -57,7 +57,7 @@ import org.springframework.util.Assert;
*
*</beans>
*
- *
The attendant MyClientBean class implementation might look
+ *
The attendant {@code MyClientBean} class implementation might look
* something like this:
*
*
package a.b.c;
@@ -131,6 +131,7 @@ public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBeanjava.util.prefs).
+ * Preferences API ({@code java.util.prefs}).
*
*
Tries to resolve placeholders as keys first in the user preferences,
* then in the system preferences, then in this configurer's properties.
@@ -74,11 +74,12 @@ public class PreferencesPlaceholderConfigurer extends PropertyPlaceholderConfigu
* This implementation eagerly fetches the Preferences instances
* for the required system and user tree nodes.
*/
+ @Override
public void afterPropertiesSet() {
this.systemPrefs = (this.systemTreePath != null) ?
- Preferences.systemRoot().node(this.systemTreePath) : Preferences.systemRoot();
+ Preferences.systemRoot().node(this.systemTreePath) : Preferences.systemRoot();
this.userPrefs = (this.userTreePath != null) ?
- Preferences.userRoot().node(this.userTreePath) : Preferences.userRoot();
+ Preferences.userRoot().node(this.userTreePath) : Preferences.userRoot();
}
/**
@@ -110,7 +111,7 @@ public class PreferencesPlaceholderConfigurer extends PropertyPlaceholderConfigu
* @param path the preferences path (placeholder part before '/')
* @param key the preferences key (placeholder part after '/')
* @param preferences the Preferences to resolve against
- * @return the value for the placeholder, or null if none found
+ * @return the value for the placeholder, or {@code null} if none found
*/
protected String resolvePlaceholder(String path, String key, Preferences preferences) {
if (path != null) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java
index 9e0673ccfb..71b3e85fb9 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertiesFactoryBean.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.
@@ -59,17 +59,20 @@ public class PropertiesFactoryBean extends PropertiesLoaderSupport
this.singleton = singleton;
}
+ @Override
public final boolean isSingleton() {
return this.singleton;
}
+ @Override
public final void afterPropertiesSet() throws IOException {
if (this.singleton) {
this.singletonInstance = createProperties();
}
}
+ @Override
public final Properties getObject() throws IOException {
if (this.singleton) {
return this.singletonInstance;
@@ -79,6 +82,7 @@ public class PropertiesFactoryBean extends PropertiesLoaderSupport
}
}
+ @Override
public Class getObjectType() {
return Properties.class;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java
index 736a7d14fd..9dbcb9becb 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyOverrideConfigurer.java
@@ -52,7 +52,7 @@ import org.springframework.beans.factory.BeanInitializationException;
* the same bean property, the last one will win (due to the overriding mechanism).
*
*
Property values can be converted after reading them in, through overriding
- * the convertPropertyValue method. For example, encrypted values
+ * the {@code convertPropertyValue} method. For example, encrypted values
* can be detected and decrypted accordingly before processing them.
*
* @author Juergen Hoeller
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java
index 518ce93ff3..4b8703abf0 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPathFactoryBean.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,7 +31,7 @@ import org.springframework.util.StringUtils;
/**
* {@link FactoryBean} that evaluates a property path on a given target object.
- *
+ *
*
The target object can be specified directly or via a bean name.
*
*
Usage examples:
@@ -64,12 +64,12 @@ import org.springframework.util.StringUtils;
*
* <!-- will result in 10, which is the value of property 'age' of bean 'tb' -->
* <bean id="tb.age" class="org.springframework.beans.factory.config.PropertyPathFactoryBean"/>
- *
+ *
*
If you are using Spring 2.0 and XML Schema support in your configuration file(s),
* you can also use the following style of configuration for property path access.
* (See also the appendix entitled 'XML Schema-based configuration' in the Spring
* reference manual for more examples.)
- *
+ *
*
<!-- will result in 10, which is the value of property 'age' of bean 'tb' -->
* <util:property-path id="name" path="testBean.age"/>
*
@@ -147,11 +147,13 @@ public class PropertyPathFactoryBean implements FactoryBean, BeanNameAwa
* "targetBeanName" nor "propertyPath" have been specified.
* This allows for concise bean definitions with just an id/name.
*/
+ @Override
public void setBeanName(String beanName) {
this.beanName = StringUtils.trimAllWhitespace(BeanFactoryUtils.originalBeanName(beanName));
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
@@ -162,15 +164,15 @@ public class PropertyPathFactoryBean implements FactoryBean, BeanNameAwa
if (this.targetBeanWrapper == null && this.targetBeanName == null) {
if (this.propertyPath != null) {
throw new IllegalArgumentException(
- "Specify 'targetObject' or 'targetBeanName' in combination with 'propertyPath'");
+ "Specify 'targetObject' or 'targetBeanName' in combination with 'propertyPath'");
}
// No other properties specified: check bean name.
int dotIndex = this.beanName.indexOf('.');
if (dotIndex == -1) {
throw new IllegalArgumentException(
- "Neither 'targetObject' nor 'targetBeanName' specified, and PropertyPathFactoryBean " +
- "bean name '" + this.beanName + "' does not follow 'beanName.property' syntax");
+ "Neither 'targetObject' nor 'targetBeanName' specified, and PropertyPathFactoryBean " +
+ "bean name '" + this.beanName + "' does not follow 'beanName.property' syntax");
}
this.targetBeanName = this.beanName.substring(0, dotIndex);
this.propertyPath = this.beanName.substring(dotIndex + 1);
@@ -190,6 +192,7 @@ public class PropertyPathFactoryBean implements FactoryBean, BeanNameAwa
}
+ @Override
public Object getObject() throws BeansException {
BeanWrapper target = this.targetBeanWrapper;
if (target != null) {
@@ -208,6 +211,7 @@ public class PropertyPathFactoryBean implements FactoryBean, BeanNameAwa
return target.getPropertyValue(this.propertyPath);
}
+ @Override
public Class> getObjectType() {
return this.resultType;
}
@@ -218,6 +222,7 @@ public class PropertyPathFactoryBean implements FactoryBean, BeanNameAwa
* for each call, so we have to assume that we're not returning the
* same object for each {@link #getObject()} call.
*/
+ @Override
public boolean isSingleton() {
return false;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
index 442f541c50..c9d39f3bf5 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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.
@@ -137,8 +137,8 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
/**
* Resolve the given placeholder using the given properties, performing
* a system properties check according to the given mode.
- *
The default implementation delegates to resolvePlaceholder
- * (placeholder, props) before/after the system properties check.
+ *
The default implementation delegates to {@code resolvePlaceholder
+ * (placeholder, props)} before/after the system properties check.
*
Subclasses can override this for custom resolution strategies,
* including customized points for the system properties check.
* @param placeholder the placeholder to resolve
@@ -174,7 +174,7 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
* after this method is invoked, according to the system properties mode.
* @param placeholder the placeholder to resolve
* @param props the merged properties of this configurer
- * @return the resolved value, of null if none
+ * @return the resolved value, of {@code null} if none
* @see #setSystemPropertiesMode
*/
protected String resolvePlaceholder(String placeholder, Properties props) {
@@ -185,10 +185,10 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
* Resolve the given key as JVM system property, and optionally also as
* system environment variable if no matching system property has been found.
* @param key the placeholder to resolve as system property key
- * @return the system property value, or null if not found
+ * @return the system property value, or {@code null} if not found
* @see #setSearchSystemEnvironment
- * @see java.lang.System#getProperty(String)
- * @see java.lang.System#getenv(String)
+ * @see System#getProperty(String)
+ * @see System#getenv(String)
*/
protected String resolveSystemProperty(String key) {
try {
@@ -251,6 +251,7 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
this.resolver = new PropertyPlaceholderConfigurerResolver(props);
}
+ @Override
public String resolveStringValue(String strVal) throws BeansException {
String value = this.helper.replacePlaceholders(strVal, this.resolver);
return (value.equals(nullValue) ? null : value);
@@ -266,6 +267,7 @@ public class PropertyPlaceholderConfigurer extends PlaceholderConfigurerSupport
this.props = props;
}
+ @Override
public String resolvePlaceholder(String placeholderName) {
return PropertyPlaceholderConfigurer.this.resolvePlaceholder(placeholderName, props, systemPropertiesMode);
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyResourceConfigurer.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyResourceConfigurer.java
index 8da5a7772b..a84bdc067a 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyResourceConfigurer.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/PropertyResourceConfigurer.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.
@@ -63,6 +63,7 @@ public abstract class PropertyResourceConfigurer extends PropertiesLoaderSupport
this.order = order;
}
+ @Override
public int getOrder() {
return this.order;
}
@@ -73,6 +74,7 @@ public abstract class PropertyResourceConfigurer extends PropertiesLoaderSupport
* {@linkplain #processProperties process} properties against the given bean factory.
* @throws BeanInitializationException if any properties cannot be loaded
*/
+ @Override
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
try {
Properties mergedProps = mergeProperties();
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ProviderCreatingFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ProviderCreatingFactoryBean.java
index 317defbe96..c0d2537042 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ProviderCreatingFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ProviderCreatingFactoryBean.java
@@ -31,8 +31,8 @@ import org.springframework.util.Assert;
*
This is basically a JSR-330 compliant variant of Spring's good old
* {@link ObjectFactoryCreatingFactoryBean}. It can be used for traditional
* external dependency injection configuration that targets a property or
- * constructor argument of type javax.inject.Provider, as an
- * alternative to JSR-330's @Inject annotation-driven approach.
+ * constructor argument of type {@code javax.inject.Provider}, as an
+ * alternative to JSR-330's {@code @Inject} annotation-driven approach.
*
* @author Juergen Hoeller
* @since 3.0.2
@@ -76,6 +76,7 @@ public class ProviderCreatingFactoryBean extends AbstractFactoryBean {
/**
* Independent inner class - for serialization purposes.
*/
+ @SuppressWarnings("serial")
private static class TargetBeanProvider implements Provider, Serializable {
private final BeanFactory beanFactory;
@@ -87,6 +88,7 @@ public class ProviderCreatingFactoryBean extends AbstractFactoryBean {
this.targetBeanName = targetBeanName;
}
+ @Override
public Object get() throws BeansException {
return this.beanFactory.getBean(this.targetBeanName);
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java
index 3df4a47c27..2e078aeb48 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanNameReference.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.beans.factory.config;
import org.springframework.util.Assert;
-/**
+/**
* Immutable placeholder class used for a property value object when it's a
* reference to another bean name in the factory, to be resolved at runtime.
*
@@ -29,7 +29,7 @@ import org.springframework.util.Assert;
* @see org.springframework.beans.factory.BeanFactory#getBean
*/
public class RuntimeBeanNameReference implements BeanReference {
-
+
private final String beanName;
private Object source;
@@ -44,18 +44,20 @@ public class RuntimeBeanNameReference implements BeanReference {
this.beanName = beanName;
}
+ @Override
public String getBeanName() {
return this.beanName;
}
/**
- * Set the configuration source Object for this metadata element.
+ * Set the configuration source {@code Object} for this metadata element.
*
The exact type of the object will depend on the configuration mechanism used.
*/
public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java
index 822d98c43c..dd3648e3cc 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/RuntimeBeanReference.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.beans.factory.config;
import org.springframework.util.Assert;
-/**
+/**
* Immutable placeholder class used for a property value object when it's
* a reference to another bean in the factory, to be resolved at runtime.
*
@@ -28,7 +28,7 @@ import org.springframework.util.Assert;
* @see org.springframework.beans.factory.BeanFactory#getBean
*/
public class RuntimeBeanReference implements BeanReference {
-
+
private final String beanName;
private final boolean toParent;
@@ -61,6 +61,7 @@ public class RuntimeBeanReference implements BeanReference {
}
+ @Override
public String getBeanName() {
return this.beanName;
}
@@ -74,13 +75,14 @@ public class RuntimeBeanReference implements BeanReference {
}
/**
- * Set the configuration source Object for this metadata element.
+ * Set the configuration source {@code Object} for this metadata element.
*
The exact type of the object will depend on the configuration mechanism used.
*/
public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.java
index 9da178b2ef..8777fa61e0 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/Scope.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.
@@ -38,14 +38,14 @@ import org.springframework.beans.factory.ObjectFactory;
* this SPI is completely generic: It provides the ability to get and put
* objects from any underlying storage mechanism, such as an HTTP session
* or a custom conversation mechanism. The name passed into this class's
- * get and remove methods will identify the
+ * {@code get} and {@code remove} methods will identify the
* target object in the current scope.
*
- *
Scope implementations are expected to be thread-safe.
- * One Scope instance can be used with multiple bean factories
+ *
{@code Scope} implementations are expected to be thread-safe.
+ * One {@code Scope} instance can be used with multiple bean factories
* at the same time, if desired (unless it explicitly wants to be aware of
* the containing BeanFactory), with any number of threads accessing
- * the Scope concurrently from any number of factories.
+ * the {@code Scope} concurrently from any number of factories.
*
* @author Juergen Hoeller
* @author Rob Harrop
@@ -67,14 +67,14 @@ public interface Scope {
* @param name the name of the object to retrieve
* @param objectFactory the {@link ObjectFactory} to use to create the scoped
* object if it is not present in the underlying storage mechanism
- * @return the desired object (never null)
+ * @return the desired object (never {@code null})
*/
Object get(String name, ObjectFactory> objectFactory);
/**
- * Remove the object with the given name from the underlying scope.
- *
Returns null if no object was found; otherwise
- * returns the removed Object.
+ * Remove the object with the given {@code name} from the underlying scope.
+ *
Returns {@code null} if no object was found; otherwise
+ * returns the removed {@code Object}.
*
Note that an implementation should also remove a registered destruction
* callback for the specified object, if any. It does, however, not
* need to execute a registered destruction callback in this case,
@@ -83,7 +83,7 @@ public interface Scope {
* {@link UnsupportedOperationException} if they do not support explicitly
* removing an object.
* @param name the name of the object to remove
- * @return the removed object, or null if no object was present
+ * @return the removed object, or {@code null} if no object was present
* @see #registerDestructionCallback
*/
Object remove(String name);
@@ -122,7 +122,7 @@ public interface Scope {
* Resolve the contextual object for the given key, if any.
* E.g. the HttpServletRequest object for key "request".
* @param key the contextual key
- * @return the corresponding object, or null if none found
+ * @return the corresponding object, or {@code null} if none found
*/
Object resolveContextualObject(String key);
@@ -135,9 +135,9 @@ public interface Scope {
* case of a custom conversation that sits within the overall session,
* the specific ID for the current conversation would be appropriate.
*
Note: This is an optional operation. It is perfectly valid to
- * return null in an implementation of this method if the
+ * return {@code null} in an implementation of this method if the
* underlying storage mechanism has no obvious candidate for such an ID.
- * @return the conversation ID, or null if there is no
+ * @return the conversation ID, or {@code null} if there is no
* conversation ID for the current scope
*/
String getConversationId();
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java
index 192f6b7e66..ef91b2b749 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/ServiceLocatorFactoryBean.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.
@@ -36,8 +36,8 @@ import org.springframework.util.StringUtils;
/**
* A {@link FactoryBean} implementation that takes an interface which must have one or more
- * methods with the signatures MyType xxx() or MyType xxx(MyIdType id)
- * (typically, MyService getService() or MyService getService(String id))
+ * methods with the signatures {@code MyType xxx()} or {@code MyType xxx(MyIdType id)}
+ * (typically, {@code MyService getService()} or {@code MyService getService(String id)})
* and creates a dynamic proxy which implements that interface, delegating to an
* underlying {@link org.springframework.beans.factory.BeanFactory}.
*
@@ -51,7 +51,7 @@ import org.springframework.util.StringUtils;
* setter or constructor injection of the target bean is preferable.
*
*
On invocation of the no-arg factory method, or the single-arg factory
- * method with a String id of null or empty String, if exactly
+ * method with a String id of {@code null} or empty String, if exactly
* one bean in the factory matches the return type of the factory
* method, that bean is returned, otherwise a
* {@link org.springframework.beans.factory.NoSuchBeanDefinitionException}
@@ -64,7 +64,7 @@ import org.springframework.util.StringUtils;
*
*
A factory method argument will usually be a String, but can also be an
* int or a custom enumeration type, for example, stringified via
- * toString. The resulting String can be used as bean name as-is,
+ * {@code toString}. The resulting String can be used as bean name as-is,
* provided that corresponding beans are defined in the bean factory.
* Alternatively, {@link #setServiceMappings(java.util.Properties) a custom mapping}
* between service ids and bean names can be defined.
@@ -99,7 +99,7 @@ import org.springframework.util.StringUtils;
*
*</beans>
*
- *
The attendant MyClientBean class implementation might then
+ *
The attendant {@code MyClientBean} class implementation might then
* look something like this:
*
*
The attendant MyClientBean class implementation might then
+ *
The attendant {@code MyClientBean} class implementation might then
* look something like this:
*
*
package a.b.c;
@@ -202,8 +202,8 @@ public class ServiceLocatorFactoryBean implements FactoryBean, BeanFacto
/**
* Set the service locator interface to use, which must have one or more methods with
- * the signatures MyType xxx() or MyType xxx(MyIdType id)
- * (typically, MyService getService() or MyService getService(String id)).
+ * the signatures {@code MyType xxx()} or {@code MyType xxx(MyIdType id)}
+ * (typically, {@code MyService getService()} or {@code MyService getService(String id)}).
* See the {@link ServiceLocatorFactoryBean class-level Javadoc} for
* information on the semantics of such methods.
*/
@@ -214,8 +214,8 @@ public class ServiceLocatorFactoryBean implements FactoryBean, BeanFacto
/**
* Set the exception class that the service locator should throw if service
* lookup failed. The specified exception class must have a constructor
- * with one of the following parameter types: (String, Throwable)
- * or (Throwable) or (String).
+ * with one of the following parameter types: {@code (String, Throwable)}
+ * or {@code (Throwable)} or {@code (String)}.
*
If not specified, subclasses of Spring's BeansException will be thrown,
* for example NoSuchBeanDefinitionException. As those are unchecked, the
* caller does not need to handle them, so it might be acceptable that
@@ -236,7 +236,7 @@ public class ServiceLocatorFactoryBean implements FactoryBean, BeanFacto
* Set mappings between service ids (passed into the service locator)
* and bean names (in the bean factory). Service ids that are not defined
* here will be treated as bean names as-is.
- *
The empty string as service id key defines the mapping for null and
+ *
The empty string as service id key defines the mapping for {@code null} and
* empty string, and for factory methods without parameter. If not defined,
* a single matching bean will be retrieved from the bean factory.
* @param serviceMappings mappings between service ids and bean names,
@@ -246,6 +246,7 @@ public class ServiceLocatorFactoryBean implements FactoryBean, BeanFacto
this.serviceMappings = serviceMappings;
}
+ @Override
public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
if (!(beanFactory instanceof ListableBeanFactory)) {
throw new FatalBeanException(
@@ -254,6 +255,7 @@ public class ServiceLocatorFactoryBean implements FactoryBean, BeanFacto
this.beanFactory = (ListableBeanFactory) beanFactory;
}
+ @Override
public void afterPropertiesSet() {
if (this.serviceLocatorInterface == null) {
throw new IllegalArgumentException("Property 'serviceLocatorInterface' is required");
@@ -271,8 +273,8 @@ public class ServiceLocatorFactoryBean implements FactoryBean, BeanFacto
* Determine the constructor to use for the given service locator exception
* class. Only called in case of a custom service locator exception.
*
The default implementation looks for a constructor with one of the
- * following parameter types: (String, Throwable)
- * or (Throwable) or (String).
+ * following parameter types: {@code (String, Throwable)}
+ * or {@code (Throwable)} or {@code (String)}.
* @param exceptionClass the exception class
* @return the constructor to use
* @see #setServiceLocatorExceptionClass
@@ -323,14 +325,17 @@ public class ServiceLocatorFactoryBean implements FactoryBean, BeanFacto
}
+ @Override
public Object getObject() {
return this.proxy;
}
+ @Override
public Class> getObjectType() {
return this.serviceLocatorInterface;
}
+ @Override
public boolean isSingleton() {
return true;
}
@@ -341,6 +346,7 @@ public class ServiceLocatorFactoryBean implements FactoryBean, BeanFacto
*/
private class ServiceLocatorInvocationHandler implements InvocationHandler {
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if (ReflectionUtils.isEqualsMethod(method)) {
// Only consider equal when proxies are identical.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/SingletonBeanRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/SingletonBeanRegistry.java
index 9bbc3ad07d..79d0234c37 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/SingletonBeanRegistry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/SingletonBeanRegistry.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.
@@ -37,9 +37,9 @@ public interface SingletonBeanRegistry {
* under the given bean name.
*
The given instance is supposed to be fully initialized; the registry
* will not perform any initialization callbacks (in particular, it won't
- * call InitializingBean's afterPropertiesSet method).
+ * call InitializingBean's {@code afterPropertiesSet} method).
* The given instance will not receive any destruction callbacks
- * (like DisposableBean's destroy method) either.
+ * (like DisposableBean's {@code destroy} method) either.
*
When running within a full BeanFactory: Register a bean definition
* instead of an existing instance if your bean is supposed to receive
* initialization and/or destruction callbacks.
@@ -65,23 +65,23 @@ public interface SingletonBeanRegistry {
*
NOTE: This lookup method is not aware of FactoryBean prefixes or aliases.
* You need to resolve the canonical bean name first before obtaining the singleton instance.
* @param beanName the name of the bean to look for
- * @return the registered singleton object, or null if none found
+ * @return the registered singleton object, or {@code null} if none found
* @see ConfigurableListableBeanFactory#getBeanDefinition
*/
Object getSingleton(String beanName);
/**
* Check if this registry contains a singleton instance with the given name.
- *
Only checks already instantiated singletons; does not return true
+ *
Only checks already instantiated singletons; does not return {@code true}
* for singleton bean definitions which have not been instantiated yet.
*
The main purpose of this method is to check manually registered singletons
* (see {@link #registerSingleton}). Can also be used to check whether a
* singleton defined by a bean definition has already been created.
*
To check whether a bean factory contains a bean definition with a given name,
- * use ListableBeanFactory's containsBeanDefinition. Calling both
- * containsBeanDefinition and containsSingleton answers
+ * use ListableBeanFactory's {@code containsBeanDefinition}. Calling both
+ * {@code containsBeanDefinition} and {@code containsSingleton} answers
* whether a specific bean factory contains a local bean instance with the given name.
- *
Use BeanFactory's containsBean for general checks whether the
+ *
Use BeanFactory's {@code containsBean} for general checks whether the
* factory knows about a bean with a given name (whether manually registered singleton
* instance or created by bean definition), also checking ancestor factories.
*
NOTE: This lookup method is not aware of FactoryBean prefixes or aliases.
@@ -101,7 +101,7 @@ public interface SingletonBeanRegistry {
*
The main purpose of this method is to check manually registered singletons
* (see {@link #registerSingleton}). Can also be used to check which singletons
* defined by a bean definition have already been created.
- * @return the list of names as a String array (never null)
+ * @return the list of names as a String array (never {@code null})
* @see #registerSingleton
* @see org.springframework.beans.factory.support.BeanDefinitionRegistry#getBeanDefinitionNames
* @see org.springframework.beans.factory.ListableBeanFactory#getBeanDefinitionNames
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/SmartInstantiationAwareBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/SmartInstantiationAwareBeanPostProcessor.java
index ff28d38b94..13f5a9be56 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/SmartInstantiationAwareBeanPostProcessor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/SmartInstantiationAwareBeanPostProcessor.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.
@@ -41,16 +41,16 @@ public interface SmartInstantiationAwareBeanPostProcessor extends InstantiationA
* processor's {@link #postProcessBeforeInstantiation} callback.
* @param beanClass the raw class of the bean
* @param beanName the name of the bean
- * @return the type of the bean, or null if not predictable
+ * @return the type of the bean, or {@code null} if not predictable
* @throws org.springframework.beans.BeansException in case of errors
*/
Class> predictBeanType(Class> beanClass, String beanName) throws BeansException;
/**
* Determine the candidate constructors to use for the given bean.
- * @param beanClass the raw class of the bean (never null)
+ * @param beanClass the raw class of the bean (never {@code null})
* @param beanName the name of the bean
- * @return the candidate constructors, or null if none specified
+ * @return the candidate constructors, or {@code null} if none specified
* @throws org.springframework.beans.BeansException in case of errors
*/
Constructor>[] determineCandidateConstructors(Class> beanClass, String beanName) throws BeansException;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java
index 01e7cb52e2..a9ff4fdbfb 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/TypedStringValue.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.
@@ -164,13 +164,14 @@ public class TypedStringValue implements BeanMetadataElement {
/**
- * Set the configuration source Object for this metadata element.
+ * Set the configuration source {@code Object} for this metadata element.
*
The exact type of the object will depend on the configuration mechanism used.
*/
public void setSource(Object source) {
this.source = source;
}
+ @Override
public Object getSource() {
return this.source;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/package-info.java b/spring-beans/src/main/java/org/springframework/beans/factory/package-info.java
index bae3c67c50..d4454c46ee 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/package-info.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/package-info.java
@@ -6,7 +6,7 @@
* Provides an alternative to the Singleton and Prototype design
* patterns, including a consistent approach to configuration management.
* Builds on the org.springframework.beans package.
- *
+ *
*
This package and related packages are discussed in Chapter 11 of
* Expert One-On-One J2EE Design and Development
* by Rod Johnson (Wrox, 2002).
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AbstractComponentDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AbstractComponentDefinition.java
index 24a03a757f..08d4aa43c1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AbstractComponentDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AbstractComponentDefinition.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.
@@ -35,6 +35,7 @@ public abstract class AbstractComponentDefinition implements ComponentDefinition
/**
* Delegates to {@link #getName}.
*/
+ @Override
public String getDescription() {
return getName();
}
@@ -42,6 +43,7 @@ public abstract class AbstractComponentDefinition implements ComponentDefinition
/**
* Returns an empty array.
*/
+ @Override
public BeanDefinition[] getBeanDefinitions() {
return new BeanDefinition[0];
}
@@ -49,6 +51,7 @@ public abstract class AbstractComponentDefinition implements ComponentDefinition
/**
* Returns an empty array.
*/
+ @Override
public BeanDefinition[] getInnerBeanDefinitions() {
return new BeanDefinition[0];
}
@@ -56,6 +59,7 @@ public abstract class AbstractComponentDefinition implements ComponentDefinition
/**
* Returns an empty array.
*/
+ @Override
public BeanReference[] getBeanReferences() {
return new BeanReference[0];
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java
index dd81c9d9b9..06d037c5d7 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/AliasDefinition.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 AliasDefinition implements BeanMetadataElement {
* Create a new AliasDefinition.
* @param beanName the canonical name of the bean
* @param alias the alias registered for the bean
- * @param source the source object (may be null)
+ * @param source the source object (may be {@code null})
*/
public AliasDefinition(String beanName, String alias, Object source) {
Assert.notNull(beanName, "Bean name must not be null");
@@ -73,6 +73,7 @@ public class AliasDefinition implements BeanMetadataElement {
return this.alias;
}
+ @Override
public final Object getSource() {
return this.source;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java
index 83dcab0f14..2b88d82765 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanComponentDefinition.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.
@@ -54,7 +54,7 @@ public class BeanComponentDefinition extends BeanDefinitionHolder implements Com
* Create a new BeanComponentDefinition for the given bean.
* @param beanDefinition the BeanDefinition
* @param beanName the name of the bean
- * @param aliases alias names for the bean, or null if none
+ * @param aliases alias names for the bean, or {@code null} if none
*/
public BeanComponentDefinition(BeanDefinition beanDefinition, String beanName, String[] aliases) {
super(beanDefinition, beanName, aliases);
@@ -94,22 +94,27 @@ public class BeanComponentDefinition extends BeanDefinitionHolder implements Com
}
+ @Override
public String getName() {
return getBeanName();
}
+ @Override
public String getDescription() {
return getShortDescription();
}
+ @Override
public BeanDefinition[] getBeanDefinitions() {
return new BeanDefinition[] {getBeanDefinition()};
}
+ @Override
public BeanDefinition[] getInnerBeanDefinitions() {
return this.innerBeanDefinitions;
}
+ @Override
public BeanReference[] getBeanReferences() {
return this.beanReferences;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanDefinitionParsingException.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanDefinitionParsingException.java
index 43b537dd05..2d01b986a1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanDefinitionParsingException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/BeanDefinitionParsingException.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.
@@ -26,6 +26,7 @@ import org.springframework.beans.factory.BeanDefinitionStoreException;
* @author Rob Harrop
* @since 2.0
*/
+@SuppressWarnings("serial")
public class BeanDefinitionParsingException extends BeanDefinitionStoreException {
/**
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java
index b20786a201..49c5f9f7b5 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ComponentDefinition.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.
@@ -33,18 +33,18 @@ import org.springframework.beans.factory.config.BeanReference;
* applications it is important that there is some mechanism in place to tie the {@link BeanDefinition BeanDefinitions}
* in the {@link org.springframework.beans.factory.BeanFactory} back to the configuration data in a way
* that has concrete meaning to the end user. As such, {@link org.springframework.beans.factory.xml.NamespaceHandler}
- * implementations are able to publish events in the form of a ComponentDefinition for each
- * logical entity being configured. Third parties can then {@link org.springframework.beans.factory.parsing.ReaderEventListener subscribe to these events},
+ * implementations are able to publish events in the form of a {@code ComponentDefinition} for each
+ * logical entity being configured. Third parties can then {@link ReaderEventListener subscribe to these events},
* allowing for a user-centric view of the bean metadata.
*
- *
Each ComponentDefinition has a {@link #getSource source object} which is configuration-specific.
+ *
Each {@code ComponentDefinition} has a {@link #getSource source object} which is configuration-specific.
* In the case of XML-based configuration this is typically the {@link org.w3c.dom.Node} which contains the user
* supplied configuration information. In addition to this, each {@link BeanDefinition} enclosed in a
- * ComponentDefinition has its own {@link BeanDefinition#getSource() source object} which may point
+ * {@code ComponentDefinition} has its own {@link BeanDefinition#getSource() source object} which may point
* to a different, more specific, set of configuration data. Beyond this, individual pieces of bean metadata such
* as the {@link org.springframework.beans.PropertyValue PropertyValues} may also have a source object giving an
* even greater level of detail. Source object extraction is handled through the
- * {@link org.springframework.beans.factory.parsing.SourceExtractor} which can be customized as required.
+ * {@link SourceExtractor} which can be customized as required.
*
*
Whilst direct access to important {@link BeanReference BeanReferences} is provided through
* {@link #getBeanReferences}, tools may wish to inspect all {@link BeanDefinition BeanDefinitions} to gather
@@ -60,7 +60,7 @@ import org.springframework.beans.factory.config.BeanReference;
* {@link BeanDefinition#getRole role identifier}. The role is essentially a hint to the tool as to how
* important the configuration provider believes a {@link BeanDefinition} is to the end user. It is expected
* that tools will not display all {@link BeanDefinition BeanDefinitions} for a given
- * ComponentDefinition choosing instead to filter based on the role. Tools may choose to make
+ * {@code ComponentDefinition} choosing instead to filter based on the role. Tools may choose to make
* this filtering user configurable. Particular notice should be given to the
* {@link BeanDefinition#ROLE_INFRASTRUCTURE INFRASTRUCTURE role identifier}. {@link BeanDefinition BeanDefinitions}
* classified with this role are completely unimportant to the end user and are required only for
@@ -77,7 +77,7 @@ import org.springframework.beans.factory.config.BeanReference;
public interface ComponentDefinition extends BeanMetadataElement {
/**
- * Get the user-visible name of this ComponentDefinition.
+ * Get the user-visible name of this {@code ComponentDefinition}.
*
This should link back directly to the corresponding configuration data
* for this component in a given context.
*/
@@ -86,14 +86,14 @@ public interface ComponentDefinition extends BeanMetadataElement {
/**
* Return a friendly description of the described component.
*
Implementations are encouraged to return the same value from
- * toString().
+ * {@code toString()}.
*/
String getDescription();
/**
* Return the {@link BeanDefinition BeanDefinitions} that were registered
- * to form this ComponentDefinition.
- *
It should be noted that a ComponentDefinition may well be related with
+ * to form this {@code ComponentDefinition}.
+ *
It should be noted that a {@code ComponentDefinition} may well be related with
* other {@link BeanDefinition BeanDefinitions} via {@link BeanReference references},
* however these are not included as they may be not available immediately.
* Important {@link BeanReference BeanReferences} are available from {@link #getBeanReferences()}.
@@ -112,7 +112,7 @@ public interface ComponentDefinition extends BeanMetadataElement {
/**
* Return the set of {@link BeanReference BeanReferences} that are considered
- * to be important to this ComponentDefinition.
+ * to be important to this {@code ComponentDefinition}.
*
Other {@link BeanReference BeanReferences} may exist within the associated
* {@link BeanDefinition BeanDefinitions}, however these are not considered
* to be needed for validation or for user visualization.
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/CompositeComponentDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/CompositeComponentDefinition.java
index e8589d0889..550ae761c2 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/CompositeComponentDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/CompositeComponentDefinition.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.
@@ -51,10 +51,12 @@ public class CompositeComponentDefinition extends AbstractComponentDefinition {
}
+ @Override
public String getName() {
return this.name;
}
+ @Override
public Object getSource() {
return this.source;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ConstructorArgumentEntry.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ConstructorArgumentEntry.java
index 86540ef078..72357a8cc7 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ConstructorArgumentEntry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ConstructorArgumentEntry.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.
@@ -41,9 +41,9 @@ public class ConstructorArgumentEntry implements ParseState.Entry {
/**
* Creates a new instance of the {@link ConstructorArgumentEntry} class
- * representing a constructor argument at the supplied index.
+ * representing a constructor argument at the supplied {@code index}.
* @param index the index of the constructor argument
- * @throws IllegalArgumentException if the supplied index
+ * @throws IllegalArgumentException if the supplied {@code index}
* is less than zero
*/
public ConstructorArgumentEntry(int index) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/EmptyReaderEventListener.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/EmptyReaderEventListener.java
index b5d49c09a1..f27831a63f 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/EmptyReaderEventListener.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/EmptyReaderEventListener.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.
@@ -25,18 +25,22 @@ package org.springframework.beans.factory.parsing;
*/
public class EmptyReaderEventListener implements ReaderEventListener {
+ @Override
public void defaultsRegistered(DefaultsDefinition defaultsDefinition) {
// no-op
}
+ @Override
public void componentRegistered(ComponentDefinition componentDefinition) {
// no-op
}
+ @Override
public void aliasRegistered(AliasDefinition aliasDefinition) {
// no-op
}
+ @Override
public void importProcessed(ImportDefinition importDefinition) {
// no-op
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java
index 9b3311f512..859d611f14 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/FailFastProblemReporter.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.
@@ -22,7 +22,7 @@ import org.apache.commons.logging.LogFactory;
/**
* Simple {@link ProblemReporter} implementation that exhibits fail-fast
* behavior when errors are encountered.
- *
+ *
*
The first error encountered results in a {@link BeanDefinitionParsingException}
* being thrown.
*
@@ -41,7 +41,7 @@ public class FailFastProblemReporter implements ProblemReporter {
/**
* Set the {@link Log logger} that is to be used to report warnings.
- *
If set to null then a default {@link Log logger} set to
+ *
If set to {@code null} then a default {@link Log logger} set to
* the name of the instance class will be used.
* @param logger the {@link Log logger} that is to be used to report warnings
*/
@@ -55,6 +55,7 @@ public class FailFastProblemReporter implements ProblemReporter {
* that has occurred.
* @param problem the source of the error
*/
+ @Override
public void fatal(Problem problem) {
throw new BeanDefinitionParsingException(problem);
}
@@ -64,14 +65,16 @@ public class FailFastProblemReporter implements ProblemReporter {
* that has occurred.
* @param problem the source of the error
*/
+ @Override
public void error(Problem problem) {
throw new BeanDefinitionParsingException(problem);
}
/**
- * Writes the supplied {@link Problem} to the {@link Log} at WARN level.
+ * Writes the supplied {@link Problem} to the {@link Log} at {@code WARN} level.
* @param problem the source of the warning
*/
+ @Override
public void warning(Problem problem) {
this.logger.warn(problem, problem.getRootCause());
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java
index 4b7a834d08..85eea69610 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ImportDefinition.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.
@@ -47,7 +47,7 @@ public class ImportDefinition implements BeanMetadataElement {
/**
* Create a new ImportDefinition.
* @param importedResource the location of the imported resource
- * @param source the source object (may be null)
+ * @param source the source object (may be {@code null})
*/
public ImportDefinition(String importedResource, Object source) {
this(importedResource, null, source);
@@ -56,7 +56,7 @@ public class ImportDefinition implements BeanMetadataElement {
/**
* Create a new ImportDefinition.
* @param importedResource the location of the imported resource
- * @param source the source object (may be null)
+ * @param source the source object (may be {@code null})
*/
public ImportDefinition(String importedResource, Resource[] actualResources, Object source) {
Assert.notNull(importedResource, "Imported resource must not be null");
@@ -77,6 +77,7 @@ public class ImportDefinition implements BeanMetadataElement {
return this.actualResources;
}
+ @Override
public final Object getSource() {
return this.source;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Location.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Location.java
index c5cbcbecbe..9ff54665c7 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Location.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Location.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.
@@ -27,7 +27,7 @@ import org.springframework.util.Assert;
* {@link #getSource() source} location might be 'The bean defined on
* line 76 of beans.properties has an invalid Class'; another source might
* be the actual DOM Element from a parsed XML {@link org.w3c.dom.Document};
- * or the source object might simply be null.
+ * or the source object might simply be {@code null}.
*
* @author Rob Harrop
* @since 2.0
@@ -51,7 +51,7 @@ public class Location {
* Create a new instance of the {@link Location} class.
* @param resource the resource with which this location is associated
* @param source the actual location within the associated resource
- * (may be null)
+ * (may be {@code null})
*/
public Location(Resource resource, Object source) {
Assert.notNull(resource, "Resource must not be null");
@@ -69,7 +69,7 @@ public class Location {
/**
* Get the actual location within the associated {@link #getResource() resource}
- * (may be null).
+ * (may be {@code null}).
*
See the {@link Location class level javadoc for this class} for examples
* of what the actual type of the returned object may be.
*/
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java
index d95cf1ff1c..3e3fa62524 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/NullSourceExtractor.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.
@@ -19,7 +19,7 @@ package org.springframework.beans.factory.parsing;
import org.springframework.core.io.Resource;
/**
- * Simple implementation of {@link SourceExtractor} that returns null
+ * Simple implementation of {@link SourceExtractor} that returns {@code null}
* as the source metadata.
*
*
This is the default implementation and prevents too much metadata from being
@@ -31,8 +31,9 @@ import org.springframework.core.io.Resource;
public class NullSourceExtractor implements SourceExtractor {
/**
- * This implementation simply returns null for any input.
+ * This implementation simply returns {@code null} for any input.
*/
+ @Override
public Object extractSource(Object sourceCandidate, Resource definitionResource) {
return null;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java
index 7ef3254da7..3c4b68e339 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ParseState.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.
@@ -44,15 +44,15 @@ public final class ParseState {
/**
- * Create a new ParseState with an empty {@link Stack}.
+ * Create a new {@code ParseState} with an empty {@link Stack}.
*/
public ParseState() {
this.state = new Stack();
}
/**
- * Create a new ParseState whose {@link Stack} is a {@link Object#clone clone}
- * of that of the passed in ParseState.
+ * Create a new {@code ParseState} whose {@link Stack} is a {@link Object#clone clone}
+ * of that of the passed in {@code ParseState}.
*/
private ParseState(ParseState other) {
this.state = (Stack) other.state.clone();
@@ -75,7 +75,7 @@ public final class ParseState {
/**
* Return the {@link Entry} currently at the top of the {@link Stack} or
- * null if the {@link Stack} is empty.
+ * {@code null} if the {@link Stack} is empty.
*/
public Entry peek() {
return (Entry) (this.state.empty() ? null : this.state.peek());
@@ -91,7 +91,7 @@ public final class ParseState {
/**
- * Returns a tree-style representation of the current ParseState.
+ * Returns a tree-style representation of the current {@code ParseState}.
*/
@Override
public String toString() {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java
index 573244001d..a9f56dbfbb 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PassThroughSourceExtractor.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.
@@ -35,10 +35,11 @@ import org.springframework.core.io.Resource;
public class PassThroughSourceExtractor implements SourceExtractor {
/**
- * Simply returns the supplied sourceCandidate as-is.
+ * Simply returns the supplied {@code sourceCandidate} as-is.
* @param sourceCandidate the source metadata
- * @return the supplied sourceCandidate
+ * @return the supplied {@code sourceCandidate}
*/
+ @Override
public Object extractSource(Object sourceCandidate, Resource definingResource) {
return sourceCandidate;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java
index b895ad23ba..9f78a2909d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/Problem.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.
@@ -61,8 +61,8 @@ public class Problem {
/**
* Create a new instance of the {@link Problem} class.
- * @param message a message detailing the problem
- * @param rootCause the underlying expection that caused the error (may be null)
+ * @param message a message detailing the problem
+ * @param rootCause the underlying expection that caused the error (may be {@code null})
* @param parseState the {@link ParseState} at the time of the error
* @param location the location within a bean configuration source that triggered the error
*/
@@ -100,14 +100,14 @@ public class Problem {
}
/**
- * Get the {@link ParseState} at the time of the error (may be null).
+ * Get the {@link ParseState} at the time of the error (may be {@code null}).
*/
public ParseState getParseState() {
return this.parseState;
}
/**
- * Get the underlying expection that caused the error (may be null).
+ * Get the underlying expection that caused the error (may be {@code null}).
*/
public Throwable getRootCause() {
return this.rootCause;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ProblemReporter.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ProblemReporter.java
index a9e1bedbe9..649b17123a 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ProblemReporter.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/ProblemReporter.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.
@@ -31,21 +31,21 @@ public interface ProblemReporter {
* Called when a fatal error is encountered during the parsing process.
*
Implementations must treat the given problem as fatal,
* i.e. they have to eventually raise an exception.
- * @param problem the source of the error (never null)
+ * @param problem the source of the error (never {@code null})
*/
void fatal(Problem problem);
/**
* Called when an error is encountered during the parsing process.
*
Implementations may choose to treat errors as fatal.
- * @param problem the source of the error (never null)
+ * @param problem the source of the error (never {@code null})
*/
void error(Problem problem);
/**
* Called when a warning is raised during the parsing process.
*
Warnings are never considered to be fatal.
- * @param problem the source of the warning (never null)
+ * @param problem the source of the warning (never {@code null})
*/
void warning(Problem problem);
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.java
index c1737e456c..2f940269eb 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/PropertyEntry.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.
@@ -32,8 +32,8 @@ public class PropertyEntry implements ParseState.Entry {
/**
* Creates a new instance of the {@link PropertyEntry} class.
* @param name the name of the JavaBean property represented by this instance
- * @throws IllegalArgumentException if the supplied name is null
- * or consists wholly of whitespace
+ * @throws IllegalArgumentException if the supplied {@code name} is {@code null}
+ * or consists wholly of whitespace
*/
public PropertyEntry(String name) {
if (!StringUtils.hasText(name)) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.java
index 2c80092fb1..e21707376e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/QualifierEntry.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.
@@ -20,7 +20,7 @@ import org.springframework.util.StringUtils;
/**
* {@link ParseState} entry representing an autowire candidate qualifier.
- *
+ *
* @author Mark Fisher
* @since 2.5
*/
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/SourceExtractor.java b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/SourceExtractor.java
index 55988c3726..0b0fe96658 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/parsing/SourceExtractor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/parsing/SourceExtractor.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.
@@ -38,10 +38,10 @@ public interface SourceExtractor {
/**
* Extract the source metadata from the candidate object supplied
* by the configuration parser.
- * @param sourceCandidate the original source metadata (never null)
+ * @param sourceCandidate the original source metadata (never {@code null})
* @param definingResource the resource that defines the given source object
- * (may be null)
- * @return the source metadata object to store (may be null)
+ * (may be {@code null})
+ * @return the source metadata object to store (may be {@code null})
*/
Object extractSource(Object sourceCandidate, Resource definingResource);
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
index 1cf82fc690..4bb0f75145 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
@@ -164,7 +164,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
* Create a new AbstractAutowireCapableBeanFactory with the given parent.
- * @param parentBeanFactory parent bean factory, or null if none
+ * @param parentBeanFactory parent bean factory, or {@code null} if none
*/
public AbstractAutowireCapableBeanFactory(BeanFactory parentBeanFactory) {
this();
@@ -280,6 +280,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
// Typical methods for creating and populating external bean instances
//-------------------------------------------------------------------------
+ @Override
@SuppressWarnings("unchecked")
public T createBean(Class beanClass) throws BeansException {
// Use prototype bean definition, to avoid registering bean as dependent bean.
@@ -289,6 +290,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
return (T) createBean(beanClass.getName(), bd, null);
}
+ @Override
public void autowireBean(Object existingBean) {
// Use non-singleton bean definition, to avoid registering bean as dependent bean.
RootBeanDefinition bd = new RootBeanDefinition(ClassUtils.getUserClass(existingBean));
@@ -299,6 +301,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
populateBean(bd.getBeanClass().getName(), bd, bw);
}
+ @Override
public Object configureBean(Object existingBean, String beanName) throws BeansException {
markBeanAsCreated(beanName);
BeanDefinition mbd = getMergedBeanDefinition(beanName);
@@ -320,6 +323,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
return initializeBean(beanName, existingBean, bd);
}
+ @Override
public Object resolveDependency(DependencyDescriptor descriptor, String beanName) throws BeansException {
return resolveDependency(descriptor, beanName, null, null);
}
@@ -329,6 +333,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
// Specialized methods for fine-grained control over the bean lifecycle
//-------------------------------------------------------------------------
+ @Override
public Object createBean(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException {
// Use non-singleton bean definition, to avoid registering bean as dependent bean.
RootBeanDefinition bd = new RootBeanDefinition(beanClass, autowireMode, dependencyCheck);
@@ -336,6 +341,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
return createBean(beanClass.getName(), bd, null);
}
+ @Override
public Object autowire(Class beanClass, int autowireMode, boolean dependencyCheck) throws BeansException {
// Use non-singleton bean definition, to avoid registering bean as dependent bean.
final RootBeanDefinition bd = new RootBeanDefinition(beanClass, autowireMode, dependencyCheck);
@@ -346,10 +352,11 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
else {
Object bean;
final BeanFactory parent = this;
-
+
if (System.getSecurityManager() != null) {
bean = AccessController.doPrivileged(new PrivilegedAction() {
-
+
+ @Override
public Object run() {
return getInstantiationStrategy().instantiate(bd, null, parent);
}
@@ -358,12 +365,13 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
else {
bean = getInstantiationStrategy().instantiate(bd, null, parent);
}
-
+
populateBean(beanClass.getName(), bd, new BeanWrapperImpl(bean));
return bean;
}
}
+ @Override
public void autowireBeanProperties(Object existingBean, int autowireMode, boolean dependencyCheck)
throws BeansException {
@@ -379,6 +387,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
populateBean(bd.getBeanClass().getName(), bd, bw);
}
+ @Override
public void applyBeanPropertyValues(Object existingBean, String beanName) throws BeansException {
markBeanAsCreated(beanName);
BeanDefinition bd = getMergedBeanDefinition(beanName);
@@ -387,10 +396,12 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
applyPropertyValues(beanName, bd, bw, bd.getPropertyValues());
}
+ @Override
public Object initializeBean(Object existingBean, String beanName) {
return initializeBean(beanName, existingBean, null);
}
+ @Override
public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
throws BeansException {
@@ -404,6 +415,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
return result;
}
+ @Override
public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
throws BeansException {
@@ -467,13 +479,13 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
* Actually create the specified bean. Pre-creation processing has already happened
- * at this point, e.g. checking postProcessBeforeInstantiation callbacks.
+ * at this point, e.g. checking {@code postProcessBeforeInstantiation} callbacks.
*
Differentiates between default bean instantiation, use of a
* factory method, and autowiring a constructor.
* @param beanName the name of the bean
* @param mbd the merged bean definition for the bean
* @param args arguments to use if creating a prototype using explicit arguments to a
- * static factory method. This parameter must be null except in this case.
+ * static factory method. This parameter must be {@code null} except in this case.
* @return a new instance of the bean
* @throws BeanCreationException if the bean could not be created
* @see #instantiateBean
@@ -510,6 +522,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
"' to allow for resolving potential circular references");
}
addSingletonFactory(beanName, new ObjectFactory() {
+ @Override
public Object getObject() throws BeansException {
return getEarlyBeanReference(beanName, mbd, bean);
}
@@ -606,8 +619,8 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* @param beanName the name of the bean (for error handling purposes)
* @param mbd the merged bean definition for the bean
* @param typesToMatch the types to match in case of internal type matching purposes
- * (also signals that the returned Class will never be exposed to application code)
- * @return the type for the bean if determinable, or null else
+ * (also signals that the returned {@code Class} will never be exposed to application code)
+ * @return the type for the bean if determinable, or {@code null} else
* @see #createBean
*/
protected Class getTypeForFactoryMethod(String beanName, RootBeanDefinition mbd, Class[] typesToMatch) {
@@ -668,7 +681,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
* This implementation attempts to query the FactoryBean's generic parameter metadata
* if present to determine the object type. If not present, i.e. the FactoryBean is
- * declared as a raw type, checks the FactoryBean's getObjectType method
+ * declared as a raw type, checks the FactoryBean's {@code getObjectType} method
* on a plain instance of the FactoryBean, without bean properties applied yet.
* If this doesn't return a type yet, a full creation of the FactoryBean is
* used as fallback (through delegation to the superclass's implementation).
@@ -695,6 +708,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
// @Bean methods, there may be parameters present.
ReflectionUtils.doWithMethods(fbClass,
new ReflectionUtils.MethodCallback() {
+ @Override
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {
if (method.getName().equals(factoryMethodName) &&
FactoryBean.class.isAssignableFrom(method.getReturnType())) {
@@ -755,11 +769,11 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
* Obtain a "shortcut" singleton FactoryBean instance to use for a
- * getObjectType() call, without full initialization
+ * {@code getObjectType()} call, without full initialization
* of the FactoryBean.
* @param beanName the name of the bean
* @param mbd the bean definition for the bean
- * @return the FactoryBean instance, or null to indicate
+ * @return the FactoryBean instance, or {@code null} to indicate
* that we couldn't obtain a shortcut FactoryBean instance
*/
private FactoryBean getSingletonFactoryBeanForTypeCheck(String beanName, RootBeanDefinition mbd) {
@@ -796,11 +810,11 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
* Obtain a "shortcut" non-singleton FactoryBean instance to use for a
- * getObjectType() call, without full initialization
+ * {@code getObjectType()} call, without full initialization
* of the FactoryBean.
* @param beanName the name of the bean
* @param mbd the bean definition for the bean
- * @return the FactoryBean instance, or null to indicate
+ * @return the FactoryBean instance, or {@code null} to indicate
* that we couldn't obtain a shortcut FactoryBean instance
*/
private FactoryBean getNonSingletonFactoryBeanForTypeCheck(String beanName, RootBeanDefinition mbd) {
@@ -827,7 +841,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
* Apply MergedBeanDefinitionPostProcessors to the specified bean definition,
- * invoking their postProcessMergedBeanDefinition methods.
+ * invoking their {@code postProcessMergedBeanDefinition} methods.
* @param mbd the merged bean definition for the bean
* @param beanType the actual type of the managed bean instance
* @param beanName the name of the bean
@@ -856,7 +870,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* before-instantiation shortcut for the specified bean.
* @param beanName the name of the bean
* @param mbd the bean definition for the bean
- * @return the shortcut-determined bean instance, or null if none
+ * @return the shortcut-determined bean instance, or {@code null} if none
*/
protected Object resolveBeforeInstantiation(String beanName, RootBeanDefinition mbd) {
Object bean = null;
@@ -875,13 +889,13 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
* Apply InstantiationAwareBeanPostProcessors to the specified bean definition
- * (by class and name), invoking their postProcessBeforeInstantiation methods.
+ * (by class and name), invoking their {@code postProcessBeforeInstantiation} methods.
*
Any returned object will be used as the bean instead of actually instantiating
- * the target bean. A null return value from the post-processor will
+ * the target bean. A {@code null} return value from the post-processor will
* result in the target bean being instantiated.
* @param beanClass the class of the bean to be instantiated
* @param beanName the name of the bean
- * @return the bean object to use instead of a default instance of the target bean, or null
+ * @return the bean object to use instead of a default instance of the target bean, or {@code null}
* @throws BeansException if any post-processing failed
* @see InstantiationAwareBeanPostProcessor#postProcessBeforeInstantiation
*/
@@ -962,7 +976,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* {@link SmartInstantiationAwareBeanPostProcessor SmartInstantiationAwareBeanPostProcessors}.
* @param beanClass the raw class of the bean
* @param beanName the name of the bean
- * @return the candidate constructors, or null if none specified
+ * @return the candidate constructors, or {@code null} if none specified
* @throws org.springframework.beans.BeansException in case of errors
* @see org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor#determineCandidateConstructors
*/
@@ -995,6 +1009,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
final BeanFactory parent = this;
if (System.getSecurityManager() != null) {
beanInstance = AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
return getInstantiationStrategy().instantiate(mbd, beanName, parent);
}
@@ -1019,7 +1034,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* @param beanName the name of the bean
* @param mbd the bean definition for the bean
* @param explicitArgs argument values passed in programmatically via the getBean method,
- * or null if none (-> use constructor argument values from bean definition)
+ * or {@code null} if none (-> use constructor argument values from bean definition)
* @return BeanWrapper for the new instance
* @see #getBean(String, Object[])
*/
@@ -1040,7 +1055,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* @param mbd the bean definition for the bean
* @param ctors the chosen candidate constructors
* @param explicitArgs argument values passed in programmatically via the getBean method,
- * or null if none (-> use constructor argument values from bean definition)
+ * or {@code null} if none (-> use constructor argument values from bean definition)
* @return BeanWrapper for the new instance
*/
protected BeanWrapper autowireConstructor(
@@ -1346,7 +1361,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
MutablePropertyValues mpvs = null;
List original;
-
+
if (System.getSecurityManager()!= null) {
if (bw instanceof BeanWrapperImpl) {
((BeanWrapperImpl) bw).setSecurityContext(getAccessControlContext());
@@ -1452,7 +1467,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* @param beanName the bean name in the factory (for debugging purposes)
* @param bean the new bean instance we may need to initialize
* @param mbd the bean definition that the bean was created with
- * (can also be null, if given an existing bean instance)
+ * (can also be {@code null}, if given an existing bean instance)
* @return the initialized bean instance (potentially wrapped)
* @see BeanNameAware
* @see BeanClassLoaderAware
@@ -1464,6 +1479,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
protected Object initializeBean(final String beanName, final Object bean, RootBeanDefinition mbd) {
if (System.getSecurityManager() != null) {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
invokeAwareMethods(beanName, bean);
return null;
@@ -1473,7 +1489,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
else {
invokeAwareMethods(beanName, bean);
}
-
+
Object wrappedBean = bean;
if (mbd == null || !mbd.isSynthetic()) {
wrappedBean = applyBeanPostProcessorsBeforeInitialization(wrappedBean, beanName);
@@ -1516,7 +1532,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* @param beanName the bean name in the factory (for debugging purposes)
* @param bean the new bean instance we may need to initialize
* @param mbd the merged bean definition that the bean was created with
- * (can also be null, if given an existing bean instance)
+ * (can also be {@code null}, if given an existing bean instance)
* @throws Throwable if thrown by init methods or by the invocation process
* @see #invokeCustomInitMethod
*/
@@ -1531,6 +1547,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
if (System.getSecurityManager() != null) {
try {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ @Override
public Object run() throws Exception {
((InitializingBean) bean).afterPropertiesSet();
return null;
@@ -1540,7 +1557,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
catch (PrivilegedActionException pae) {
throw pae.getException();
}
- }
+ }
else {
((InitializingBean) bean).afterPropertiesSet();
}
@@ -1585,9 +1602,10 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
if (logger.isDebugEnabled()) {
logger.debug("Invoking init method '" + initMethodName + "' on bean with name '" + beanName + "'");
}
-
+
if (System.getSecurityManager() != null) {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ @Override
public Object run() throws Exception {
ReflectionUtils.makeAccessible(initMethod);
return null;
@@ -1595,6 +1613,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
});
try {
AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ @Override
public Object run() throws Exception {
initMethod.invoke(bean);
return null;
@@ -1610,7 +1629,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
try {
ReflectionUtils.makeAccessible(initMethod);
initMethod.invoke(bean);
- }
+ }
catch (InvocationTargetException ex) {
throw ex.getTargetException();
}
@@ -1619,7 +1638,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
/**
- * Applies the postProcessAfterInitialization callback of all
+ * Applies the {@code postProcessAfterInitialization} callback of all
* registered BeanPostProcessors, giving them a chance to post-process the
* object obtained from FactoryBeans (for example, to auto-proxy them).
* @see #applyBeanPostProcessorsAfterInitialization
@@ -1643,6 +1662,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
* Special DependencyDescriptor variant for autowire="byType".
* Always optional; never considering the parameter name for choosing a primary candidate.
*/
+ @SuppressWarnings("serial")
private static class AutowireByTypeDependencyDescriptor extends DependencyDescriptor {
public AutowireByTypeDependencyDescriptor(MethodParameter methodParameter, boolean eager) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
index 652d45afb2..3d1895aa78 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinition.java
@@ -52,6 +52,7 @@ import org.springframework.util.StringUtils;
* @see RootBeanDefinition
* @see ChildBeanDefinition
*/
+@SuppressWarnings("serial")
public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccessor
implements BeanDefinition, Cloneable {
@@ -277,13 +278,13 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* definition (presumably the child).
*
*
Will override beanClass if specified in the given bean definition.
- *
Will always take abstract, scope,
- * lazyInit, autowireMode, dependencyCheck,
- * and dependsOn from the given bean definition.
- *
Will add constructorArgumentValues, propertyValues,
- * methodOverrides from the given bean definition to existing ones.
- *
Will override factoryBeanName, factoryMethodName,
- * initMethodName, and destroyMethodName if specified
+ *
Will always take {@code abstract}, {@code scope},
+ * {@code lazyInit}, {@code autowireMode}, {@code dependencyCheck},
+ * and {@code dependsOn} from the given bean definition.
+ *
Will add {@code constructorArgumentValues}, {@code propertyValues},
+ * {@code methodOverrides} from the given bean definition to existing ones.
+ *
Will override {@code factoryBeanName}, {@code factoryMethodName},
+ * {@code initMethodName}, and {@code destroyMethodName} if specified
* in the given bean definition.
*
*/
@@ -369,7 +370,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
* Return the class of the wrapped bean, if already resolved.
- * @return the bean class, or null if none defined
+ * @return the bean class, or {@code null} if none defined
* @throws IllegalStateException if the bean definition does not define a bean class,
* or a specified bean class name has not been resolved into an actual Class
*/
@@ -385,10 +386,12 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
return (Class) beanClassObject;
}
+ @Override
public void setBeanClassName(String beanClassName) {
this.beanClass = beanClassName;
}
+ @Override
public String getBeanClassName() {
Object beanClassObject = this.beanClass;
if (beanClassObject instanceof Class) {
@@ -428,6 +431,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* @see #SCOPE_SINGLETON
* @see #SCOPE_PROTOTYPE
*/
+ @Override
public void setScope(String scope) {
this.scope = scope;
this.singleton = SCOPE_SINGLETON.equals(scope) || SCOPE_DEFAULT.equals(scope);
@@ -437,6 +441,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
* Return the name of the target scope for the bean.
*/
+ @Override
public String getScope() {
return this.scope;
}
@@ -466,6 +471,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* returned from all calls.
* @see #SCOPE_SINGLETON
*/
+ @Override
public boolean isSingleton() {
return this.singleton;
}
@@ -475,6 +481,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* returned for each call.
* @see #SCOPE_PROTOTYPE
*/
+ @Override
public boolean isPrototype() {
return this.prototype;
}
@@ -493,15 +500,17 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* Return whether this bean is "abstract", i.e. not meant to be instantiated
* itself but rather just serving as parent for concrete child bean definitions.
*/
+ @Override
public boolean isAbstract() {
return this.abstractFlag;
}
/**
* Set whether this bean should be lazily initialized.
- *
If false, the bean will get instantiated on startup by bean
+ *
If {@code false}, the bean will get instantiated on startup by bean
* factories that perform eager initialization of singletons.
*/
+ @Override
public void setLazyInit(boolean lazyInit) {
this.lazyInit = lazyInit;
}
@@ -510,6 +519,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* Return whether this bean should be lazily initialized, i.e. not
* eagerly instantiated on startup. Only applicable to a singleton bean.
*/
+ @Override
public boolean isLazyInit() {
return this.lazyInit;
}
@@ -590,6 +600,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* constructor arguments. This property should just be necessary for other kinds
* of dependencies like statics (*ugh*) or database preparation on startup.
*/
+ @Override
public void setDependsOn(String[] dependsOn) {
this.dependsOn = dependsOn;
}
@@ -597,6 +608,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
* Return the bean names that this bean depends on.
*/
+ @Override
public String[] getDependsOn() {
return this.dependsOn;
}
@@ -604,6 +616,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
* Set whether this bean is a candidate for getting autowired into some other bean.
*/
+ @Override
public void setAutowireCandidate(boolean autowireCandidate) {
this.autowireCandidate = autowireCandidate;
}
@@ -611,6 +624,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
* Return whether this bean is a candidate for getting autowired into some other bean.
*/
+ @Override
public boolean isAutowireCandidate() {
return this.autowireCandidate;
}
@@ -620,6 +634,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* If this value is true for exactly one bean among multiple
* matching candidates, it will serve as a tie-breaker.
*/
+ @Override
public void setPrimary(boolean primary) {
this.primary = primary;
}
@@ -629,6 +644,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
* If this value is true for exactly one bean among multiple
* matching candidates, it will serve as a tie-breaker.
*/
+ @Override
public boolean isPrimary() {
return this.primary;
}
@@ -696,7 +712,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
}
/**
- * Specify whether to resolve constructors in lenient mode (true,
+ * Specify whether to resolve constructors in lenient mode ({@code true},
* which is the default) or to switch to strict resolution (throwing an exception
* in case of ambigious constructors that all match when converting the arguments,
* whereas lenient mode would use the one with the 'closest' type matches).
@@ -721,8 +737,9 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
}
/**
- * Return constructor argument values for this bean (never null).
+ * Return constructor argument values for this bean (never {@code null}).
*/
+ @Override
public ConstructorArgumentValues getConstructorArgumentValues() {
return this.constructorArgumentValues;
}
@@ -742,8 +759,9 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
}
/**
- * Return property values for this bean (never null).
+ * Return property values for this bean (never {@code null}).
*/
+ @Override
public MutablePropertyValues getPropertyValues() {
return this.propertyValues;
}
@@ -765,24 +783,28 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
}
+ @Override
public void setFactoryBeanName(String factoryBeanName) {
this.factoryBeanName = factoryBeanName;
}
+ @Override
public String getFactoryBeanName() {
return this.factoryBeanName;
}
+ @Override
public void setFactoryMethodName(String factoryMethodName) {
this.factoryMethodName = factoryMethodName;
}
+ @Override
public String getFactoryMethodName() {
return this.factoryMethodName;
}
/**
- * Set the name of the initializer method. The default is null
+ * Set the name of the initializer method. The default is {@code null}
* in which case there is no initializer method.
*/
public void setInitMethodName(String initMethodName) {
@@ -798,7 +820,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
* Specify whether or not the configured init method is the default.
- * Default value is false.
+ * Default value is {@code false}.
* @see #setInitMethodName
*/
public void setEnforceInitMethod(boolean enforceInitMethod) {
@@ -814,7 +836,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
}
/**
- * Set the name of the destroy method. The default is null
+ * Set the name of the destroy method. The default is {@code null}
* in which case there is no destroy method.
*/
public void setDestroyMethodName(String destroyMethodName) {
@@ -830,7 +852,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
* Specify whether or not the configured destroy method is the default.
- * Default value is false.
+ * Default value is {@code false}.
* @see #setDestroyMethodName
*/
public void setEnforceDestroyMethod(boolean enforceDestroyMethod) {
@@ -849,7 +871,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
* Set whether this bean definition is 'synthetic', that is, not defined
* by the application itself (for example, an infrastructure bean such
- * as a helper for auto-proxying, created through <aop:config>).
+ * as a helper for auto-proxying, created through {@code <aop:config>}).
*/
public void setSynthetic(boolean synthetic) {
this.synthetic = synthetic;
@@ -864,15 +886,16 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
}
/**
- * Set the role hint for this BeanDefinition.
+ * Set the role hint for this {@code BeanDefinition}.
*/
public void setRole(int role) {
this.role = role;
}
/**
- * Return the role hint for this BeanDefinition.
+ * Return the role hint for this {@code BeanDefinition}.
*/
+ @Override
public int getRole() {
return this.role;
}
@@ -885,6 +908,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
this.description = description;
}
+ @Override
public String getDescription() {
return this.description;
}
@@ -912,6 +936,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
this.resource = new DescriptiveResource(resourceDescription);
}
+ @Override
public String getResourceDescription() {
return (this.resource != null ? this.resource.getDescription() : null);
}
@@ -923,6 +948,7 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
this.resource = new BeanDefinitionResource(originatingBd);
}
+ @Override
public BeanDefinition getOriginatingBeanDefinition() {
return (this.resource instanceof BeanDefinitionResource ?
((BeanDefinitionResource) this.resource).getBeanDefinition() : null);
@@ -981,9 +1007,9 @@ public abstract class AbstractBeanDefinition extends BeanMetadataAttributeAccess
/**
- * Public declaration of Object's clone() method.
+ * Public declaration of Object's {@code clone()} method.
* Delegates to {@link #cloneBeanDefinition()}.
- * @see java.lang.Object#clone()
+ * @see Object#clone()
*/
@Override
public Object clone() {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java
index d0f524ed7d..3f81a2a2b0 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanDefinitionReader.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.
@@ -102,6 +102,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
return this.registry;
}
+ @Override
public final BeanDefinitionRegistry getRegistry() {
return this.registry;
}
@@ -112,7 +113,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
* will be capable of resolving resource patterns to Resource arrays.
*
Default is PathMatchingResourcePatternResolver, also capable of
* resource pattern resolving through the ResourcePatternResolver interface.
- *
Setting this to null suggests that absolute resource loading
+ *
Setting this to {@code null} suggests that absolute resource loading
* is not available for this bean definition reader.
* @see org.springframework.core.io.support.ResourcePatternResolver
* @see org.springframework.core.io.support.PathMatchingResourcePatternResolver
@@ -121,21 +122,23 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
this.resourceLoader = resourceLoader;
}
+ @Override
public ResourceLoader getResourceLoader() {
return this.resourceLoader;
}
/**
* Set the ClassLoader to use for bean classes.
- *
Default is null, which suggests to not load bean classes
+ *
Default is {@code null}, which suggests to not load bean classes
* eagerly but rather to just register bean definitions with class names,
* with the corresponding Classes to be resolved later (or never).
- * @see java.lang.Thread#getContextClassLoader()
+ * @see Thread#getContextClassLoader()
*/
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = beanClassLoader;
}
+ @Override
public ClassLoader getBeanClassLoader() {
return this.beanClassLoader;
}
@@ -149,6 +152,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
this.environment = environment;
}
+ @Override
public Environment getEnvironment() {
return this.environment;
}
@@ -162,11 +166,13 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
this.beanNameGenerator = (beanNameGenerator != null ? beanNameGenerator : new DefaultBeanNameGenerator());
}
+ @Override
public BeanNameGenerator getBeanNameGenerator() {
return this.beanNameGenerator;
}
+ @Override
public int loadBeanDefinitions(Resource... resources) throws BeanDefinitionStoreException {
Assert.notNull(resources, "Resource array must not be null");
int counter = 0;
@@ -176,6 +182,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
return counter;
}
+ @Override
public int loadBeanDefinitions(String location) throws BeanDefinitionStoreException {
return loadBeanDefinitions(location, null);
}
@@ -187,7 +194,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
* @param location the resource location, to be loaded with the ResourceLoader
* (or ResourcePatternResolver) of this bean definition reader
* @param actualResources a Set to be filled with the actual Resource objects
- * that have been resolved during the loading process. May be null
+ * that have been resolved during the loading process. May be {@code null}
* to indicate that the caller is not interested in those Resource objects.
* @return the number of bean definitions found
* @throws BeanDefinitionStoreException in case of loading or parsing errors
@@ -236,6 +243,7 @@ public abstract class AbstractBeanDefinitionReader implements EnvironmentCapable
}
}
+ @Override
public int loadBeanDefinitions(String... locations) throws BeanDefinitionStoreException {
Assert.notNull(locations, "Location array must not be null");
int counter = 0;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
index b5699c2fb8..1d73ee4734 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
@@ -178,7 +178,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
/**
* Create a new AbstractBeanFactory with the given parent.
- * @param parentBeanFactory parent bean factory, or null if none
+ * @param parentBeanFactory parent bean factory, or {@code null} if none
* @see #getBean
*/
public AbstractBeanFactory(BeanFactory parentBeanFactory) {
@@ -190,14 +190,17 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
// Implementation of BeanFactory interface
//---------------------------------------------------------------------
+ @Override
public Object getBean(String name) throws BeansException {
return doGetBean(name, null, null, false);
}
+ @Override
public T getBean(String name, Class requiredType) throws BeansException {
return doGetBean(name, requiredType, null, false);
}
+ @Override
public Object getBean(String name, Object... args) throws BeansException {
return doGetBean(name, null, args, false);
}
@@ -290,6 +293,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
// Create bean instance.
if (mbd.isSingleton()) {
sharedInstance = getSingleton(beanName, new ObjectFactory() {
+ @Override
public Object getObject() throws BeansException {
try {
return createBean(beanName, mbd, args);
@@ -327,6 +331,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
try {
Object scopedInstance = scope.get(beanName, new ObjectFactory() {
+ @Override
public Object getObject() throws BeansException {
beforePrototypeCreation(beanName);
try {
@@ -364,6 +369,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return (T) bean;
}
+ @Override
public boolean containsBean(String name) {
String beanName = transformedBeanName(name);
if (containsSingleton(beanName) || containsBeanDefinition(beanName)) {
@@ -374,6 +380,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return (parentBeanFactory != null && parentBeanFactory.containsBean(originalBeanName(name)));
}
+ @Override
public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
@@ -419,6 +426,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
+ @Override
public boolean isPrototype(String name) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
@@ -443,6 +451,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
final FactoryBean> factoryBean = (FactoryBean>) getBean(FACTORY_BEAN_PREFIX + beanName);
if (System.getSecurityManager() != null) {
return AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Boolean run() {
return ((factoryBean instanceof SmartFactoryBean && ((SmartFactoryBean>) factoryBean).isPrototype()) ||
!factoryBean.isSingleton());
@@ -460,6 +469,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
+ @Override
public boolean isTypeMatch(String name, Class> targetType) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
Class> typeToMatch = (targetType != null ? targetType : Object.class);
@@ -531,6 +541,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
+ @Override
public Class> getType(String name) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
@@ -621,10 +632,12 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
// Implementation of HierarchicalBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public BeanFactory getParentBeanFactory() {
return this.parentBeanFactory;
}
+ @Override
public boolean containsLocalBean(String name) {
String beanName = transformedBeanName(name);
return ((containsSingleton(beanName) || containsBeanDefinition(beanName)) &&
@@ -636,6 +649,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
// Implementation of ConfigurableBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public void setParentBeanFactory(BeanFactory parentBeanFactory) {
if (this.parentBeanFactory != null && this.parentBeanFactory != parentBeanFactory) {
throw new IllegalStateException("Already associated with parent BeanFactory: " + this.parentBeanFactory);
@@ -643,46 +657,57 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
this.parentBeanFactory = parentBeanFactory;
}
+ @Override
public void setBeanClassLoader(ClassLoader beanClassLoader) {
this.beanClassLoader = (beanClassLoader != null ? beanClassLoader : ClassUtils.getDefaultClassLoader());
}
+ @Override
public ClassLoader getBeanClassLoader() {
return this.beanClassLoader;
}
+ @Override
public void setTempClassLoader(ClassLoader tempClassLoader) {
this.tempClassLoader = tempClassLoader;
}
+ @Override
public ClassLoader getTempClassLoader() {
return this.tempClassLoader;
}
+ @Override
public void setCacheBeanMetadata(boolean cacheBeanMetadata) {
this.cacheBeanMetadata = cacheBeanMetadata;
}
+ @Override
public boolean isCacheBeanMetadata() {
return this.cacheBeanMetadata;
}
+ @Override
public void setBeanExpressionResolver(BeanExpressionResolver resolver) {
this.beanExpressionResolver = resolver;
}
+ @Override
public BeanExpressionResolver getBeanExpressionResolver() {
return this.beanExpressionResolver;
}
+ @Override
public void setConversionService(ConversionService conversionService) {
this.conversionService = conversionService;
}
+ @Override
public ConversionService getConversionService() {
return this.conversionService;
}
+ @Override
public void addPropertyEditorRegistrar(PropertyEditorRegistrar registrar) {
Assert.notNull(registrar, "PropertyEditorRegistrar must not be null");
this.propertyEditorRegistrars.add(registrar);
@@ -695,12 +720,14 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return this.propertyEditorRegistrars;
}
+ @Override
public void registerCustomEditor(Class> requiredType, Class extends PropertyEditor> propertyEditorClass) {
Assert.notNull(requiredType, "Required type must not be null");
Assert.isAssignable(PropertyEditor.class, propertyEditorClass);
this.customEditors.put(requiredType, propertyEditorClass);
}
+ @Override
public void copyRegisteredEditorsTo(PropertyEditorRegistry registry) {
registerCustomEditors(registry);
}
@@ -712,18 +739,20 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return this.customEditors;
}
+ @Override
public void setTypeConverter(TypeConverter typeConverter) {
this.typeConverter = typeConverter;
}
/**
* Return the custom TypeConverter to use, if any.
- * @return the custom TypeConverter, or null if none specified
+ * @return the custom TypeConverter, or {@code null} if none specified
*/
protected TypeConverter getCustomTypeConverter() {
return this.typeConverter;
}
+ @Override
public TypeConverter getTypeConverter() {
TypeConverter customConverter = getCustomTypeConverter();
if (customConverter != null) {
@@ -738,11 +767,13 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
+ @Override
public void addEmbeddedValueResolver(StringValueResolver valueResolver) {
Assert.notNull(valueResolver, "StringValueResolver must not be null");
this.embeddedValueResolvers.add(valueResolver);
}
+ @Override
public String resolveEmbeddedValue(String value) {
String result = value;
for (StringValueResolver resolver : this.embeddedValueResolvers) {
@@ -751,6 +782,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return result;
}
+ @Override
public void addBeanPostProcessor(BeanPostProcessor beanPostProcessor) {
Assert.notNull(beanPostProcessor, "BeanPostProcessor must not be null");
this.beanPostProcessors.remove(beanPostProcessor);
@@ -763,6 +795,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
+ @Override
public int getBeanPostProcessorCount() {
return this.beanPostProcessors.size();
}
@@ -795,6 +828,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return this.hasDestructionAwareBeanPostProcessors;
}
+ @Override
public void registerScope(String scopeName, Scope scope) {
Assert.notNull(scopeName, "Scope identifier must not be null");
Assert.notNull(scope, "Scope must not be null");
@@ -804,10 +838,12 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
this.scopes.put(scopeName, scope);
}
+ @Override
public String[] getRegisteredScopeNames() {
return StringUtils.toStringArray(this.scopes.keySet());
}
+ @Override
public Scope getRegisteredScope(String scopeName) {
Assert.notNull(scopeName, "Scope identifier must not be null");
return this.scopes.get(scopeName);
@@ -833,6 +869,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
AccessController.getContext());
}
+ @Override
public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
Assert.notNull(otherFactory, "BeanFactory must not be null");
setBeanClassLoader(otherFactory.getBeanClassLoader());
@@ -858,7 +895,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
/**
* Return a 'merged' BeanDefinition for the given bean name,
* merging a child bean definition with its parent if necessary.
- *
This getMergedBeanDefinition considers bean definition
+ *
This {@code getMergedBeanDefinition} considers bean definition
* in ancestors as well.
* @param name the name of the bean to retrieve the merged definition for
* (may be an alias)
@@ -866,6 +903,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* @throws NoSuchBeanDefinitionException if there is no bean with the given name
* @throws BeanDefinitionStoreException in case of an invalid bean definition
*/
+ @Override
public BeanDefinition getMergedBeanDefinition(String name) throws BeansException {
String beanName = transformedBeanName(name);
@@ -877,6 +915,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
return getMergedLocalBeanDefinition(beanName);
}
+ @Override
public boolean isFactoryBean(String name) throws NoSuchBeanDefinitionException {
String beanName = transformedBeanName(name);
@@ -959,6 +998,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
+ @Override
public void destroyBean(String beanName, Object beanInstance) {
destroyBean(beanName, beanInstance, getMergedLocalBeanDefinition(beanName));
}
@@ -974,6 +1014,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
new DisposableBeanAdapter(beanInstance, beanName, mbd, getBeanPostProcessors(), getAccessControlContext()).destroy();
}
+ @Override
public void destroyScopedBean(String beanName) {
RootBeanDefinition mbd = getMergedLocalBeanDefinition(beanName);
if (mbd.isSingleton() || mbd.isPrototype()) {
@@ -1116,7 +1157,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* @param beanName the name of the bean definition
* @param bd the original bean definition (Root/ChildBeanDefinition)
* @param containingBd the containing bean definition in case of inner bean,
- * or null in case of a top-level bean
+ * or {@code null} in case of a top-level bean
* @return a (potentially merged) RootBeanDefinition for the given bean
* @throws BeanDefinitionStoreException in case of an invalid bean definition
*/
@@ -1234,8 +1275,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* @param mbd the merged bean definition to determine the class for
* @param beanName the name of the bean (for error handling purposes)
* @param typesToMatch the types to match in case of internal type matching purposes
- * (also signals that the returned Class will never be exposed to application code)
- * @return the resolved bean class (or null if none)
+ * (also signals that the returned {@code Class} will never be exposed to application code)
+ * @return the resolved bean class (or {@code null} if none)
* @throws CannotLoadBeanClassException if we failed to load the class
*/
protected Class> resolveBeanClass(final RootBeanDefinition mbd, String beanName, final Class>... typesToMatch)
@@ -1246,6 +1287,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
if (System.getSecurityManager() != null) {
return AccessController.doPrivileged(new PrivilegedExceptionAction>() {
+ @Override
public Class> run() throws Exception {
return doResolveBeanClass(mbd, typesToMatch);
}
@@ -1313,8 +1355,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* @param beanName the name of the bean
* @param mbd the merged bean definition to determine the type for
* @param typesToMatch the types to match in case of internal type matching purposes
- * (also signals that the returned Class will never be exposed to application code)
- * @return the type of the bean, or null if not predictable
+ * (also signals that the returned {@code Class} will never be exposed to application code)
+ * @return the type of the bean, or {@code null} if not predictable
*/
protected Class> predictBeanType(String beanName, RootBeanDefinition mbd, Class>... typesToMatch) {
if (mbd.getFactoryMethodName() != null) {
@@ -1337,15 +1379,15 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
/**
* Determine the bean type for the given FactoryBean definition, as far as possible.
* Only called if there is no singleton instance registered for the target bean already.
- *
The default implementation creates the FactoryBean via getBean
- * to call its getObjectType method. Subclasses are encouraged to optimize
+ *
The default implementation creates the FactoryBean via {@code getBean}
+ * to call its {@code getObjectType} method. Subclasses are encouraged to optimize
* this, typically by just instantiating the FactoryBean but not populating it yet,
- * trying whether its getObjectType method already returns a type.
+ * trying whether its {@code getObjectType} method already returns a type.
* If no type found, a full FactoryBean creation as performed by this implementation
* should be used as fallback.
* @param beanName the name of the bean
* @param mbd the merged bean definition for the bean
- * @return the type for the bean if determinable, or null else
+ * @return the type for the bean if determinable, or {@code null} else
* @see org.springframework.beans.factory.FactoryBean#getObjectType()
* @see #getBean(String)
*/
@@ -1381,7 +1423,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* Determine whether the specified bean is eligible for having
* its bean definition metadata cached.
* @param beanName the name of the bean
- * @return true if the bean's metadata may be cached
+ * @return {@code true} if the bean's metadata may be cached
* at this point already
*/
protected boolean isBeanEligibleForMetadataCaching(String beanName) {
@@ -1392,7 +1434,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* Remove the singleton instance (if any) for the given bean name,
* but only if it hasn't been used for other purposes than type checking.
* @param beanName the name of the bean
- * @return true if actually removed, false otherwise
+ * @return {@code true} if actually removed, {@code false} otherwise
*/
protected boolean removeSingletonIfCreatedForTypeCheckOnly(String beanName) {
if (!this.alreadyCreated.containsKey(beanName)) {
@@ -1512,7 +1554,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
/**
* Check if this bean factory contains a bean definition with the given name.
* Does not consider any hierarchy this factory may participate in.
- * Invoked by containsBean when no cached singleton instance is found.
+ * Invoked by {@code containsBean} when no cached singleton instance is found.
*
Depending on the nature of the concrete bean factory implementation,
* this operation might be expensive (for example, because of directory lookups
* in external registries). However, for listable bean factories, this usually
@@ -1537,7 +1579,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* public interface there. The same implementation can serve for both this
* template method and the public interface method in that case.
* @param beanName the name of the bean to find a definition for
- * @return the BeanDefinition for this prototype name (never null)
+ * @return the BeanDefinition for this prototype name (never {@code null})
* @throws org.springframework.beans.factory.NoSuchBeanDefinitionException
* if the bean definition cannot be resolved
* @throws BeansException in case of errors
@@ -1557,7 +1599,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
* @param beanName the name of the bean
* @param mbd the merged bean definition for the bean
* @param args arguments to use if creating a prototype using explicit arguments to a
- * static factory method. This parameter must be null except in this case.
+ * static factory method. This parameter must be {@code null} except in this case.
* @return a new instance of the bean
* @throws BeanCreationException if the bean could not be created
*/
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java
index 58c560c917..6846390e1b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateQualifier.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,6 +29,7 @@ import org.springframework.util.Assert;
* @since 2.5
* @see org.springframework.beans.factory.annotation.Qualifier
*/
+@SuppressWarnings("serial")
public class AutowireCandidateQualifier extends BeanMetadataAttributeAccessor {
public static String VALUE_KEY = "value";
@@ -59,7 +60,7 @@ public class AutowireCandidateQualifier extends BeanMetadataAttributeAccessor {
/**
* Construct a qualifier to match against an annotation of the
- * given type whose value attribute also matches
+ * given type whose {@code value} attribute also matches
* the specified value.
* @param type the annotation type
* @param value the annotation value to match
@@ -70,7 +71,7 @@ public class AutowireCandidateQualifier extends BeanMetadataAttributeAccessor {
/**
* Construct a qualifier to match against an annotation of the
- * given type name whose value attribute also matches
+ * given type name whose {@code value} attribute also matches
* the specified value.
*
The type name may match the fully-qualified class name of
* the annotation or the short class name (without the package).
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateResolver.java
index 0f30540e67..cd2c41e115 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireCandidateResolver.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 interface AutowireCandidateResolver {
* Determine whether a default value is suggested for the given dependency.
* @param descriptor the descriptor for the target method parameter or field
* @return the value suggested (typically an expression String),
- * or null if none found
+ * or {@code null} if none found
* @since 3.0
*/
Object getSuggestedValue(DependencyDescriptor descriptor);
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java
index cb1bce28ee..140e11569c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AutowireUtils.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.
@@ -51,6 +51,7 @@ abstract class AutowireUtils {
*/
public static void sortConstructors(Constructor[] constructors) {
Arrays.sort(constructors, new Comparator() {
+ @Override
public int compare(Constructor c1, Constructor c2) {
boolean p1 = Modifier.isPublic(c1.getModifiers());
boolean p2 = Modifier.isPublic(c2.getModifiers());
@@ -73,6 +74,7 @@ abstract class AutowireUtils {
*/
public static void sortFactoryMethods(Method[] factoryMethods) {
Arrays.sort(factoryMethods, new Comparator() {
+ @Override
public int compare(Method fm1, Method fm2) {
boolean p1 = Modifier.isPublic(fm1.getModifiers());
boolean p2 = Modifier.isPublic(fm2.getModifiers());
@@ -153,6 +155,7 @@ abstract class AutowireUtils {
/**
* Reflective InvocationHandler for lazy access to the current target object.
*/
+ @SuppressWarnings("serial")
private static class ObjectFactoryDelegatingInvocationHandler implements InvocationHandler, Serializable {
private final ObjectFactory objectFactory;
@@ -161,6 +164,7 @@ abstract class AutowireUtils {
this.objectFactory = objectFactory;
}
+ @Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
String methodName = method.getName();
if (methodName.equals("equals")) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
index 3b338d5b27..6a2cb27e49 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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 @@ import org.springframework.util.ObjectUtils;
public class BeanDefinitionBuilder {
/**
- * Create a new BeanDefinitionBuilder used to construct a {@link GenericBeanDefinition}.
+ * Create a new {@code BeanDefinitionBuilder} used to construct a {@link GenericBeanDefinition}.
*/
public static BeanDefinitionBuilder genericBeanDefinition() {
BeanDefinitionBuilder builder = new BeanDefinitionBuilder();
@@ -42,8 +42,8 @@ public class BeanDefinitionBuilder {
}
/**
- * Create a new BeanDefinitionBuilder used to construct a {@link GenericBeanDefinition}.
- * @param beanClass the Class of the bean that the definition is being created for
+ * Create a new {@code BeanDefinitionBuilder} used to construct a {@link GenericBeanDefinition}.
+ * @param beanClass the {@code Class} of the bean that the definition is being created for
*/
public static BeanDefinitionBuilder genericBeanDefinition(Class beanClass) {
BeanDefinitionBuilder builder = new BeanDefinitionBuilder();
@@ -53,7 +53,7 @@ public class BeanDefinitionBuilder {
}
/**
- * Create a new BeanDefinitionBuilder used to construct a {@link GenericBeanDefinition}.
+ * Create a new {@code BeanDefinitionBuilder} used to construct a {@link GenericBeanDefinition}.
* @param beanClassName the class name for the bean that the definition is being created for
*/
public static BeanDefinitionBuilder genericBeanDefinition(String beanClassName) {
@@ -64,16 +64,16 @@ public class BeanDefinitionBuilder {
}
/**
- * Create a new BeanDefinitionBuilder used to construct a {@link RootBeanDefinition}.
- * @param beanClass the Class of the bean that the definition is being created for
+ * Create a new {@code BeanDefinitionBuilder} used to construct a {@link RootBeanDefinition}.
+ * @param beanClass the {@code Class} of the bean that the definition is being created for
*/
public static BeanDefinitionBuilder rootBeanDefinition(Class beanClass) {
return rootBeanDefinition(beanClass, null);
}
/**
- * Create a new BeanDefinitionBuilder used to construct a {@link RootBeanDefinition}.
- * @param beanClass the Class of the bean that the definition is being created for
+ * Create a new {@code BeanDefinitionBuilder} used to construct a {@link RootBeanDefinition}.
+ * @param beanClass the {@code Class} of the bean that the definition is being created for
* @param factoryMethodName the name of the method to use to construct the bean instance
*/
public static BeanDefinitionBuilder rootBeanDefinition(Class beanClass, String factoryMethodName) {
@@ -85,7 +85,7 @@ public class BeanDefinitionBuilder {
}
/**
- * Create a new BeanDefinitionBuilder used to construct a {@link RootBeanDefinition}.
+ * Create a new {@code BeanDefinitionBuilder} used to construct a {@link RootBeanDefinition}.
* @param beanClassName the class name for the bean that the definition is being created for
*/
public static BeanDefinitionBuilder rootBeanDefinition(String beanClassName) {
@@ -93,7 +93,7 @@ public class BeanDefinitionBuilder {
}
/**
- * Create a new BeanDefinitionBuilder used to construct a {@link RootBeanDefinition}.
+ * Create a new {@code BeanDefinitionBuilder} used to construct a {@link RootBeanDefinition}.
* @param beanClassName the class name for the bean that the definition is being created for
* @param factoryMethodName the name of the method to use to construct the bean instance
*/
@@ -106,7 +106,7 @@ public class BeanDefinitionBuilder {
}
/**
- * Create a new BeanDefinitionBuilder used to construct a {@link ChildBeanDefinition}.
+ * Create a new {@code BeanDefinitionBuilder} used to construct a {@link ChildBeanDefinition}.
* @param parentName the name of the parent bean
*/
public static BeanDefinitionBuilder childBeanDefinition(String parentName) {
@@ -117,7 +117,7 @@ public class BeanDefinitionBuilder {
/**
- * The BeanDefinition instance we are creating.
+ * The {@code BeanDefinition} instance we are creating.
*/
private AbstractBeanDefinition beanDefinition;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.java
index 382cc32069..db7ccda800 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionDefaults.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.
@@ -19,8 +19,8 @@ package org.springframework.beans.factory.support;
import org.springframework.util.StringUtils;
/**
- * A simple holder for BeanDefinition property defaults.
- *
+ * A simple holder for {@code BeanDefinition} property defaults.
+ *
* @author Mark Fisher
* @since 2.5
*/
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java
index e9ff9c9abe..f5d1e77781 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReader.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.
@@ -46,27 +46,27 @@ public interface BeanDefinitionReader {
BeanDefinitionRegistry getRegistry();
/**
- * Return the resource loader to use for resource locations.
- * Can be checked for the ResourcePatternResolver interface and cast
- * accordingly, for loading multiple resources for a given resource pattern.
- *
Null suggests that absolute resource loading is not available
- * for this bean definition reader.
- *
This is mainly meant to be used for importing further resources
- * from within a bean definition resource, for example via the "import"
- * tag in XML bean definitions. It is recommended, however, to apply
- * such imports relative to the defining resource; only explicit full
- * resource locations will trigger absolute resource loading.
- *
There is also a loadBeanDefinitions(String) method available,
- * for loading bean definitions from a resource location (or location pattern).
- * This is a convenience to avoid explicit ResourceLoader handling.
- * @see #loadBeanDefinitions(String)
- * @see org.springframework.core.io.support.ResourcePatternResolver
- */
+ * Return the resource loader to use for resource locations.
+ * Can be checked for the ResourcePatternResolver interface and cast
+ * accordingly, for loading multiple resources for a given resource pattern.
+ *
Null suggests that absolute resource loading is not available
+ * for this bean definition reader.
+ *
This is mainly meant to be used for importing further resources
+ * from within a bean definition resource, for example via the "import"
+ * tag in XML bean definitions. It is recommended, however, to apply
+ * such imports relative to the defining resource; only explicit full
+ * resource locations will trigger absolute resource loading.
+ *
There is also a {@code loadBeanDefinitions(String)} method available,
+ * for loading bean definitions from a resource location (or location pattern).
+ * This is a convenience to avoid explicit ResourceLoader handling.
+ * @see #loadBeanDefinitions(String)
+ * @see org.springframework.core.io.support.ResourcePatternResolver
+ */
ResourceLoader getResourceLoader();
/**
* Return the class loader to use for bean classes.
- *
null suggests to not load bean classes eagerly
+ *
{@code null} suggests to not load bean classes eagerly
* but rather to just register bean definitions with class names,
* with the corresponding Classes to be resolved later (or never).
*/
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java
index 1d80a290cf..aa9bbe94e8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionReaderUtils.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.
@@ -49,7 +49,7 @@ public class BeanDefinitionReaderUtils {
* @param parentName the name of the parent bean, if any
* @param className the name of the bean class, if any
* @param classLoader the ClassLoader to use for loading bean classes
- * (can be null to just register bean classes by name)
+ * (can be {@code null} to just register bean classes by name)
* @return the bean definition
* @throws ClassNotFoundException if the bean class could not be loaded
*/
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java
index 23191913de..326e1fb58c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionRegistry.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.
@@ -71,7 +71,7 @@ public interface BeanDefinitionRegistry extends AliasRegistry {
/**
* Return the BeanDefinition for the given bean name.
* @param beanName name of the bean to find a definition for
- * @return the BeanDefinition for the given name (never null)
+ * @return the BeanDefinition for the given name (never {@code null})
* @throws NoSuchBeanDefinitionException if there is no such bean definition
*/
BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java
index e5fb9c6afb..7de75a1be6 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionResource.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.
@@ -64,11 +64,13 @@ class BeanDefinitionResource extends AbstractResource {
return false;
}
+ @Override
public InputStream getInputStream() throws IOException {
throw new FileNotFoundException(
"Resource cannot be opened because it points to " + getDescription());
}
+ @Override
public String getDescription() {
return "BeanDefinition defined in " + this.beanDefinition.getResourceDescription();
}
@@ -80,7 +82,7 @@ class BeanDefinitionResource extends AbstractResource {
@Override
public boolean equals(Object obj) {
return (obj == this ||
- (obj instanceof BeanDefinitionResource &&
+ (obj instanceof BeanDefinitionResource &&
((BeanDefinitionResource) obj).beanDefinition.equals(this.beanDefinition)));
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValidationException.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValidationException.java
index 79d0d1e005..04e96a7578 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValidationException.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValidationException.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.
@@ -25,6 +25,7 @@ import org.springframework.beans.FatalBeanException;
* @since 21.11.2003
* @see AbstractBeanDefinition#validate()
*/
+@SuppressWarnings("serial")
public class BeanDefinitionValidationException extends FatalBeanException {
/**
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java
index d794b3a4ef..4ee6d218fa 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/BeanDefinitionValueResolver.java
@@ -94,7 +94,7 @@ class BeanDefinitionValueResolver {
* Collections that will need to be resolved.
*
A ManagedMap. In this case the value may be a RuntimeBeanReference
* or Collection that will need to be resolved.
- *
An ordinary object or null, in which case it's left alone.
+ *
- *
+ *
* @author Rod Johnson
* @author Juergen Hoeller
* @author Rob Harrop
@@ -88,42 +88,42 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
public static final String SEPARATOR = ".";
/**
- * Special key to distinguish owner.(class)=com.myapp.MyClass-
+ * Special key to distinguish {@code owner.(class)=com.myapp.MyClass}-
*/
public static final String CLASS_KEY = "(class)";
/**
- * Special key to distinguish owner.(parent)=parentBeanName.
+ * Special key to distinguish {@code owner.(parent)=parentBeanName}.
*/
public static final String PARENT_KEY = "(parent)";
/**
- * Special key to distinguish owner.(scope)=prototype.
+ * Special key to distinguish {@code owner.(scope)=prototype}.
* Default is "true".
*/
public static final String SCOPE_KEY = "(scope)";
/**
- * Special key to distinguish owner.(singleton)=false.
+ * Special key to distinguish {@code owner.(singleton)=false}.
* Default is "true".
*/
public static final String SINGLETON_KEY = "(singleton)";
/**
- * Special key to distinguish owner.(abstract)=true
+ * Special key to distinguish {@code owner.(abstract)=true}
* Default is "false".
*/
public static final String ABSTRACT_KEY = "(abstract)";
/**
- * Special key to distinguish owner.(lazy-init)=true
+ * Special key to distinguish {@code owner.(lazy-init)=true}
* Default is "false".
*/
public static final String LAZY_INIT_KEY = "(lazy-init)";
/**
* Property suffix for references to other beans in the current
- * BeanFactory: e.g. owner.dog(ref)=fido.
+ * BeanFactory: e.g. {@code owner.dog(ref)=fido}.
* Whether this is a reference to a singleton or a prototype
* will depend on the definition of the target bean.
*/
@@ -204,6 +204,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
* @throws BeanDefinitionStoreException in case of loading or parsing errors
* @see #loadBeanDefinitions(org.springframework.core.io.Resource, String)
*/
+ @Override
public int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreException {
return loadBeanDefinitions(new EncodedResource(resource), null);
}
@@ -212,7 +213,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
* Load bean definitions from the specified properties file.
* @param resource the resource descriptor for the properties file
* @param prefix a filter within the keys in the map: e.g. 'beans.'
- * (can be empty or null)
+ * (can be empty or {@code null})
* @return the number of bean definitions found
* @throws BeanDefinitionStoreException in case of loading or parsing errors
*/
@@ -236,7 +237,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
* @param encodedResource the resource descriptor for the properties file,
* allowing to specify an encoding to use for parsing the file
* @param prefix a filter within the keys in the map: e.g. 'beans.'
- * (can be empty or null)
+ * (can be empty or {@code null})
* @return the number of bean definitions found
* @throws BeanDefinitionStoreException in case of loading or parsing errors
*/
@@ -282,7 +283,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
* standard Java internationalization support.
* @param rb the ResourceBundle to load from
* @param prefix a filter within the keys in the map: e.g. 'beans.'
- * (can be empty or null)
+ * (can be empty or {@code null})
* @return the number of bean definitions found
* @throws BeanDefinitionStoreException in case of loading or parsing errors
*/
@@ -319,7 +320,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
* will be strings if coming from a Properties file etc. Property names
* (keys) must be Strings. Class keys must be Strings.
* @param prefix a filter within the keys in the map: e.g. 'beans.'
- * (can be empty or null)
+ * (can be empty or {@code null})
* @return the number of bean definitions found
* @throws BeansException in case of loading or parsing errors
*/
@@ -334,7 +335,7 @@ public class PropertiesBeanDefinitionReader extends AbstractBeanDefinitionReader
* will be strings if coming from a Properties file etc. Property names
* (keys) must be strings. Class keys must be Strings.
* @param prefix a filter within the keys in the map: e.g. 'beans.'
- * (can be empty or null)
+ * (can be empty or {@code null})
* @param resourceDescription description of the resource that the
* Map came from (for logging purposes)
* @return the number of bean definitions found
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java
index 3faa967b2b..e570a24c57 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/ReplaceOverride.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.
@@ -76,12 +76,12 @@ public class ReplaceOverride extends MethodOverride {
// It can't match.
return false;
}
-
+
if (!isOverloaded()) {
// No overloaded: don't worry about arg type matching.
return true;
}
-
+
// If we get to here, we need to insist on precise argument matching.
if (this.typeIdentifiers.size() != method.getParameterTypes().length) {
return false;
@@ -93,7 +93,7 @@ public class ReplaceOverride extends MethodOverride {
return false;
}
}
- return true;
+ return true;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java
index aaa6597275..d400b01cac 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/RootBeanDefinition.java
@@ -45,6 +45,7 @@ import org.springframework.util.Assert;
* @see GenericBeanDefinition
* @see ChildBeanDefinition
*/
+@SuppressWarnings("serial")
public class RootBeanDefinition extends AbstractBeanDefinition {
// using a ConcurrentHashMap as a Set
@@ -240,10 +241,12 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
}
+ @Override
public String getParentName() {
return null;
}
+ @Override
public void setParentName(String parentName) {
if (parentName != null) {
throw new IllegalArgumentException("Root bean cannot be changed into a child bean with parent reference");
@@ -268,7 +271,7 @@ public class RootBeanDefinition extends AbstractBeanDefinition {
/**
* Return the resolved factory method as a Java Method object, if available.
- * @return the factory method, or null if not found or not resolved yet
+ * @return the factory method, or {@code null} if not found or not resolved yet
*/
public Method getResolvedFactoryMethod() {
synchronized (this.constructorArgumentLock) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/SecurityContextProvider.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/SecurityContextProvider.java
index 0403b8900f..ac001c639e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/SecurityContextProvider.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/SecurityContextProvider.java
@@ -1,12 +1,12 @@
/*
- * 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.
* 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-beans/src/main/java/org/springframework/beans/factory/support/SimpleAutowireCandidateResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleAutowireCandidateResolver.java
index 735def6654..3570305d9d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleAutowireCandidateResolver.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleAutowireCandidateResolver.java
@@ -1,6 +1,6 @@
/*
- * 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.
@@ -37,10 +37,12 @@ public class SimpleAutowireCandidateResolver implements AutowireCandidateResolve
*
To be considered a candidate the bean's autowire-candidate
* attribute must not have been set to 'false'.
*/
+ @Override
public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) {
return bdHolder.getBeanDefinition().isAutowireCandidate();
}
+ @Override
public Object getSuggestedValue(DependencyDescriptor descriptor) {
return null;
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java
index 8a42fc233e..b792c6cda8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleBeanDefinitionRegistry.java
@@ -40,6 +40,7 @@ public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements
private final Map beanDefinitionMap = new ConcurrentHashMap(64);
+ @Override
public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition)
throws BeanDefinitionStoreException {
@@ -48,12 +49,14 @@ public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements
this.beanDefinitionMap.put(beanName, beanDefinition);
}
+ @Override
public void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException {
if (this.beanDefinitionMap.remove(beanName) == null) {
throw new NoSuchBeanDefinitionException(beanName);
}
}
+ @Override
public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException {
BeanDefinition bd = this.beanDefinitionMap.get(beanName);
if (bd == null) {
@@ -62,18 +65,22 @@ public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements
return bd;
}
+ @Override
public boolean containsBeanDefinition(String beanName) {
return this.beanDefinitionMap.containsKey(beanName);
}
+ @Override
public String[] getBeanDefinitionNames() {
return StringUtils.toStringArray(this.beanDefinitionMap.keySet());
}
+ @Override
public int getBeanDefinitionCount() {
return this.beanDefinitionMap.size();
}
+ @Override
public boolean isBeanNameInUse(String beanName) {
return isAlias(beanName) || containsBeanDefinition(beanName);
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java
index b06904221f..4dd5a1a1ca 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleInstantiationStrategy.java
@@ -55,6 +55,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
}
+ @Override
public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner) {
// Don't override the class with CGLIB if no overrides.
if (beanDefinition.getMethodOverrides().isEmpty()) {
@@ -69,6 +70,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
try {
if (System.getSecurityManager() != null) {
constructorToUse = AccessController.doPrivileged(new PrivilegedExceptionAction() {
+ @Override
public Constructor run() throws Exception {
return clazz.getDeclaredConstructor((Class[]) null);
}
@@ -105,6 +107,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
"Method Injection not supported in SimpleInstantiationStrategy");
}
+ @Override
public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner,
final Constructor> ctor, Object[] args) {
@@ -112,6 +115,7 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
if (System.getSecurityManager() != null) {
// use own privileged to change accessibility (when security is on)
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
ReflectionUtils.makeAccessible(ctor);
return null;
@@ -138,12 +142,14 @@ public class SimpleInstantiationStrategy implements InstantiationStrategy {
"Method Injection not supported in SimpleInstantiationStrategy");
}
+ @Override
public Object instantiate(RootBeanDefinition beanDefinition, String beanName, BeanFactory owner,
Object factoryBean, final Method factoryMethod, Object[] args) {
try {
if (System.getSecurityManager() != null) {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
ReflectionUtils.makeAccessible(factoryMethod);
return null;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java
index 78b62938da..15aed4c50d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleSecurityContextProvider.java
@@ -1,12 +1,12 @@
/*
- * 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.
* 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.
@@ -21,7 +21,7 @@ import java.security.AccessController;
/**
* Simple {@link SecurityContextProvider} implementation.
- *
+ *
* @author Costin Leau
* @since 3.0
*/
@@ -31,7 +31,7 @@ public class SimpleSecurityContextProvider implements SecurityContextProvider {
/**
- * Construct a new SimpleSecurityContextProvider instance.
+ * Construct a new {@code SimpleSecurityContextProvider} instance.
*
The security context will be retrieved on each call from the current
* thread.
*/
@@ -40,10 +40,10 @@ public class SimpleSecurityContextProvider implements SecurityContextProvider {
}
/**
- * Construct a new SimpleSecurityContextProvider instance.
+ * Construct a new {@code SimpleSecurityContextProvider} instance.
*
If the given control context is null, the security context will be
* retrieved on each call from the current thread.
- * @param acc access control context (can be null)
+ * @param acc access control context (can be {@code null})
* @see AccessController#getContext()
*/
public SimpleSecurityContextProvider(AccessControlContext acc) {
@@ -51,6 +51,7 @@ public class SimpleSecurityContextProvider implements SecurityContextProvider {
}
+ @Override
public AccessControlContext getAccessControlContext() {
return (this.acc != null ? acc : AccessController.getContext());
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
index 3e8784b181..dc84919149 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.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.
@@ -75,6 +75,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
// Implementation of BeanFactory interface
//---------------------------------------------------------------------
+ @Override
public Object getBean(String name) throws BeansException {
String beanName = BeanFactoryUtils.transformedBeanName(name);
Object bean = this.beans.get(beanName);
@@ -103,6 +104,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
}
}
+ @Override
@SuppressWarnings("unchecked")
public T getBean(String name, Class requiredType) throws BeansException {
Object bean = getBean(name);
@@ -112,6 +114,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
return (T) bean;
}
+ @Override
public T getBean(Class requiredType) throws BeansException {
String[] beanNames = getBeanNamesForType(requiredType);
if (beanNames.length == 1) {
@@ -122,6 +125,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
}
}
+ @Override
public Object getBean(String name, Object... args) throws BeansException {
if (args != null) {
throw new UnsupportedOperationException(
@@ -130,16 +134,19 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
return getBean(name);
}
+ @Override
public boolean containsBean(String name) {
return this.beans.containsKey(name);
}
+ @Override
public boolean isSingleton(String name) throws NoSuchBeanDefinitionException {
Object bean = getBean(name);
// In case of FactoryBean, return singleton status of created object.
return (bean instanceof FactoryBean && ((FactoryBean) bean).isSingleton());
}
+ @Override
public boolean isPrototype(String name) throws NoSuchBeanDefinitionException {
Object bean = getBean(name);
// In case of FactoryBean, return prototype status of created object.
@@ -147,11 +154,13 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
(bean instanceof FactoryBean && !((FactoryBean) bean).isSingleton()));
}
+ @Override
public boolean isTypeMatch(String name, Class targetType) throws NoSuchBeanDefinitionException {
Class type = getType(name);
return (targetType == null || (type != null && targetType.isAssignableFrom(type)));
}
+ @Override
public Class> getType(String name) throws NoSuchBeanDefinitionException {
String beanName = BeanFactoryUtils.transformedBeanName(name);
@@ -168,6 +177,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
return bean.getClass();
}
+ @Override
public String[] getAliases(String name) {
return new String[0];
}
@@ -177,22 +187,27 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
// Implementation of ListableBeanFactory interface
//---------------------------------------------------------------------
+ @Override
public boolean containsBeanDefinition(String name) {
return this.beans.containsKey(name);
}
+ @Override
public int getBeanDefinitionCount() {
return this.beans.size();
}
+ @Override
public String[] getBeanDefinitionNames() {
return StringUtils.toStringArray(this.beans.keySet());
}
+ @Override
public String[] getBeanNamesForType(Class type) {
return getBeanNamesForType(type, true, true);
}
+ @Override
public String[] getBeanNamesForType(Class type, boolean includeNonSingletons, boolean includeFactoryBeans) {
boolean isFactoryType = (type != null && FactoryBean.class.isAssignableFrom(type));
List matches = new ArrayList();
@@ -215,10 +230,12 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
return StringUtils.toStringArray(matches);
}
+ @Override
public Map getBeansOfType(Class type) throws BeansException {
return getBeansOfType(type, true, true);
}
+ @Override
@SuppressWarnings("unchecked")
public Map getBeansOfType(Class type, boolean includeNonSingletons, boolean includeFactoryBeans)
throws BeansException {
@@ -255,6 +272,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
return matches;
}
+ @Override
public Map getBeansWithAnnotation(Class extends Annotation> annotationType)
throws BeansException {
@@ -267,6 +285,7 @@ public class StaticListableBeanFactory implements ListableBeanFactory {
return results;
}
+ @Override
public A findAnnotationOnBean(String beanName, Class annotationType) {
return AnnotationUtils.findAnnotation(getType(beanName), annotationType);
}
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/package-info.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/package-info.java
index 71a483e483..89971b330a 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/package-info.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/package-info.java
@@ -1,9 +1,8 @@
-
/**
*
- * Classes supporting the org.springframework.beans.factory package.
- * Contains abstract base classes for BeanFactory implementations.
- *
+ * Classes supporting the {@code org.springframework.beans.factory} package.
+ * Contains abstract base classes for {@code BeanFactory} implementations.
+ *
*
*/
package org.springframework.beans.factory.support;
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java b/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java
index 6bc42d0137..3be2b8b2fb 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/wiring/BeanConfigurerSupport.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.
@@ -36,7 +36,7 @@ import org.springframework.util.ClassUtils;
*
The classes in this package are discussed in Chapter 11 of
* Expert One-On-One J2EE Design and Development
* by Rod Johnson (Wrox, 2002).
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.java
index bf20a7544c..aee26b0ded 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharacterEditor.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.
@@ -21,22 +21,22 @@ import java.beans.PropertyEditorSupport;
import org.springframework.util.StringUtils;
/**
- * Editor for a {@link java.lang.Character}, to populate a property
- * of type Character or char from a String value.
+ * Editor for a {@link Character}, to populate a property
+ * of type {@code Character} or {@code char} from a String value.
*
*
Note that the JDK does not contain a default
- * {@link java.beans.PropertyEditor property editor} for char!
+ * {@link java.beans.PropertyEditor property editor} for {@code char}!
* {@link org.springframework.beans.BeanWrapperImpl} will register this
* editor by default.
- *
+ *
*
Also supports conversion from a Unicode character sequence; e.g.
- * u0041 ('A').
+ * {@code u0041} ('A').
*
* @author Juergen Hoeller
* @author Rob Harrop
* @author Rick Evans
* @since 1.2
- * @see java.lang.Character
+ * @see Character
* @see org.springframework.beans.BeanWrapperImpl
*/
public class CharacterEditor extends PropertyEditorSupport {
@@ -58,9 +58,9 @@ public class CharacterEditor extends PropertyEditorSupport {
/**
* Create a new CharacterEditor instance.
*
The "allowEmpty" parameter controls whether an empty String is
- * to be allowed in parsing, i.e. be interpreted as the null
+ * to be allowed in parsing, i.e. be interpreted as the {@code null}
* value when {@link #setAsText(String) text is being converted}. If
- * false, an {@link IllegalArgumentException} will be thrown
+ * {@code false}, an {@link IllegalArgumentException} will be thrown
* at that time.
* @param allowEmpty if empty strings are to be allowed
*/
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharsetEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharsetEditor.java
index 5d742a9253..e45a34149e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharsetEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CharsetEditor.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.
@@ -22,11 +22,11 @@ import java.nio.charset.Charset;
import org.springframework.util.StringUtils;
/**
- * Editor for java.nio.charset.Charset, translating charset
+ * Editor for {@code java.nio.charset.Charset}, translating charset
* String representations into Charset objects and back.
*
*
Expects the same syntax as Charset's {@link java.nio.charset.Charset#name()},
- * e.g. UTF-8, ISO-8859-16, etc.
+ * e.g. {@code UTF-8}, {@code ISO-8859-16}, etc.
*
* @author Arjen Poutsma
* @since 2.5.4
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.java
index 4db48197f8..68ab64d576 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassArrayEditor.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.
@@ -23,9 +23,9 @@ import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
/**
- * Property editor for an array of {@link java.lang.Class Classes}, to enable
- * the direct population of a Class[] property without having to
- * use a String class name property as bridge.
+ * Property editor for an array of {@link Class Classes}, to enable
+ * the direct population of a {@code Class[]} property without having to
+ * use a {@code String} class name property as bridge.
*
*
Also supports "java.lang.String[]"-style array class names, in contrast
* to the standard {@link Class#forName(String)} method.
@@ -40,18 +40,18 @@ public class ClassArrayEditor extends PropertyEditorSupport {
/**
- * Create a default ClassEditor, using the thread
- * context ClassLoader.
+ * Create a default {@code ClassEditor}, using the thread
+ * context {@code ClassLoader}.
*/
public ClassArrayEditor() {
this(null);
}
/**
- * Create a default ClassArrayEditor, using the given
- * ClassLoader.
- * @param classLoader the ClassLoader to use
- * (or pass null for the thread context ClassLoader)
+ * Create a default {@code ClassArrayEditor}, using the given
+ * {@code ClassLoader}.
+ * @param classLoader the {@code ClassLoader} to use
+ * (or pass {@code null} for the thread context {@code ClassLoader})
*/
public ClassArrayEditor(ClassLoader classLoader) {
this.classLoader = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader());
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.java
index 4f5fffce46..a6214171a5 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ClassEditor.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.
@@ -22,8 +22,8 @@ import org.springframework.util.ClassUtils;
import org.springframework.util.StringUtils;
/**
- * Property editor for {@link java.lang.Class java.lang.Class}, to enable the direct
- * population of a Class property without recourse to having to use a
+ * Property editor for {@link Class java.lang.Class}, to enable the direct
+ * population of a {@code Class} property without recourse to having to use a
* String class name property as bridge.
*
*
Also supports "java.lang.String[]"-style array class names, in contrast to the
@@ -32,7 +32,7 @@ import org.springframework.util.StringUtils;
* @author Juergen Hoeller
* @author Rick Evans
* @since 13.05.2003
- * @see java.lang.Class#forName
+ * @see Class#forName
* @see org.springframework.util.ClassUtils#forName(String, ClassLoader)
*/
public class ClassEditor extends PropertyEditorSupport {
@@ -50,7 +50,7 @@ public class ClassEditor extends PropertyEditorSupport {
/**
* Create a default ClassEditor, using the given ClassLoader.
* @param classLoader the ClassLoader to use
- * (or null for the thread context ClassLoader)
+ * (or {@code null} for the thread context ClassLoader)
*/
public ClassEditor(ClassLoader classLoader) {
this.classLoader = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader());
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CurrencyEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CurrencyEditor.java
index 910016ac86..5d5eea0de1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CurrencyEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CurrencyEditor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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 java.beans.PropertyEditorSupport;
import java.util.Currency;
/**
- * Editor for java.util.Currency, translating currency codes into Currency
+ * Editor for {@code java.util.Currency}, translating currency codes into Currency
* objects. Exposes the currency code as text representation of a Currency object.
*
* @author Juergen Hoeller
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.java
index b75520e06a..985ba1723c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomBooleanEditor.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,8 +29,8 @@ import org.springframework.util.StringUtils;
* them in the UI form.
*
*
In web MVC code, this editor will typically be registered with
- * binder.registerCustomEditor calls in an implementation
- * of BaseCommandController's initBinder method.
+ * {@code binder.registerCustomEditor} calls in an implementation
+ * of BaseCommandController's {@code initBinder} method.
*
* @author Juergen Hoeller
* @since 10.06.2003
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java
index a355ffcb7a..cbf10da7a4 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomCollectionEditor.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.
@@ -49,7 +49,7 @@ public class CustomCollectionEditor extends PropertyEditorSupport {
/**
* Create a new CustomCollectionEditor for the given target type,
- * keeping an incoming null as-is.
+ * keeping an incoming {@code null} as-is.
* @param collectionType the target type, which needs to be a
* sub-interface of Collection or a concrete Collection class
* @see java.util.Collection
@@ -72,7 +72,7 @@ public class CustomCollectionEditor extends PropertyEditorSupport {
* TreeSet for SortedSet, and LinkedHashSet for Set.
* @param collectionType the target type, which needs to be a
* sub-interface of Collection or a concrete Collection class
- * @param nullAsEmptyCollection whether to convert an incoming null
+ * @param nullAsEmptyCollection whether to convert an incoming {@code null}
* value to an empty Collection (of the appropriate type)
* @see java.util.Collection
* @see java.util.ArrayList
@@ -198,7 +198,7 @@ public class CustomCollectionEditor extends PropertyEditorSupport {
/**
- * This implementation returns null to indicate that
+ * This implementation returns {@code null} to indicate that
* there is no appropriate text representation.
*/
@Override
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java
index 5f4acc9151..36718b20e9 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomDateEditor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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,8 +24,8 @@ import java.util.Date;
import org.springframework.util.StringUtils;
/**
- * Property editor for java.util.Date,
- * supporting a custom java.text.DateFormat.
+ * Property editor for {@code java.util.Date},
+ * supporting a custom {@code java.text.DateFormat}.
*
*
This is not meant to be used as system PropertyEditor but rather
* as locale-specific date editor within custom controller code,
@@ -33,8 +33,8 @@ import org.springframework.util.StringUtils;
* and rendering them in the UI form.
*
*
In web MVC code, this editor will typically be registered with
- * binder.registerCustomEditor calls in a custom
- * initBinder method.
+ * {@code binder.registerCustomEditor} calls in a custom
+ * {@code initBinder} method.
*
* @author Juergen Hoeller
* @since 28.04.2003
@@ -76,7 +76,7 @@ public class CustomDateEditor extends PropertyEditorSupport {
*
The "exactDateLength" parameter states that IllegalArgumentException gets
* thrown if the String does not exactly match the length specified. This is useful
* because SimpleDateFormat does not enforce strict parsing of the year part,
- * not even with setLenient(false). Without an "exactDateLength"
+ * not even with {@code setLenient(false)}. Without an "exactDateLength"
* specified, the "01/01/05" would get parsed to "01/01/0005". However, even
* with an "exactDateLength" specified, prepended zeros in the day or month
* part may still allow for a shorter year part, so consider this as just
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java
index d66eca4f17..14871687de 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomMapEditor.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.
@@ -40,7 +40,7 @@ public class CustomMapEditor extends PropertyEditorSupport {
/**
* Create a new CustomMapEditor for the given target type,
- * keeping an incoming null as-is.
+ * keeping an incoming {@code null} as-is.
* @param mapType the target type, which needs to be a
* sub-interface of Map or a concrete Map class
* @see java.util.Map
@@ -63,7 +63,7 @@ public class CustomMapEditor extends PropertyEditorSupport {
* and LinkedHashMap for Map.
* @param mapType the target type, which needs to be a
* sub-interface of Map or a concrete Map class
- * @param nullAsEmptyMap ap whether to convert an incoming null
+ * @param nullAsEmptyMap ap whether to convert an incoming {@code null}
* value to an empty Map (of the appropriate type)
* @see java.util.Map
* @see java.util.TreeMap
@@ -189,7 +189,7 @@ public class CustomMapEditor extends PropertyEditorSupport {
/**
- * This implementation returns null to indicate that
+ * This implementation returns {@code null} to indicate that
* there is no appropriate text representation.
*/
@Override
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java
index b1d960bbfc..c946c621fb 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/CustomNumberEditor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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,7 +26,7 @@ import org.springframework.util.StringUtils;
* Property editor for any Number subclass such as Short, Integer, Long,
* BigInteger, Float, Double, BigDecimal. Can use a given NumberFormat for
* (locale-specific) parsing and rendering, or alternatively the default
- * decode / valueOf / toString methods.
+ * {@code decode} / {@code valueOf} / {@code toString} methods.
*
*
This is not meant to be used as system PropertyEditor but rather
* as locale-specific number editor within custom controller code,
@@ -34,12 +34,12 @@ import org.springframework.util.StringUtils;
* and rendering them in the UI form.
*
*
In web MVC code, this editor will typically be registered with
- * binder.registerCustomEditor calls in a custom
- * initBinder method.
+ * {@code binder.registerCustomEditor} calls in a custom
+ * {@code initBinder} method.
*
* @author Juergen Hoeller
* @since 06.06.2003
- * @see java.lang.Number
+ * @see Number
* @see java.text.NumberFormat
* @see org.springframework.validation.DataBinder#registerCustomEditor
* @see org.springframework.web.servlet.mvc.BaseCommandController#initBinder
@@ -55,10 +55,10 @@ public class CustomNumberEditor extends PropertyEditorSupport {
/**
* Create a new CustomNumberEditor instance, using the default
- * valueOf methods for parsing and toString
+ * {@code valueOf} methods for parsing and {@code toString}
* methods for rendering.
*
The "allowEmpty" parameter states if an empty String should
- * be allowed for parsing, i.e. get interpreted as null value.
+ * be allowed for parsing, i.e. get interpreted as {@code null} value.
* Else, an IllegalArgumentException gets thrown in that case.
* @param numberClass Number subclass to generate
* @param allowEmpty if empty strings should be allowed
@@ -75,7 +75,7 @@ public class CustomNumberEditor extends PropertyEditorSupport {
* Create a new CustomNumberEditor instance, using the given NumberFormat
* for parsing and rendering.
*
The allowEmpty parameter states if an empty String should
- * be allowed for parsing, i.e. get interpreted as null value.
+ * be allowed for parsing, i.e. get interpreted as {@code null} value.
* Else, an IllegalArgumentException gets thrown in that case.
* @param numberClass Number subclass to generate
* @param numberFormat NumberFormat to use for parsing and rendering
@@ -85,8 +85,8 @@ public class CustomNumberEditor extends PropertyEditorSupport {
* @see java.text.NumberFormat#parse
* @see java.text.NumberFormat#format
*/
- public CustomNumberEditor(Class extends Number> numberClass, NumberFormat numberFormat, boolean allowEmpty)
- throws IllegalArgumentException {
+ public CustomNumberEditor(Class extends Number> numberClass,
+ NumberFormat numberFormat, boolean allowEmpty) throws IllegalArgumentException {
if (numberClass == null || !Number.class.isAssignableFrom(numberClass)) {
throw new IllegalArgumentException("Property class must be a subclass of Number");
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/FileEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/FileEditor.java
index f21053e868..a57b69eaed 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/FileEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/FileEditor.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.ResourceUtils;
import org.springframework.util.StringUtils;
/**
- * Editor for java.io.File, to directly populate a File property
+ * Editor for {@code java.io.File}, to directly populate a File property
* from a Spring resource location.
*
*
Supports Spring-style URL notation: any fully qualified standard URL
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.java
index 3701b55cc3..92f47df1f1 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputSourceEditor.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.
@@ -26,7 +26,7 @@ import org.springframework.core.io.ResourceEditor;
import org.springframework.util.Assert;
/**
- * Editor for org.xml.sax.InputSource, converting from a
+ * Editor for {@code org.xml.sax.InputSource}, converting from a
* Spring resource location String to a SAX InputSource object.
*
*
Supports Spring-style URL notation: any fully qualified standard URL
@@ -37,8 +37,8 @@ import org.springframework.util.Assert;
* @see org.xml.sax.InputSource
* @see org.springframework.core.io.ResourceEditor
* @see org.springframework.core.io.ResourceLoader
- * @see org.springframework.beans.propertyeditors.URLEditor
- * @see org.springframework.beans.propertyeditors.FileEditor
+ * @see URLEditor
+ * @see FileEditor
*/
public class InputSourceEditor extends PropertyEditorSupport {
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputStreamEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputStreamEditor.java
index 7099897730..220f381e88 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputStreamEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/InputStreamEditor.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.util.Assert;
/**
* One-way PropertyEditor which can convert from a text String to a
- * java.io.InputStream, interpreting the given String
+ * {@code java.io.InputStream}, interpreting the given String
* as Spring resource location (e.g. a URL String).
*
*
Supports Spring-style URL notation: any fully qualified standard URL
@@ -79,7 +79,7 @@ public class InputStreamEditor extends PropertyEditorSupport {
}
/**
- * This implementation returns null to indicate that
+ * This implementation returns {@code null} to indicate that
* there is no appropriate text representation.
*/
@Override
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/LocaleEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/LocaleEditor.java
index 49df579168..25af77b5dd 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/LocaleEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/LocaleEditor.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.
@@ -21,9 +21,9 @@ import java.beans.PropertyEditorSupport;
import org.springframework.util.StringUtils;
/**
- * Editor for java.util.Locale, to directly populate a Locale property.
+ * Editor for {@code java.util.Locale}, to directly populate a Locale property.
*
- *
Expects the same syntax as Locale's toString, i.e. language +
+ *
Expects the same syntax as Locale's {@code toString}, i.e. language +
* optionally country + optionally variant, separated by "_" (e.g. "en", "en_US").
* Also accepts spaces as separators, as alternative to underscores.
*
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PatternEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PatternEditor.java
index 41f9952b5c..0c4c971fea 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PatternEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PatternEditor.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.
@@ -20,8 +20,8 @@ import java.beans.PropertyEditorSupport;
import java.util.regex.Pattern;
/**
- * Editor for java.util.regex.Pattern, to directly populate a Pattern property.
- * Expects the same syntax as Pattern's compile method.
+ * Editor for {@code java.util.regex.Pattern}, to directly populate a Pattern property.
+ * Expects the same syntax as Pattern's {@code compile} method.
*
* @author Juergen Hoeller
* @since 2.0.1
@@ -42,7 +42,7 @@ public class PatternEditor extends PropertyEditorSupport {
/**
* Create a new PatternEditor with the given settings.
- * @param flags the java.util.regex.Pattern flags to apply
+ * @param flags the {@code java.util.regex.Pattern} flags to apply
* @see java.util.regex.Pattern#compile(String, int)
* @see java.util.regex.Pattern#CASE_INSENSITIVE
* @see java.util.regex.Pattern#MULTILINE
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.java
index 7f5f291b70..977c2b0a6c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/PropertiesEditor.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.
@@ -25,11 +25,11 @@ import java.util.Properties;
/**
* Custom {@link java.beans.PropertyEditor} for {@link Properties} objects.
*
- *
Handles conversion from content {@link String} to Properties object.
- * Also handles {@link Map} to Properties conversion, for populating
- * a Properties object via XML "map" entries.
+ *
Handles conversion from content {@link String} to {@code Properties} object.
+ * Also handles {@link Map} to {@code Properties} conversion, for populating
+ * a {@code Properties} object via XML "map" entries.
*
- *
The required format is defined in the standard Properties
+ *
The required format is defined in the standard {@code Properties}
* documentation. Each property must be on a new line.
*
* @author Rod Johnson
@@ -61,7 +61,7 @@ public class PropertiesEditor extends PropertyEditorSupport {
}
/**
- * Take {@link Properties} as-is; convert {@link Map} into Properties.
+ * Take {@link Properties} as-is; convert {@link Map} into {@code Properties}.
*/
@Override
public void setValue(Object value) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.java
index 4f0f404d82..24467400fa 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/ResourceBundleEditor.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.
@@ -26,13 +26,13 @@ import java.util.ResourceBundle;
/**
* {@link java.beans.PropertyEditor} implementation for
* {@link java.util.ResourceBundle ResourceBundles}.
- *
+ *
*
Only supports conversion from a String, but not
* to a String.
- *
- * Find below some examples of using this class in a
+ *
+ * Find below some examples of using this class in a
* (properly configured) Spring container using XML-based metadata:
- *
+ *
*
<bean id="errorDialog" class="...">
* <!--
* the 'messages' property is of type java.util.ResourceBundle.
@@ -40,18 +40,18 @@ import java.util.ResourceBundle;
* -->
* <property name="messages" value="DialogMessages"/>
* </bean>
- *
+ *
*
<bean id="errorDialog" class="...">
* <!--
* the 'DialogMessages.properties' file exists in the 'com/messages' package
* -->
* <property name="messages" value="com/messages/DialogMessages"/>
* </bean>
- *
+ *
*
A 'properly configured' Spring {@link org.springframework.context.ApplicationContext container}
* might contain a {@link org.springframework.beans.factory.config.CustomEditorConfigurer}
* definition such that the conversion can be effected transparently:
- *
+ *
*
Please note that this {@link java.beans.PropertyEditor} is
* not registered by default with any of the Spring infrastructure.
- *
+ *
*
Thanks to David Leal Valmana for the suggestion and initial prototype.
*
* @author Rick Evans
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java
index c715f61e4c..c8875b388b 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringArrayPropertyEditor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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.
@@ -46,7 +46,7 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport {
private final String charsToDelete;
private final boolean emptyArrayAsNull;
-
+
private final boolean trimValues;
@@ -71,8 +71,8 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport {
/**
* Create a new StringArrayPropertyEditor with the given separator.
* @param separator the separator to use for splitting a {@link String}
- * @param emptyArrayAsNull true if an empty String array
- * is to be transformed into null
+ * @param emptyArrayAsNull {@code true} if an empty String array
+ * is to be transformed into {@code null}
*/
public StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull) {
this(separator, null, emptyArrayAsNull);
@@ -81,9 +81,9 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport {
/**
* Create a new StringArrayPropertyEditor with the given separator.
* @param separator the separator to use for splitting a {@link String}
- * @param emptyArrayAsNull true if an empty String array
- * is to be transformed into null
- * @param trimValues true if the values in the parsed arrays
+ * @param emptyArrayAsNull {@code true} if an empty String array
+ * is to be transformed into {@code null}
+ * @param trimValues {@code true} if the values in the parsed arrays
* are to be be trimmed of whitespace (default is true).
*/
public StringArrayPropertyEditor(String separator, boolean emptyArrayAsNull, boolean trimValues) {
@@ -96,8 +96,8 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport {
* @param charsToDelete a set of characters to delete, in addition to
* trimming an input String. Useful for deleting unwanted line breaks:
* e.g. "\r\n\f" will delete all new lines and line feeds in a String.
- * @param emptyArrayAsNull true if an empty String array
- * is to be transformed into null
+ * @param emptyArrayAsNull {@code true} if an empty String array
+ * is to be transformed into {@code null}
*/
public StringArrayPropertyEditor(String separator, String charsToDelete, boolean emptyArrayAsNull) {
this(separator, charsToDelete, emptyArrayAsNull, true);
@@ -109,9 +109,9 @@ public class StringArrayPropertyEditor extends PropertyEditorSupport {
* @param charsToDelete a set of characters to delete, in addition to
* trimming an input String. Useful for deleting unwanted line breaks:
* e.g. "\r\n\f" will delete all new lines and line feeds in a String.
- * @param emptyArrayAsNull true if an empty String array
- * is to be transformed into null
- * @param trimValues true if the values in the parsed arrays
+ * @param emptyArrayAsNull {@code true} if an empty String array
+ * is to be transformed into {@code null}
+ * @param trimValues {@code true} if the values in the parsed arrays
* are to be be trimmed of whitespace (default is true).
*/
public StringArrayPropertyEditor(String separator, String charsToDelete, boolean emptyArrayAsNull, boolean trimValues) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java
index c277c44f74..da9c1eea94 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/StringTrimmerEditor.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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,7 +23,7 @@ import org.springframework.util.StringUtils;
/**
* Property editor that trims Strings.
*
- *
Optionally allows transforming an empty string into a null value.
+ *
Optionally allows transforming an empty string into a {@code null} value.
* Needs to be explicitly registered, e.g. for command binding.
*
* @author Juergen Hoeller
@@ -39,8 +39,8 @@ public class StringTrimmerEditor extends PropertyEditorSupport {
/**
* Create a new StringTrimmerEditor.
- * @param emptyAsNull true if an empty String is to be
- * transformed into null
+ * @param emptyAsNull {@code true} if an empty String is to be
+ * transformed into {@code null}
*/
public StringTrimmerEditor(boolean emptyAsNull) {
this.charsToDelete = null;
@@ -52,8 +52,8 @@ public class StringTrimmerEditor extends PropertyEditorSupport {
* @param charsToDelete a set of characters to delete, in addition to
* trimming an input String. Useful for deleting unwanted line breaks:
* e.g. "\r\n\f" will delete all new lines and line feeds in a String.
- * @param emptyAsNull true if an empty String is to be
- * transformed into null
+ * @param emptyAsNull {@code true} if an empty String is to be
+ * transformed into {@code null}
*/
public StringTrimmerEditor(String charsToDelete, boolean emptyAsNull) {
this.charsToDelete = charsToDelete;
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/TimeZoneEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/TimeZoneEditor.java
index 832488ffaf..632f60127c 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/TimeZoneEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/TimeZoneEditor.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.
@@ -20,7 +20,7 @@ import java.beans.PropertyEditorSupport;
import java.util.TimeZone;
/**
- * Editor for java.util.TimeZone, translating timezone IDs into
+ * Editor for {@code java.util.TimeZone}, translating timezone IDs into
* TimeZone objects. Does not expose a text representation for TimeZone objects.
*
* @author Juergen Hoeller
@@ -35,7 +35,7 @@ public class TimeZoneEditor extends PropertyEditorSupport {
}
/**
- * This implementation returns null to indicate that
+ * This implementation returns {@code null} to indicate that
* there is no appropriate text representation.
*/
@Override
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java
index add95f10c3..f5ac6d6a48 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URIEditor.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.
@@ -27,7 +27,7 @@ import org.springframework.util.ResourceUtils;
import org.springframework.util.StringUtils;
/**
- * Editor for java.net.URI, to directly populate a URI property
+ * Editor for {@code java.net.URI}, to directly populate a URI property
* instead of using a String property as bridge.
*
*
Supports Spring-style URI notation: any fully qualified standard URI
@@ -79,7 +79,7 @@ public class URIEditor extends PropertyEditorSupport {
* Create a new URIEditor, using the given ClassLoader to resolve
* "classpath:" locations into physical resource URLs.
* @param classLoader the ClassLoader to use for resolving "classpath:" locations
- * (may be null to indicate the default ClassLoader)
+ * (may be {@code null} to indicate the default ClassLoader)
*/
public URIEditor(ClassLoader classLoader) {
this.classLoader = (classLoader != null ? classLoader : ClassUtils.getDefaultClassLoader());
@@ -90,7 +90,7 @@ public class URIEditor extends PropertyEditorSupport {
* Create a new URIEditor, using the given ClassLoader to resolve
* "classpath:" locations into physical resource URLs.
* @param classLoader the ClassLoader to use for resolving "classpath:" locations
- * (may be null to indicate the default ClassLoader)
+ * (may be {@code null} to indicate the default ClassLoader)
* @param encode indicates whether Strings will be encoded or not
*/
public URIEditor(ClassLoader classLoader, boolean encode) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URLEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URLEditor.java
index bffeffc1ef..c5f9755d85 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URLEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/URLEditor.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,7 +25,7 @@ import org.springframework.core.io.ResourceEditor;
import org.springframework.util.Assert;
/**
- * Editor for java.net.URL, to directly populate a URL property
+ * Editor for {@code java.net.URL}, to directly populate a URL property
* instead of using a String property as bridge.
*
*
Supports Spring-style URL notation: any fully qualified standard URL
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/UUIDEditor.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/UUIDEditor.java
index 98c9ea54f5..3662903df8 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/UUIDEditor.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/UUIDEditor.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.
@@ -22,7 +22,7 @@ import java.util.UUID;
import org.springframework.util.StringUtils;
/**
- * Editor for java.util.UUID, translating UUID
+ * Editor for {@code java.util.UUID}, translating UUID
* String representations into UUID objects and back.
*
* @author Juergen Hoeller
diff --git a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/package-info.java b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/package-info.java
index 40aa76e11e..376e3c6d3f 100644
--- a/spring-beans/src/main/java/org/springframework/beans/propertyeditors/package-info.java
+++ b/spring-beans/src/main/java/org/springframework/beans/propertyeditors/package-info.java
@@ -3,7 +3,7 @@
*
* Properties editors used to convert from String values to object
* types such as java.util.Properties.
- *
+ *
*
Some of these editors are registered automatically by BeanWrapperImpl.
* "CustomXxxEditor" classes are intended for manual registration in
* specific binding processes, as they are localized or the like.
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java b/spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java
index 36c185f919..a9ed9984aa 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/ArgumentConvertingMethodInvoker.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.
@@ -125,7 +125,7 @@ public class ArgumentConvertingMethodInvoker extends MethodInvoker {
* Actually find a method with matching parameter type, i.e. where each
* argument value is assignable to the corresponding parameter type.
* @param arguments the argument values to match against method parameters
- * @return a matching method, or null if none
+ * @return a matching method, or {@code null} if none
*/
protected Method doFindMatchingMethod(Object[] arguments) {
TypeConverter converter = getTypeConverter();
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java b/spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java
index e227dd59af..4f59e4d30e 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/MutableSortDefinition.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,6 +29,7 @@ import org.springframework.util.StringUtils;
* @since 26.05.2003
* @see #setToggleAscendingOnProperty
*/
+@SuppressWarnings("serial")
public class MutableSortDefinition implements SortDefinition, Serializable {
private String property = "";
@@ -76,7 +77,7 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
/**
* Create a new MutableSortDefinition.
* @param toggleAscendingOnSameProperty whether to toggle the ascending flag
- * if the same property gets set again (that is, setProperty gets
+ * if the same property gets set again (that is, {@code setProperty} gets
* called with already set property name again).
*/
public MutableSortDefinition(boolean toggleAscendingOnSameProperty) {
@@ -103,6 +104,7 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
}
}
+ @Override
public String getProperty() {
return this.property;
}
@@ -114,6 +116,7 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
this.ignoreCase = ignoreCase;
}
+ @Override
public boolean isIgnoreCase() {
return this.ignoreCase;
}
@@ -125,6 +128,7 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
this.ascending = ascending;
}
+ @Override
public boolean isAscending() {
return this.ascending;
}
@@ -159,7 +163,8 @@ public class MutableSortDefinition implements SortDefinition, Serializable {
}
SortDefinition otherSd = (SortDefinition) other;
return (getProperty().equals(otherSd.getProperty()) &&
- isAscending() == otherSd.isAscending() && isIgnoreCase() == otherSd.isIgnoreCase());
+ isAscending() == otherSd.isAscending() &&
+ isIgnoreCase() == otherSd.isIgnoreCase());
}
@Override
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java b/spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java
index 2ed2c98955..4d7ff96013 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/PagedListHolder.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.
@@ -47,6 +47,7 @@ import org.springframework.util.Assert;
* @see #getPageList()
* @see org.springframework.beans.support.MutableSortDefinition
*/
+@SuppressWarnings("serial")
public class PagedListHolder implements Serializable {
public static final int DEFAULT_PAGE_SIZE = 10;
@@ -288,9 +289,9 @@ public class PagedListHolder implements Serializable {
/**
- * Resort the list if necessary, i.e. if the current sort instance
- * isn't equal to the backed-up sortUsed instance.
- *
Calls doSort to trigger actual sorting.
+ * Resort the list if necessary, i.e. if the current {@code sort} instance
+ * isn't equal to the backed-up {@code sortUsed} instance.
+ *
Calls {@code doSort} to trigger actual sorting.
* @see #doSort
*/
public void resort() {
@@ -309,7 +310,7 @@ public class PagedListHolder implements Serializable {
* Can be overridden in subclasses, in particular in case of custom
* extensions to the SortDefinition interface. Is allowed to return
* null, which means that no sort state will be held, triggering
- * actual sorting for each resort call.
+ * actual sorting for each {@code resort} call.
* @param sort the current SortDefinition object
* @return a deep copy of the SortDefinition object
* @see MutableSortDefinition#MutableSortDefinition(SortDefinition)
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java b/spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java
index d9f9a95bbb..bbea12861a 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/PropertyComparator.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.
@@ -72,6 +72,7 @@ public class PropertyComparator implements Comparator {
}
+ @Override
public int compare(Object o1, Object o2) {
Object v1 = getPropertyValue(o1);
Object v2 = getPropertyValue(o2);
@@ -81,7 +82,7 @@ public class PropertyComparator implements Comparator {
}
int result;
-
+
// Put an object with null property at the end of the sort result.
try {
if (v1 != null) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/ResourceEditorRegistrar.java b/spring-beans/src/main/java/org/springframework/beans/support/ResourceEditorRegistrar.java
index bcf6c8931c..2db246e47d 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/ResourceEditorRegistrar.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/ResourceEditorRegistrar.java
@@ -91,7 +91,7 @@ public class ResourceEditorRegistrar implements PropertyEditorRegistrar {
/**
- * Populate the given registry with the following resource editors:
+ * Populate the given {@code registry} with the following resource editors:
* ResourceEditor, InputStreamEditor, InputSourceEditor, FileEditor, URLEditor,
* URIEditor, ClassEditor, ClassArrayEditor.
*
If this registrar has been configured with a {@link ResourcePatternResolver},
@@ -106,6 +106,7 @@ public class ResourceEditorRegistrar implements PropertyEditorRegistrar {
* @see org.springframework.beans.propertyeditors.ClassArrayEditor
* @see org.springframework.core.io.support.ResourceArrayPropertyEditor
*/
+ @Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
ResourceEditor baseEditor = new ResourceEditor(this.resourceLoader, this.propertyResolver);
doRegisterEditor(registry, Resource.class, baseEditor);
diff --git a/spring-beans/src/main/java/org/springframework/beans/support/SortDefinition.java b/spring-beans/src/main/java/org/springframework/beans/support/SortDefinition.java
index 869701bc59..406e3b6faa 100644
--- a/spring-beans/src/main/java/org/springframework/beans/support/SortDefinition.java
+++ b/spring-beans/src/main/java/org/springframework/beans/support/SortDefinition.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-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java b/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java
index 3483077e85..94dd439bfb 100644
--- a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java
+++ b/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParser.java
@@ -13,6 +13,7 @@ import org.w3c.dom.Element;
public class ComponentBeanDefinitionParser extends AbstractBeanDefinitionParser {
+ @Override
protected AbstractBeanDefinition parseInternal(Element element,
ParserContext parserContext) {
return parseComponentElement(element);
diff --git a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java b/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java
index aec54454ec..b3e62ba2b8 100644
--- a/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java
+++ b/spring-beans/src/test/java/com/foo/ComponentBeanDefinitionParserTest.java
@@ -1,12 +1,12 @@
/*
- * Copyright 2006-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.
* 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-beans/src/test/java/com/foo/ComponentFactoryBean.java b/spring-beans/src/test/java/com/foo/ComponentFactoryBean.java
index e62eab786e..ac47c4efea 100644
--- a/spring-beans/src/test/java/com/foo/ComponentFactoryBean.java
+++ b/spring-beans/src/test/java/com/foo/ComponentFactoryBean.java
@@ -16,6 +16,7 @@ public class ComponentFactoryBean implements FactoryBean {
this.children = children;
}
+ @Override
public Component getObject() throws Exception {
if (this.children != null && this.children.size() > 0) {
for (Component child : children) {
@@ -25,10 +26,12 @@ public class ComponentFactoryBean implements FactoryBean {
return this.parent;
}
+ @Override
public Class getObjectType() {
return Component.class;
}
+ @Override
public boolean isSingleton() {
return true;
}
diff --git a/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java b/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java
index 3ccc7f167b..b29eeca061 100644
--- a/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java
+++ b/spring-beans/src/test/java/com/foo/ComponentNamespaceHandler.java
@@ -3,6 +3,7 @@ package com.foo;
import org.springframework.beans.factory.xml.NamespaceHandlerSupport;
public class ComponentNamespaceHandler extends NamespaceHandlerSupport {
+ @Override
public void init() {
registerBeanDefinitionParser("component",
new ComponentBeanDefinitionParser());
diff --git a/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java b/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java
index f85c45233d..51ea30bb54 100644
--- a/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/AbstractPropertyValuesTests.java
@@ -1,12 +1,12 @@
/*
- * 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.
* 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.
@@ -25,7 +25,7 @@ import java.util.Map;
* @author Rod Johnson
* @author Chris Beams
*/
-public abstract class AbstractPropertyValuesTests {
+public abstract class AbstractPropertyValuesTests {
/**
* Must contain: forname=Tony surname=Blair age=50
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java
index a8abdd95f2..f49f63182c 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.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,7 +36,7 @@ import test.beans.TestBean;
/**
* Unit tests for {@link BeanUtils}.
- *
+ *
* @author Juergen Hoeller
* @author Rob Harrop
* @author Chris Beams
@@ -250,17 +250,17 @@ public final class BeanUtilsTests {
}
@Test
- public void testSPR6063() {
- PropertyDescriptor[] descrs = BeanUtils.getPropertyDescriptors(Bean.class);
+ public void testSPR6063() {
+ PropertyDescriptor[] descrs = BeanUtils.getPropertyDescriptors(Bean.class);
- PropertyDescriptor keyDescr = BeanUtils.getPropertyDescriptor(Bean.class, "value");
- assertEquals(String.class, keyDescr.getPropertyType());
- for (PropertyDescriptor propertyDescriptor : descrs) {
- if (propertyDescriptor.getName().equals(keyDescr.getName())) {
- assertEquals(propertyDescriptor.getName() + " has unexpected type", keyDescr.getPropertyType(), propertyDescriptor.getPropertyType());
- }
- }
- }
+ PropertyDescriptor keyDescr = BeanUtils.getPropertyDescriptor(Bean.class, "value");
+ assertEquals(String.class, keyDescr.getPropertyType());
+ for (PropertyDescriptor propertyDescriptor : descrs) {
+ if (propertyDescriptor.getName().equals(keyDescr.getName())) {
+ assertEquals(propertyDescriptor.getName() + " has unexpected type", keyDescr.getPropertyType(), propertyDescriptor.getPropertyType());
+ }
+ }
+ }
private void assertSignatureEquals(Method desiredMethod, String signature) {
assertEquals(desiredMethod, BeanUtils.resolveSignature(signature, MethodSignatureBean.class));
@@ -360,18 +360,22 @@ public final class BeanUtilsTests {
private String value;
+ @Override
public String getKey() {
return key;
}
+ @Override
public void setKey(String aKey) {
key = aKey;
}
+ @Override
public String getValue() {
return value;
}
+ @Override
public void setValue(String aValue) {
value = aValue;
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java
index 469b22cdaf..73bdeaee1c 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperAutoGrowingTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2011 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.
@@ -71,12 +71,12 @@ public class BeanWrapperAutoGrowingTests {
@Test
public void getPropertyValueAutoGrowArrayBySeveralElements() {
assertNotNull(wrapper.getPropertyValue("array[4]"));
- assertEquals(5, bean.getArray().length);
- assertTrue(bean.getArray()[0] instanceof Bean);
- assertTrue(bean.getArray()[1] instanceof Bean);
- assertTrue(bean.getArray()[2] instanceof Bean);
- assertTrue(bean.getArray()[3] instanceof Bean);
- assertTrue(bean.getArray()[4] instanceof Bean);
+ assertEquals(5, bean.getArray().length);
+ assertTrue(bean.getArray()[0] instanceof Bean);
+ assertTrue(bean.getArray()[1] instanceof Bean);
+ assertTrue(bean.getArray()[2] instanceof Bean);
+ assertTrue(bean.getArray()[3] instanceof Bean);
+ assertTrue(bean.getArray()[4] instanceof Bean);
assertNotNull(wrapper.getPropertyValue("array[0]"));
assertNotNull(wrapper.getPropertyValue("array[1]"));
assertNotNull(wrapper.getPropertyValue("array[2]"));
@@ -94,7 +94,7 @@ public class BeanWrapperAutoGrowingTests {
public void getPropertyValueAutoGrowList() {
assertNotNull(wrapper.getPropertyValue("list[0]"));
assertEquals(1, bean.getList().size());
- assertTrue(bean.getList().get(0) instanceof Bean);
+ assertTrue(bean.getList().get(0) instanceof Bean);
}
@Test
@@ -107,11 +107,11 @@ public class BeanWrapperAutoGrowingTests {
public void getPropertyValueAutoGrowListBySeveralElements() {
assertNotNull(wrapper.getPropertyValue("list[4]"));
assertEquals(5, bean.getList().size());
- assertTrue(bean.getList().get(0) instanceof Bean);
- assertTrue(bean.getList().get(1) instanceof Bean);
- assertTrue(bean.getList().get(2) instanceof Bean);
- assertTrue(bean.getList().get(3) instanceof Bean);
- assertTrue(bean.getList().get(4) instanceof Bean);
+ assertTrue(bean.getList().get(0) instanceof Bean);
+ assertTrue(bean.getList().get(1) instanceof Bean);
+ assertTrue(bean.getList().get(2) instanceof Bean);
+ assertTrue(bean.getList().get(3) instanceof Bean);
+ assertTrue(bean.getList().get(4) instanceof Bean);
assertNotNull(wrapper.getPropertyValue("list[0]"));
assertNotNull(wrapper.getPropertyValue("list[1]"));
assertNotNull(wrapper.getPropertyValue("list[2]"));
@@ -167,9 +167,9 @@ public class BeanWrapperAutoGrowingTests {
private Bean[] array;
private Bean[][] multiArray;
-
+
private List list;
-
+
private List> multiList;
private List listNotParameterized;
@@ -215,7 +215,7 @@ public class BeanWrapperAutoGrowingTests {
public void setList(List list) {
this.list = list;
}
-
+
public List> getMultiList() {
return multiList;
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java
index c1f3b5e3ac..a1752458c4 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.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.
@@ -507,6 +507,7 @@ public class BeanWrapperGenericsTests {
private Map>> mapOfListOfListOfInteger;
+ @Override
public Map getMapOfInteger() {
return mapOfInteger;
}
@@ -515,10 +516,12 @@ public class BeanWrapperGenericsTests {
this.mapOfInteger = mapOfInteger;
}
+ @Override
public Map> getMapOfListOfInteger() {
return mapOfListOfInteger;
}
+ @Override
public void setMapOfListOfInteger(Map> mapOfListOfInteger) {
this.mapOfListOfInteger = mapOfListOfInteger;
}
@@ -591,6 +594,7 @@ public class BeanWrapperGenericsTests {
private double version;
+ @Override
public Double getVersion() {
return this.version;
}
@@ -613,10 +617,12 @@ public class BeanWrapperGenericsTests {
private Long id;
+ @Override
public Long getId() {
return id;
}
+ @Override
public void setId(Long aId) {
this.id = aId;
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
index b584e4a51e..7da9710417 100644
--- a/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
@@ -49,6 +49,8 @@ import org.springframework.beans.propertyeditors.CustomNumberEditor;
import org.springframework.beans.propertyeditors.StringArrayPropertyEditor;
import org.springframework.beans.propertyeditors.StringTrimmerEditor;
import org.springframework.beans.support.DerivedFromProtectedBaseBean;
+import org.springframework.build.junit.Assume;
+import org.springframework.build.junit.TestGroup;
import org.springframework.core.convert.ConversionFailedException;
import org.springframework.core.convert.TypeDescriptor;
import org.springframework.core.convert.support.DefaultConversionService;
@@ -329,6 +331,7 @@ public final class BeanWrapperTests {
TestBean tb = new TestBean();
BeanWrapper bw = new BeanWrapperImpl(tb);
bw.registerCustomEditor(String.class, new PropertyEditorSupport() {
+ @Override
public void setValue(Object value) {
super.setValue(value.toString());
}
@@ -500,6 +503,7 @@ public final class BeanWrapperTests {
PropsTester pt = new PropsTester();
BeanWrapper bw = new BeanWrapperImpl(pt);
bw.registerCustomEditor(String.class, "stringArray", new PropertyEditorSupport() {
+ @Override
public void setAsText(String text) {
setValue(text.substring(1));
}
@@ -559,6 +563,7 @@ public final class BeanWrapperTests {
TestBean tb = new TestBean();
BeanWrapper bw = new BeanWrapperImpl(tb);
bw.registerCustomEditor(String.class, "name", new PropertyEditorSupport() {
+ @Override
public void setValue(Object value) {
if (value instanceof String[]) {
setValue(StringUtils.arrayToDelimitedString(((String[]) value), "-"));
@@ -636,6 +641,7 @@ public final class BeanWrapperTests {
PropsTester pt = new PropsTester();
BeanWrapper bw = new BeanWrapperImpl(pt);
bw.registerCustomEditor(int.class, new PropertyEditorSupport() {
+ @Override
public void setAsText(String text) {
setValue(new Integer(Integer.parseInt(text) + 1));
}
@@ -995,15 +1001,15 @@ public final class BeanWrapperTests {
bw.setPropertyValues(pvs);
assertEquals(tb5, bean.getArray()[0]);
assertEquals(tb4, bean.getArray()[1]);
- assertEquals(tb3, ((TestBean) bean.getList().get(0)));
- assertEquals(tb2, ((TestBean) bean.getList().get(1)));
- assertEquals(tb0, ((TestBean) bean.getList().get(2)));
- assertEquals(null, ((TestBean) bean.getList().get(3)));
- assertEquals(tb1, ((TestBean) bean.getList().get(4)));
- assertEquals(tb1, ((TestBean) bean.getMap().get("key1")));
- assertEquals(tb0, ((TestBean) bean.getMap().get("key2")));
- assertEquals(tb4, ((TestBean) bean.getMap().get("key5")));
- assertEquals(tb5, ((TestBean) bean.getMap().get("key9")));
+ assertEquals(tb3, (bean.getList().get(0)));
+ assertEquals(tb2, (bean.getList().get(1)));
+ assertEquals(tb0, (bean.getList().get(2)));
+ assertEquals(null, (bean.getList().get(3)));
+ assertEquals(tb1, (bean.getList().get(4)));
+ assertEquals(tb1, (bean.getMap().get("key1")));
+ assertEquals(tb0, (bean.getMap().get("key2")));
+ assertEquals(tb4, (bean.getMap().get("key5")));
+ assertEquals(tb5, (bean.getMap().get("key9")));
assertEquals(tb5, bw.getPropertyValue("array[0]"));
assertEquals(tb4, bw.getPropertyValue("array[1]"));
assertEquals(tb3, bw.getPropertyValue("list[0]"));
@@ -1022,6 +1028,7 @@ public final class BeanWrapperTests {
IndexedTestBean bean = new IndexedTestBean();
BeanWrapper bw = new BeanWrapperImpl(bean);
bw.registerCustomEditor(TestBean.class, new PropertyEditorSupport() {
+ @Override
public void setAsText(String text) throws IllegalArgumentException {
if (!StringUtils.hasLength(text)) {
throw new IllegalArgumentException();
@@ -1055,6 +1062,7 @@ public final class BeanWrapperTests {
IndexedTestBean bean = new IndexedTestBean();
BeanWrapper bw = new BeanWrapperImpl(bean);
bw.registerCustomEditor(TestBean.class, "map", new PropertyEditorSupport() {
+ @Override
public void setAsText(String text) throws IllegalArgumentException {
if (!StringUtils.hasLength(text)) {
throw new IllegalArgumentException();
@@ -1078,6 +1086,7 @@ public final class BeanWrapperTests {
IndexedTestBean bean = new IndexedTestBean();
BeanWrapper bw = new BeanWrapperImpl(bean);
bw.registerCustomEditor(TestBean.class, "map", new PropertyEditorSupport() {
+ @Override
public void setAsText(String text) throws IllegalArgumentException {
if (!StringUtils.hasLength(text)) {
throw new IllegalArgumentException();
@@ -1132,10 +1141,8 @@ public final class BeanWrapperTests {
@Test
public void testLargeMatchingPrimitiveArray() {
- if (LogFactory.getLog(BeanWrapperTests.class).isTraceEnabled()) {
- // Skip this test: Trace logging blows the time limit.
- return;
- }
+ Assume.group(TestGroup.PERFORMANCE);
+ Assume.notLogging(LogFactory.getLog(BeanWrapperTests.class));
PrimitiveArrayBean tb = new PrimitiveArrayBean();
BeanWrapper bw = new BeanWrapperImpl(tb);
@@ -1191,6 +1198,7 @@ public final class BeanWrapperTests {
PrimitiveArrayBean tb = new PrimitiveArrayBean();
BeanWrapper bw = new BeanWrapperImpl(tb);
bw.registerCustomEditor(int.class, "array", new PropertyEditorSupport() {
+ @Override
public void setValue(Object value) {
if (value instanceof Integer) {
super.setValue(new Integer(((Integer) value).intValue() + 1));
@@ -1209,6 +1217,7 @@ public final class BeanWrapperTests {
PrimitiveArrayBean tb = new PrimitiveArrayBean();
BeanWrapper bw = new BeanWrapperImpl(tb);
bw.registerCustomEditor(int.class, "array[1]", new PropertyEditorSupport() {
+ @Override
public void setValue(Object value) {
if (value instanceof Integer) {
super.setValue(new Integer(((Integer) value).intValue() + 1));
@@ -1821,6 +1830,7 @@ public final class BeanWrapperTests {
this.frozen = true;
}
+ @Override
public V put(K key, V value) {
if (this.frozen) {
throw new UnsupportedOperationException();
@@ -1830,16 +1840,19 @@ public final class BeanWrapperTests {
}
}
+ @Override
public Set> entrySet() {
this.accessed = true;
return super.entrySet();
}
+ @Override
public Set keySet() {
this.accessed = true;
return super.keySet();
}
+ @Override
public int size() {
this.accessed = true;
return super.size();
@@ -1851,6 +1864,7 @@ public final class BeanWrapperTests {
}
+ @SuppressWarnings("serial")
public static class TypedReadOnlyMap extends ReadOnlyMap {
public TypedReadOnlyMap() {
diff --git a/spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java b/spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java
index 4866cc101b..95c3fbb8cc 100644
--- a/spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java
@@ -1,12 +1,12 @@
/*
- * 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.
* 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.
@@ -50,7 +50,7 @@ public final class ConcurrentBeanWrapperTests {
performSet();
}
}
-
+
@Test
public void testConcurrent() {
for (int i = 0; i < 10; i++) {
@@ -115,6 +115,7 @@ public final class ConcurrentBeanWrapperTests {
this.test = test;
}
+ @Override
public void run() {
try {
for (int i = 0; i < 100; i++) {
diff --git a/spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java b/spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
index b0343230e8..788ee5c85c 100644
--- a/spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/ExtendedBeanInfoTests.java
@@ -215,6 +215,7 @@ public class ExtendedBeanInfoTests {
@Test
public void cornerSpr9453() throws IntrospectionException {
final class Bean implements Spr9453> {
+ @Override
public Class> getProp() {
return null;
}
@@ -604,7 +605,9 @@ public class ExtendedBeanInfoTests {
public Number setFoo(String foo) { return null; }
}
class C extends B {
+ @Override
public String getFoo() { return null; }
+ @Override
public Integer setFoo(String foo) { return null; }
}
@@ -876,6 +879,7 @@ public class ExtendedBeanInfoTests {
}
interface TextBookOperations extends BookOperations {
+ @Override
TextBook getBook();
}
@@ -885,6 +889,7 @@ public class ExtendedBeanInfoTests {
}
class LawLibrary extends Library implements TextBookOperations {
+ @Override
public LawBook getBook() { return null; }
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java b/spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java
index 8eeb96e36c..bc53e02ae2 100644
--- a/spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/MutablePropertyValuesTests.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,7 +36,7 @@ public final class MutablePropertyValuesTests extends AbstractPropertyValuesTest
pvs.addPropertyValue(new PropertyValue("surname", "Blair"));
pvs.addPropertyValue(new PropertyValue("age", "50"));
doTestTony(pvs);
-
+
MutablePropertyValues deepCopy = new MutablePropertyValues(pvs);
doTestTony(deepCopy);
deepCopy.setPropertyValueAt(new PropertyValue("name", "Gordon"), 0);
diff --git a/spring-beans/src/test/java/org/springframework/beans/annotation/RequiredAnnotationBeanPostProcessorTests.java b/spring-beans/src/test/java/org/springframework/beans/annotation/RequiredAnnotationBeanPostProcessorTests.java
index dd52eea7b8..7c728a55a2 100644
--- a/spring-beans/src/test/java/org/springframework/beans/annotation/RequiredAnnotationBeanPostProcessorTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/annotation/RequiredAnnotationBeanPostProcessorTests.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.
@@ -182,10 +182,12 @@ class RequiredTestBean implements BeanNameAware, BeanFactoryAware {
this.jobTitle = jobTitle;
}
+ @Override
@Required
public void setBeanName(String name) {
}
+ @Override
@Required
public void setBeanFactory(BeanFactory beanFactory) {
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java
index 4094dd3974..636fbda545 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java
@@ -45,12 +45,12 @@ import static test.util.TestResourceUtils.qualifiedResource;
* @since 04.07.2003
*/
public final class BeanFactoryUtilsTests {
-
+
private static final Class> CLASS = BeanFactoryUtilsTests.class;
- private static final Resource ROOT_CONTEXT = qualifiedResource(CLASS, "root.xml");
- private static final Resource MIDDLE_CONTEXT = qualifiedResource(CLASS, "middle.xml");
- private static final Resource LEAF_CONTEXT = qualifiedResource(CLASS, "leaf.xml");
- private static final Resource DEPENDENT_BEANS_CONTEXT = qualifiedResource(CLASS, "dependentBeans.xml");
+ private static final Resource ROOT_CONTEXT = qualifiedResource(CLASS, "root.xml");
+ private static final Resource MIDDLE_CONTEXT = qualifiedResource(CLASS, "middle.xml");
+ private static final Resource LEAF_CONTEXT = qualifiedResource(CLASS, "leaf.xml");
+ private static final Resource DEPENDENT_BEANS_CONTEXT = qualifiedResource(CLASS, "dependentBeans.xml");
private ConfigurableListableBeanFactory listableBeanFactory;
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
index 563b56fca8..967cd5d2b8 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/ConcurrentBeanFactoryTests.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.
@@ -48,7 +48,7 @@ public final class ConcurrentBeanFactoryTests {
private static final Log logger = LogFactory.getLog(ConcurrentBeanFactoryTests.class);
private static final Resource CONTEXT = qualifiedResource(ConcurrentBeanFactoryTests.class, "context.xml");
-
+
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd");
private static final Date DATE_1, DATE_2;
@@ -72,6 +72,7 @@ public final class ConcurrentBeanFactoryTests {
public void setUp() throws Exception {
XmlBeanFactory factory = new XmlBeanFactory(CONTEXT);
factory.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
+ @Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
registry.registerCustomEditor(Date.class, new CustomDateEditor((DateFormat) DATE_FORMAT.clone(), false));
}
@@ -125,6 +126,7 @@ public final class ConcurrentBeanFactoryTests {
private class TestRun extends Thread {
+ @Override
public void run() {
try {
for (int i = 0; i < 10000; i++) {
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
index 1acfc0a504..35f3420ca0 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
@@ -72,6 +72,8 @@ import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.beans.factory.xml.ConstructorDependenciesBean;
import org.springframework.beans.factory.xml.DependenciesBean;
import org.springframework.beans.propertyeditors.CustomNumberEditor;
+import org.springframework.build.junit.Assume;
+import org.springframework.build.junit.TestGroup;
import org.springframework.core.MethodParameter;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.support.DefaultConversionService;
@@ -497,7 +499,7 @@ public class DefaultListableBeanFactoryTests {
int count = (new PropertiesBeanDefinitionReader(lbf)).registerBeanDefinitions(p, PREFIX);
assertTrue("2 beans registered, not " + count, count == 2);
- TestBean kerry = (TestBean) lbf.getBean("kerry", TestBean.class);
+ TestBean kerry = lbf.getBean("kerry", TestBean.class);
assertTrue("Kerry name is Kerry", "Kerry".equals(kerry.getName()));
ITestBean spouse = kerry.getSpouse();
assertTrue("Kerry spouse is non null", spouse != null);
@@ -516,7 +518,7 @@ public class DefaultListableBeanFactoryTests {
assertTrue("1 beans registered, not " + count, count == 1);
assertEquals(1, lbf.getBeanDefinitionCount());
- TestBean tb = (TestBean) lbf.getBean("tb", TestBean.class);
+ TestBean tb = lbf.getBean("tb", TestBean.class);
assertEquals("my.value", tb.getSomeMap().get("my.key"));
}
@@ -836,6 +838,7 @@ public class DefaultListableBeanFactoryTests {
public void testCustomEditor() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
lbf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
+ @Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
registry.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, true));
@@ -853,6 +856,7 @@ public class DefaultListableBeanFactoryTests {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
GenericConversionService conversionService = new DefaultConversionService();
conversionService.addConverter(new Converter() {
+ @Override
public Float convert(String source) {
try {
NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
@@ -875,6 +879,7 @@ public class DefaultListableBeanFactoryTests {
public void testCustomEditorWithBeanReference() {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
lbf.addPropertyEditorRegistrar(new PropertyEditorRegistrar() {
+ @Override
public void registerCustomEditors(PropertyEditorRegistry registry) {
NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
registry.registerCustomEditor(Float.class, new CustomNumberEditor(Float.class, nf, true));
@@ -1310,7 +1315,7 @@ public class DefaultListableBeanFactoryTests {
* Verifies that a dependency on a {@link FactoryBean} can not
* be autowired by name, as & is an illegal character in
* Java method names. In other words, you can't name a method
- * set&FactoryBean(...).
+ * {@code set&FactoryBean(...)}.
*/
@Test(expected=TypeMismatchException.class)
public void testAutowireBeanWithFactoryBeanByName() {
@@ -1690,10 +1695,8 @@ public class DefaultListableBeanFactoryTests {
@Test
public void testPrototypeCreationIsFastEnough() {
- if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
- // Skip this test: Trace logging blows the time limit.
- return;
- }
+ Assume.group(TestGroup.PERFORMANCE);
+ Assume.notLogging(factoryLog);
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1710,10 +1713,8 @@ public class DefaultListableBeanFactoryTests {
@Test
public void testPrototypeCreationWithDependencyCheckIsFastEnough() {
- if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
- // Skip this test: Trace logging blows the time limit.
- return;
- }
+ Assume.group(TestGroup.PERFORMANCE);
+ Assume.notLogging(factoryLog);
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition rbd = new RootBeanDefinition(LifecycleBean.class);
rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1756,10 +1757,8 @@ public class DefaultListableBeanFactoryTests {
@Test
@Ignore // TODO re-enable when ConstructorResolver TODO sorted out
public void testPrototypeCreationWithConstructorArgumentsIsFastEnough() {
- if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
- // Skip this test: Trace logging blows the time limit.
- return;
- }
+ Assume.group(TestGroup.PERFORMANCE);
+ Assume.notLogging(factoryLog);
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1806,10 +1805,8 @@ public class DefaultListableBeanFactoryTests {
@Test
public void testPrototypeCreationWithResolvedConstructorArgumentsIsFastEnough() {
- if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
- // Skip this test: Trace logging blows the time limit.
- return;
- }
+ Assume.group(TestGroup.PERFORMANCE);
+ Assume.notLogging(factoryLog);
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1830,10 +1827,8 @@ public class DefaultListableBeanFactoryTests {
@Test
public void testPrototypeCreationWithPropertiesIsFastEnough() {
- if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
- // Skip this test: Trace logging blows the time limit.
- return;
- }
+ Assume.group(TestGroup.PERFORMANCE);
+ Assume.notLogging(factoryLog);
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1879,10 +1874,8 @@ public class DefaultListableBeanFactoryTests {
*/
@Test
public void testPrototypeCreationWithResolvedPropertiesIsFastEnough() {
- if (factoryLog.isTraceEnabled() || factoryLog.isDebugEnabled()) {
- // Skip this test: Trace logging blows the time limit.
- return;
- }
+ Assume.group(TestGroup.PERFORMANCE);
+ Assume.notLogging(factoryLog);
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition rbd = new RootBeanDefinition(TestBean.class);
rbd.setScope(RootBeanDefinition.SCOPE_PROTOTYPE);
@@ -1907,9 +1900,11 @@ public class DefaultListableBeanFactoryTests {
RootBeanDefinition bd = new RootBeanDefinition(BeanWithDisposableBean.class);
lbf.registerBeanDefinition("test", bd);
lbf.addBeanPostProcessor(new BeanPostProcessor() {
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
return new TestBean();
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
return bean;
}
@@ -1926,9 +1921,11 @@ public class DefaultListableBeanFactoryTests {
RootBeanDefinition bd = new RootBeanDefinition(BeanWithCloseable.class);
lbf.registerBeanDefinition("test", bd);
lbf.addBeanPostProcessor(new BeanPostProcessor() {
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
return new TestBean();
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
return bean;
}
@@ -1946,9 +1943,11 @@ public class DefaultListableBeanFactoryTests {
bd.setDestroyMethodName("close");
lbf.registerBeanDefinition("test", bd);
lbf.addBeanPostProcessor(new BeanPostProcessor() {
+ @Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
return new TestBean();
}
+ @Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
return bean;
}
@@ -2117,6 +2116,7 @@ public class DefaultListableBeanFactoryTests {
lbf.registerBeanDefinition("test", bd);
final String nameSetOnField = "nameSetOnField";
lbf.addBeanPostProcessor(new InstantiationAwareBeanPostProcessorAdapter() {
+ @Override
public boolean postProcessAfterInstantiation(Object bean, String beanName) throws BeansException {
TestBean tb = (TestBean) bean;
try {
@@ -2156,6 +2156,7 @@ public class DefaultListableBeanFactoryTests {
TestSecuredBean bean = (TestSecuredBean) Subject.doAsPrivileged(subject,
new PrivilegedAction() {
+ @Override
public Object run() {
return lbf.getBean("test");
}
@@ -2189,6 +2190,7 @@ public class DefaultListableBeanFactoryTests {
*/
@Test(timeout=1000)
public void testByTypeLookupIsFastEnough() {
+ Assume.group(TestGroup.PERFORMANCE);
DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
for (int i = 0; i < 1000; i++) {
@@ -2244,14 +2246,17 @@ public class DefaultListableBeanFactoryTests {
public ConstructorDependencyFactoryBean(String dependency) {
}
+ @Override
public Object getObject() {
return "test";
}
+ @Override
public Class> getObjectType() {
return String.class;
}
+ @Override
public boolean isSingleton() {
return true;
}
@@ -2262,6 +2267,7 @@ public class DefaultListableBeanFactoryTests {
private static boolean closed;
+ @Override
public void destroy() {
closed = true;
}
@@ -2272,6 +2278,7 @@ public class DefaultListableBeanFactoryTests {
private static boolean closed;
+ @Override
public void close() {
closed = true;
}
@@ -2316,14 +2323,17 @@ public class DefaultListableBeanFactoryTests {
public static class FactoryBeanThatShouldntBeCalled implements FactoryBean {
+ @Override
public Object getObject() {
throw new IllegalStateException();
}
+ @Override
public Class> getObjectType() {
return null;
}
+ @Override
public boolean isSingleton() {
return false;
}
@@ -2334,15 +2344,18 @@ public class DefaultListableBeanFactoryTests {
public boolean initialized = false;
+ @Override
public Object getObject() throws Exception {
this.initialized = true;
return "";
}
+ @Override
public Class> getObjectType() {
return String.class;
}
+ @Override
public boolean isSingleton() {
return true;
}
@@ -2353,23 +2366,28 @@ public class DefaultListableBeanFactoryTests {
public boolean initialized = false;
+ @Override
public Object getObject() throws Exception {
this.initialized = true;
return "";
}
+ @Override
public Class> getObjectType() {
return String.class;
}
+ @Override
public boolean isSingleton() {
return true;
}
+ @Override
public boolean isPrototype() {
return false;
}
+ @Override
public boolean isEagerInit() {
return true;
}
@@ -2452,6 +2470,7 @@ public class DefaultListableBeanFactoryTests {
this.numberFormat = numberFormat;
}
+ @Override
@SuppressWarnings("unchecked")
public Object convertIfNecessary(Object value, Class requiredType) {
if (value instanceof String && Float.class.isAssignableFrom(requiredType)) {
@@ -2470,11 +2489,13 @@ public class DefaultListableBeanFactoryTests {
}
}
+ @Override
@SuppressWarnings("unchecked")
public Object convertIfNecessary(Object value, Class requiredType, MethodParameter methodParam) {
return convertIfNecessary(value, requiredType);
}
+ @Override
@SuppressWarnings("unchecked")
public Object convertIfNecessary(Object value, Class requiredType, Field field) {
return convertIfNecessary(value, requiredType);
@@ -2490,6 +2511,7 @@ public class DefaultListableBeanFactoryTests {
this.name = name;
}
+ @Override
public String getName() {
return this.name;
}
@@ -2539,38 +2561,38 @@ public class DefaultListableBeanFactoryTests {
return this.userName;
}
}
-
+
/**
* Bean that changes state on a business invocation, so that
* we can check whether it's been invoked
* @author Rod Johnson
*/
private static class SideEffectBean {
-
+
private int count;
-
+
public void setCount(int count) {
this.count = count;
}
-
+
public int getCount() {
return this.count;
}
-
+
public void doWork() {
++count;
}
}
-
+
private static class KnowsIfInstantiated {
-
+
private static boolean instantiated;
-
+
public static void clearInstantiationRecord() {
instantiated = false;
}
-
+
public static boolean wasInstantiated() {
return instantiated;
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java
index 127b162110..3f7e69e4f4 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanLookupTests.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,31 +40,31 @@ public class FactoryBeanLookupTests {
beanFactory = new XmlBeanFactory(
new ClassPathResource("FactoryBeanLookupTests-context.xml", this.getClass()));
}
-
+
@Test
public void factoryBeanLookupByNameDereferencing() {
Object fooFactory = beanFactory.getBean("&fooFactory");
assertThat(fooFactory, instanceOf(FooFactoryBean.class));
}
-
+
@Test
public void factoryBeanLookupByType() {
FooFactoryBean fooFactory = beanFactory.getBean(FooFactoryBean.class);
assertNotNull(fooFactory);
}
-
+
@Test
public void factoryBeanLookupByTypeAndNameDereference() {
FooFactoryBean fooFactory = beanFactory.getBean("&fooFactory", FooFactoryBean.class);
assertNotNull(fooFactory);
}
-
+
@Test
public void factoryBeanObjectLookupByName() {
Object fooFactory = beanFactory.getBean("fooFactory");
assertThat(fooFactory, instanceOf(Foo.class));
}
-
+
@Test
public void factoryBeanObjectLookupByNameAndType() {
Foo foo = beanFactory.getBean("fooFactory", Foo.class);
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanTests.java
index 9d1123fe1c..0a50c2e617 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/FactoryBeanTests.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.
@@ -33,9 +33,9 @@ import org.springframework.util.Assert;
public final class FactoryBeanTests {
private static final Class> CLASS = FactoryBeanTests.class;
- private static final Resource RETURNS_NULL_CONTEXT = qualifiedResource(CLASS, "returnsNull.xml");
- private static final Resource WITH_AUTOWIRING_CONTEXT = qualifiedResource(CLASS, "withAutowiring.xml");
-
+ private static final Resource RETURNS_NULL_CONTEXT = qualifiedResource(CLASS, "returnsNull.xml");
+ private static final Resource WITH_AUTOWIRING_CONTEXT = qualifiedResource(CLASS, "withAutowiring.xml");
+
@Test
public void testFactoryBeanReturnsNull() throws Exception {
XmlBeanFactory factory = new XmlBeanFactory(RETURNS_NULL_CONTEXT);
@@ -46,10 +46,10 @@ public final class FactoryBeanTests {
@Test
public void testFactoryBeansWithAutowiring() throws Exception {
XmlBeanFactory factory = new XmlBeanFactory(WITH_AUTOWIRING_CONTEXT);
-
+
BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
ppc.postProcessBeanFactory(factory);
-
+
Alpha alpha = (Alpha) factory.getBean("alpha");
Beta beta = (Beta) factory.getBean("beta");
Gamma gamma = (Gamma) factory.getBean("gamma");
@@ -63,10 +63,10 @@ public final class FactoryBeanTests {
@Test
public void testFactoryBeansWithIntermediateFactoryBeanAutowiringFailure() throws Exception {
XmlBeanFactory factory = new XmlBeanFactory(WITH_AUTOWIRING_CONTEXT);
-
+
BeanFactoryPostProcessor ppc = (BeanFactoryPostProcessor) factory.getBean("propertyPlaceholderConfigurer");
ppc.postProcessBeanFactory(factory);
-
+
Beta beta = (Beta) factory.getBean("beta");
Alpha alpha = (Alpha) factory.getBean("alpha");
Gamma gamma = (Gamma) factory.getBean("gamma");
@@ -77,14 +77,17 @@ public final class FactoryBeanTests {
public static class NullReturningFactoryBean implements FactoryBean {
+ @Override
public Object getObject() {
return null;
}
+ @Override
public Class> getObjectType() {
return null;
}
+ @Override
public boolean isSingleton() {
return true;
}
@@ -103,6 +106,7 @@ public final class FactoryBeanTests {
return beta;
}
+ @Override
public void afterPropertiesSet() {
Assert.notNull(beta, "'beta' property is required");
}
@@ -131,6 +135,7 @@ public final class FactoryBeanTests {
return name;
}
+ @Override
public void afterPropertiesSet() {
Assert.notNull(gamma, "'gamma' property is required");
}
@@ -149,14 +154,17 @@ public final class FactoryBeanTests {
this.beta = beta;
}
+ @Override
public Object getObject() {
return this.beta;
}
+ @Override
public Class> getObjectType() {
return null;
}
+ @Override
public boolean isSingleton() {
return true;
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java
index 15dd2bcf93..c5f365f799 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/SharedBeanRegistryTests.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 @@ public final class SharedBeanRegistryTests {
assertSame(tb, beanRegistry.getSingleton("tb"));
TestBean tb2 = (TestBean) beanRegistry.getSingleton("tb2", new ObjectFactory() {
+ @Override
public Object getObject() throws BeansException {
return new TestBean();
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocatorTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocatorTests.java
index ff63ff84d5..460559b068 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocatorTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/access/SingletonBeanFactoryLocatorTests.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.
@@ -26,11 +26,11 @@ import org.springframework.util.ClassUtils;
/**
* Unit tests for {@link SingletonBeanFactoryLocator}.
- *
+ *
* @author Colin Sampaleanu
* @author Chris Beams
*/
-public final class SingletonBeanFactoryLocatorTests {
+public class SingletonBeanFactoryLocatorTests {
private static final Class> CLASS = SingletonBeanFactoryLocatorTests.class;
private static final String REF1_XML = CLASS.getSimpleName() + "-ref1.xml";
@@ -38,7 +38,7 @@ public final class SingletonBeanFactoryLocatorTests {
public void testBasicFunctionality() {
SingletonBeanFactoryLocator facLoc = new SingletonBeanFactoryLocator(
"classpath*:" + ClassUtils.addResourcePathToPackagePath(CLASS, REF1_XML));
-
+
basicFunctionalityTest(facLoc);
}
@@ -81,7 +81,7 @@ public final class SingletonBeanFactoryLocatorTests {
BeanFactoryLocator facLoc = SingletonBeanFactoryLocator.getInstance(
ClassUtils.addResourcePathToPackagePath(CLASS, REF1_XML));
getInstanceTest1(facLoc);
-
+
facLoc = SingletonBeanFactoryLocator.getInstance(
"classpath*:/" + ClassUtils.addResourcePathToPackagePath(CLASS, REF1_XML));
getInstanceTest2(facLoc);
@@ -90,7 +90,7 @@ public final class SingletonBeanFactoryLocatorTests {
facLoc = SingletonBeanFactoryLocator.getInstance(
"classpath:" + ClassUtils.addResourcePathToPackagePath(CLASS, REF1_XML));
getInstanceTest3(facLoc);
-
+
}
/**
@@ -109,12 +109,12 @@ public final class SingletonBeanFactoryLocatorTests {
fac = bfr3.getFactory();
tb = (TestBean) fac.getBean("beans1.bean1");
assertTrue(tb.getName().equals("was beans1.bean1"));
-
+
BeanFactoryReference bfr4 = facLoc.useBeanFactory("a.qualified.name.which.is.an.alias");
fac = bfr4.getFactory();
tb = (TestBean) fac.getBean("beans1.bean1");
assertTrue(tb.getName().equals("was beans1.bean1"));
-
+
bfr.release();
bfr3.release();
bfr2.release();
@@ -152,7 +152,7 @@ public final class SingletonBeanFactoryLocatorTests {
bfr4.release();
bfr3.release();
}
-
+
/**
* Worker method so subclass can use it too
*/
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
index 0e798b9e41..9df0cbc309 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/AutowiredAnnotationBeanPostProcessorTests.java
@@ -45,7 +45,7 @@ import static org.junit.Assert.*;
/**
* Unit tests for {@link AutowiredAnnotationBeanPostProcessor}.
- *
+ *
* @author Juergen Hoeller
* @author Mark Fisher
* @author Sam Brannen
@@ -989,6 +989,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
public ExtendedResourceInjectionBean() {
}
+ @Override
@Autowired @Required
public void setTestBean2(TestBean testBean2) {
super.setTestBean2(testBean2);
@@ -1068,6 +1069,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
private ITestBean testBean4;
+ @Override
@Autowired(required = false)
public void setTestBean2(TestBean testBean2) {
super.setTestBean2(testBean2);
@@ -1114,6 +1116,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
private ITestBean testBean4;
+ @Override
@Autowired(required = false)
public void setTestBean2(TestBean testBean2) {
super.setTestBean2(testBean2);
@@ -1185,6 +1188,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
throw new UnsupportedOperationException();
}
+ @Override
@Autowired
public void setTestBean2(TestBean testBean2) {
super.setTestBean2(testBean2);
@@ -1346,6 +1350,7 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
}
+ @SuppressWarnings("serial")
public static class ObjectFactoryInjectionBean implements Serializable {
@Autowired
@@ -1446,14 +1451,17 @@ public final class AutowiredAnnotationBeanPostProcessorTests {
public static class StringFactoryBean implements FactoryBean {
+ @Override
public String getObject() throws Exception {
return "";
}
+ @Override
public Class getObjectType() {
return String.class;
}
+ @Override
public boolean isSingleton() {
return true;
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurerTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurerTests.java
index 6beb38ada1..f9295e4ee6 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurerTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/CustomAutowireConfigurerTests.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,7 +30,7 @@ import org.springframework.core.io.Resource;
/**
* Unit tests for {@link CustomAutowireConfigurer}.
- *
+ *
* @author Mark Fisher
* @author Juergen Hoeller
* @author Chris Beams
@@ -69,6 +69,7 @@ public final class CustomAutowireConfigurerTests {
public static class CustomResolver implements AutowireCandidateResolver {
+ @Override
public boolean isAutowireCandidate(BeanDefinitionHolder bdHolder, DependencyDescriptor descriptor) {
if (!bdHolder.getBeanDefinition().isAutowireCandidate()) {
return false;
@@ -82,6 +83,7 @@ public final class CustomAutowireConfigurerTests {
return false;
}
+ @Override
public Object getSuggestedValue(DependencyDescriptor descriptor) {
return null;
}
diff --git a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
index 7ef18579bf..9760821441 100644
--- a/spring-beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
+++ b/spring-beans/src/test/java/org/springframework/beans/factory/annotation/InjectAnnotationBeanPostProcessorTests.java
@@ -609,6 +609,7 @@ public class InjectAnnotationBeanPostProcessorTests {
public ExtendedResourceInjectionBean() {
}
+ @Override
@Inject @Required
public void setTestBean2(TestBean testBean2) {
super.setTestBean2(testBean2);
@@ -662,6 +663,7 @@ public class InjectAnnotationBeanPostProcessorTests {
private ITestBean testBean4;
+ @Override
@Inject
public void setTestBean2(TestBean testBean2) {
super.setTestBean2(testBean2);
@@ -708,6 +710,7 @@ public class InjectAnnotationBeanPostProcessorTests {
private ITestBean testBean4;
+ @Override
@Inject
public void setTestBean2(TestBean testBean2) {
super.setTestBean2(testBean2);
@@ -779,6 +782,7 @@ public class InjectAnnotationBeanPostProcessorTests {
throw new UnsupportedOperationException();
}
+ @Override
@Inject
public void setTestBean2(TestBean testBean2) {
super.setTestBean2(testBean2);
@@ -938,6 +942,7 @@ public class InjectAnnotationBeanPostProcessorTests {
}
+ @SuppressWarnings("serial")
public static class ObjectFactoryFieldInjectionBean implements Serializable {
@Inject
@@ -949,6 +954,7 @@ public class InjectAnnotationBeanPostProcessorTests {
}
+ @SuppressWarnings("serial")
public static class ObjectFactoryMethodInjectionBean implements Serializable {
private Provider testBeanFactory;
@@ -992,6 +998,7 @@ public class InjectAnnotationBeanPostProcessorTests {
}
+ @SuppressWarnings("serial")
public static class ObjectFactoryListFieldInjectionBean implements Serializable {
@Inject
@@ -1007,6 +1014,7 @@ public class InjectAnnotationBeanPostProcessorTests {
}
+ @SuppressWarnings("serial")
public static class ObjectFactoryListMethodInjectionBean implements Serializable {
private Provider> testBeanFactory;
@@ -1022,6 +1030,7 @@ public class InjectAnnotationBeanPostProcessorTests {
}
+ @SuppressWarnings("serial")
public static class ObjectFactoryMapFieldInjectionBean implements Serializable {
@Inject
@@ -1037,6 +1046,7 @@ public class InjectAnnotationBeanPostProcessorTests {
}
+ @SuppressWarnings("serial")
public static class ObjectFactoryMapMethodInjectionBean implements Serializable {
private Provider