Skip to content

Commit 7736dc3

Browse files
committed
Merge branch 'cleanup-3.2.x' into 3.2.x
* cleanup-3.2.x: (21 commits) Update Apache license headers for affected sources Ignore performance-sensitive tests by default Introduce 'spring-build-junit' subproject Replace EasyMock with Mockito in test sources Add @OverRide annotations to test sources Update test source and target JDK compatibility Update -Xlint compiler warning output Fix various compiler warnings in spring-context Fix "unnecessary @SuppressWarnings" warnings Fix [rawtypes] compiler warnings Fix [dep-ann] warnings with @deprecated Fix [cast] compiler warnings Fix [serial] compiler warnings Fix [varargs] compiler warnings Fix warnings due to unused import statements Replace <code> with {@code} throughout Javadoc Fix various Javadoc warnings Replace space indentation with tabs Remove trailing whitespace in source files Various updates to support IDEA ...
2 parents 0758e72 + 8472a2b commit 7736dc3

File tree

3,359 files changed

+29152
-28996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,359 files changed

+29152
-28996
lines changed

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ integration-repo
1010
ivy-cache
1111
jxl.log
1212
jmx.log
13-
spring-jdbc/derby.log
13+
derby.log
1414
spring-test/test-output/
1515
.gradle
1616
build
@@ -19,8 +19,10 @@ build
1919
argfile*
2020
pom.xml
2121

22-
# IDEA metadata and output dirs
22+
# IDEA artifacts and output dirs
2323
*.iml
2424
*.ipr
2525
*.iws
2626
out
27+
test-output
28+
atlassian-ide-plugin.xml

build.gradle

Lines changed: 93 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ configure(allprojects) {
1616
ext.slf4jVersion = "1.6.1"
1717
ext.gradleScriptDir = "${rootProject.projectDir}/gradle"
1818

19+
if (rootProject.hasProperty("VERSION_QUALIFIER")) {
20+
def qualifier = rootProject.getProperty("VERSION_QUALIFIER")
21+
if (qualifier.startsWith("SPR-")) { // topic branch, e.g. SPR-1234
22+
// replace 3.2.0.BUILD-SNAPSHOT for 3.2.0.SPR-1234-SNAPSHOT
23+
version = version.replace('BUILD', qualifier)
24+
}
25+
}
26+
1927
apply plugin: "propdeps"
2028
apply plugin: "java"
2129
apply plugin: "propdeps-eclipse"
@@ -24,10 +32,35 @@ configure(allprojects) {
2432

2533
group = "org.springframework"
2634

27-
sourceCompatibility=1.5
28-
targetCompatibility=1.5
29-
30-
[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"]
35+
compileJava {
36+
sourceCompatibility=1.5
37+
targetCompatibility=1.5
38+
}
39+
compileTestJava {
40+
sourceCompatibility=1.7
41+
targetCompatibility=1.7
42+
}
43+
44+
[compileJava, compileTestJava]*.options*.compilerArgs = [
45+
"-Xlint:serial",
46+
"-Xlint:varargs",
47+
"-Xlint:cast",
48+
"-Xlint:classfile",
49+
"-Xlint:dep-ann",
50+
"-Xlint:divzero",
51+
"-Xlint:empty",
52+
"-Xlint:finally",
53+
"-Xlint:overrides",
54+
"-Xlint:path",
55+
"-Xlint:processing",
56+
"-Xlint:static",
57+
"-Xlint:try",
58+
"-Xlint:-options", // intentionally disabled
59+
"-Xlint:-fallthrough", // intentionally disabled
60+
"-Xlint:-rawtypes", // TODO enable and fix warnings
61+
"-Xlint:-deprecation", // TODO enable and fix warnings
62+
"-Xlint:-unchecked" // TODO enable and fix warnings
63+
]
3164

3265
sourceSets.test.resources.srcDirs = ["src/test/resources", "src/test/java"]
3366

@@ -41,7 +74,7 @@ configure(allprojects) {
4174
dependencies {
4275
testCompile("junit:junit:${junitVersion}")
4376
testCompile("org.hamcrest:hamcrest-all:1.3")
44-
testCompile("org.easymock:easymock:${easymockVersion}")
77+
testCompile("org.mockito:mockito-core:1.9.5")
4578
}
4679

4780
ext.javadocLinks = [
@@ -67,7 +100,17 @@ configure(allprojects) {
67100
] as String[]
68101
}
69102

70-
configure(subprojects) { subproject ->
103+
configure(allprojects.findAll{it.name in ["spring", "spring-jms", "spring-orm",
104+
"spring-orm-hibernate4", "spring-oxm", "spring-struts", "spring-test",
105+
"spring-test-mvc", "spring-tx", "spring-web", "spring-webmvc",
106+
"spring-webmvc-portlet", "spring-webmvc-tiles3"]}) {
107+
dependencies {
108+
testCompile("org.easymock:easymock:${easymockVersion}")
109+
testCompile "org.easymock:easymockclassextension:${easymockVersion}"
110+
}
111+
}
112+
113+
configure(subprojects - project(":spring-build-junit")) { subproject ->
71114
apply plugin: "merge"
72115
apply from: "${gradleScriptDir}/publish-maven.gradle"
73116

@@ -116,6 +159,34 @@ configure(subprojects) { subproject ->
116159
}
117160
}
118161

162+
configure(allprojects - project(":spring-build-junit")) {
163+
dependencies {
164+
testCompile(project(":spring-build-junit"))
165+
}
166+
167+
eclipse.classpath.file.whenMerged { classpath ->
168+
classpath.entries.find{it.path == "/spring-build-junit"}.exported = false
169+
}
170+
171+
test.systemProperties.put("testGroups", properties.get("testGroups"))
172+
}
173+
174+
project("spring-build-junit") {
175+
description = "Build-time JUnit dependencies and utilities"
176+
177+
// NOTE: This is an internal project and is not published.
178+
179+
dependencies {
180+
compile("commons-logging:commons-logging:1.1.1")
181+
compile("junit:junit:${junitVersion}")
182+
compile("org.hamcrest:hamcrest-all:1.3")
183+
compile("org.easymock:easymock:${easymockVersion}")
184+
}
185+
186+
// Don't actually generate any artifacts
187+
configurations.archives.artifacts.clear()
188+
}
189+
119190

120191
project("spring-core") {
121192
description = "Spring Core"
@@ -297,7 +368,6 @@ project("spring-tx") {
297368
optional("javax.resource:connector-api:1.5")
298369
optional("org.apache.geronimo.specs:geronimo-jta_1.1_spec:1.1")
299370
optional("javax.ejb:ejb-api:3.0")
300-
testCompile "org.easymock:easymockclassextension:${easymockVersion}"
301371
testCompile("javax.persistence:persistence-api:1.0")
302372
testCompile("org.aspectj:aspectjweaver:${aspectjVersion}")
303373
}
@@ -306,6 +376,14 @@ project("spring-tx") {
306376
project("spring-oxm") {
307377
description = "Spring Object/XML Marshalling"
308378
apply from: "oxm.gradle"
379+
380+
compileTestJava {
381+
// necessary to avoid java.lang.VerifyError on jibx compilation
382+
// see http://jira.codehaus.org/browse/JIBX-465
383+
sourceCompatibility=1.6
384+
targetCompatibility=1.6
385+
}
386+
309387
dependencies {
310388
compile(project(":spring-beans"))
311389
compile(project(":spring-core"))
@@ -431,6 +509,14 @@ project("spring-web") {
431509

432510
project("spring-orm") {
433511
description = "Spring Object/Relational Mapping"
512+
513+
compileTestJava {
514+
// necessary to avoid java.lang.VerifyError on toplink compilation
515+
// TODO: remove this block when we remove toplink
516+
sourceCompatibility=1.6
517+
targetCompatibility=1.6
518+
}
519+
434520
dependencies {
435521
compile("aopalliance:aopalliance:1.0")
436522
optional("org.hibernate:hibernate-core:3.3.2.GA")
@@ -629,7 +715,6 @@ project("spring-test-mvc") {
629715
testCompile("javax.activation:activation:1.1")
630716
testCompile("javax.mail:mail:1.4")
631717
testCompile("javax.xml.bind:jaxb-api:2.2.6")
632-
testCompile("org.easymock:easymockclassextension:${easymockVersion}")
633718
testCompile("org.apache.tiles:tiles-request-api:1.0.1")
634719
testCompile("org.apache.tiles:tiles-api:3.0.1")
635720
testCompile("org.apache.tiles:tiles-core:3.0.1") {

gradle/jdiff/Null.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
/**
1+
/**
22
* This class is used only as a "null" argument for Javadoc when comparing
3-
* two API files. Javadoc has to have a package, .java or .class file as an
3+
* two API files. Javadoc has to have a package, .java or .class file as an
44
* argument, even though JDiff doesn't use it.
55
*/
66
public class Null {

import-into-idea.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
The following has been tested against Intellij IDEA 11.0.1
1+
The following has been tested against Intellij IDEA 12.0
22

33
## Steps
44

55
_Within your locally cloned spring-framework working directory:_
66

7-
1. Generate IDEA metadata with `./gradlew cleanIdea idea`
7+
1. Generate IDEA metadata with `./gradlew :spring-oxm:compileTestJava cleanIdea idea`
88
2. Import into IDEA as usual
99
3. Set the Project JDK as appropriate
1010
4. Add git support
1111
5. Code away
1212

1313
## Known issues
1414

15-
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.
16-
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.
17-
18-
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.:
19-
20-
* http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaProject.html
21-
* http://gradle.org/docs/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html
22-
* http://gradle.org/docs/current/groovydoc/org/gradle/plugins/ide/idea/model/IdeaModule.html
15+
1. `spring-aspects` does not compile out of the box due to references to aspect types unknown to IDEA.
16+
See http://youtrack.jetbrains.com/issue/IDEA-64446 for details. In the meantime, you may want to
17+
exclude `spring-aspects` from the overall project to avoid compilation errors.
18+
2. While all JUnit tests pass from the command line with Gradle, many will fail when run from IDEA.
19+
Resolving this is a work in progress. If attempting to run all JUnit tests from within IDEA, you will
20+
likely need to set the following VM options to avoid out of memory errors:
21+
-XX:MaxPermSize=2048m -Xmx2048m -XX:MaxHeapSize=2048m
2322

2423
## Tips
2524

26-
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.
25+
In any case, please do not check in your own generated .iml, .ipr, or .iws files.
26+
You'll notice these files are already intentionally in .gitignore. The same policy goes for eclipse metadata.
2727

2828
## FAQ
2929

3030
Q. What about IDEA's own [Gradle support](http://confluence.jetbrains.net/display/IDEADEV/Gradle+integration)?
3131

32-
A. Unknown. Please report back if you try it and it goes well for you.
32+
A. Keep an eye on http://youtrack.jetbrains.com/issue/IDEA-53476

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ include "spring-web"
2222
include "spring-webmvc"
2323
include "spring-webmvc-portlet"
2424
include "spring-webmvc-tiles3"
25+
include "spring-build-junit"

spring-aop/src/main/java/org/springframework/aop/Advisor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2007 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,14 +18,14 @@
1818

1919
import org.aopalliance.aop.Advice;
2020

21-
/**
21+
/**
2222
* Base interface holding AOP <b>advice</b> (action to take at a joinpoint)
23-
* and a filter determining the applicability of the advice (such as
23+
* and a filter determining the applicability of the advice (such as
2424
* a pointcut). <i>This interface is not for use by Spring users, but to
2525
* allow for commonality in support for different types of advice.</i>
2626
*
2727
* <p>Spring AOP is based around <b>around advice</b> delivered via method
28-
* <b>interception</b>, compliant with the AOP Alliance interception API.
28+
* <b>interception</b>, compliant with the AOP Alliance interception API.
2929
* The Advisor interface allows support for different types of advice,
3030
* such as <b>before</b> and <b>after</b> advice, which need not be
3131
* implemented using interception.
@@ -50,7 +50,7 @@ public interface Advisor {
5050
* (for example, creating a mixin) or shared with all instances of
5151
* the advised class obtained from the same Spring bean factory.
5252
* <p><b>Note that this method is not currently used by the framework.</b>
53-
* Typical Advisor implementations always return <code>true</code>.
53+
* Typical Advisor implementations always return {@code true}.
5454
* Use singleton/prototype bean definitions or appropriate programmatic
5555
* proxy creation to ensure that Advisors have the correct lifecycle model.
5656
* @return whether this advice is associated with a particular target instance

spring-aop/src/main/java/org/springframework/aop/AfterReturningAdvice.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2007 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@ public interface AfterReturningAdvice extends AfterAdvice {
3333
* @param returnValue the value returned by the method, if any
3434
* @param method method being invoked
3535
* @param args arguments to the method
36-
* @param target target of the method invocation. May be <code>null</code>.
36+
* @param target target of the method invocation. May be {@code null}.
3737
* @throws Throwable if this object wishes to abort the call.
3838
* Any exception thrown will be returned to the caller if it's
3939
* allowed by the method signature. Otherwise the exception

spring-aop/src/main/java/org/springframework/aop/AopInvocationException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2006 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
2525
* @author Juergen Hoeller
2626
* @since 2.0
2727
*/
28+
@SuppressWarnings("serial")
2829
public class AopInvocationException extends NestedRuntimeException {
2930

3031
/**

spring-aop/src/main/java/org/springframework/aop/DynamicIntroductionAdvice.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2007 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818

1919
import org.aopalliance.aop.Advice;
2020

21-
/**
21+
/**
2222
* Subinterface of AOP Alliance Advice that allows additional interfaces
2323
* to be implemented by an Advice, and available via a proxy using that
2424
* interceptor. This is a fundamental AOP concept called <b>introduction</b>.
@@ -37,7 +37,7 @@
3737
* @see IntroductionAdvisor
3838
*/
3939
public interface DynamicIntroductionAdvice extends Advice {
40-
40+
4141
/**
4242
* Does this introduction advice implement the given interface?
4343
* @param intf the interface to check

spring-aop/src/main/java/org/springframework/aop/IntroductionAdvisor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2007 the original author or authors.
2+
* Copyright 2002-2012 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
3030
* @see IntroductionInterceptor
3131
*/
3232
public interface IntroductionAdvisor extends Advisor, IntroductionInfo {
33-
33+
3434
/**
3535
* Return the filter determining which target classes this introduction
3636
* should apply to.
@@ -39,7 +39,7 @@ public interface IntroductionAdvisor extends Advisor, IntroductionInfo {
3939
* @return the class filter
4040
*/
4141
ClassFilter getClassFilter();
42-
42+
4343
/**
4444
* Can the advised interfaces be implemented by the introduction advice?
4545
* Invoked before adding an IntroductionAdvisor.

0 commit comments

Comments
 (0)