Skip to content

Commit

Permalink
Merge branch 'cleanup-3.2.x' into 3.2.x
Browse files Browse the repository at this point in the history
* 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
  ...
  • Loading branch information
cbeams committed Dec 28, 2012
2 parents 0758e72 + 8472a2b commit 7736dc3
Show file tree
Hide file tree
Showing 3,359 changed files with 29,152 additions and 28,996 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 4 additions & 2 deletions .gitignore
Expand Up @@ -10,7 +10,7 @@ integration-repo
ivy-cache
jxl.log
jmx.log
spring-jdbc/derby.log
derby.log
spring-test/test-output/
.gradle
build
Expand All @@ -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
101 changes: 93 additions & 8 deletions build.gradle
Expand Up @@ -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"
Expand All @@ -24,10 +32,35 @@ configure(allprojects) {

group = "org.springframework"

sourceCompatibility=1.5
targetCompatibility=1.5

[compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:none"]
compileJava {
sourceCompatibility=1.5
targetCompatibility=1.5
}
compileTestJava {
sourceCompatibility=1.7
targetCompatibility=1.7
}

[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"]

Expand All @@ -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 = [
Expand All @@ -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"

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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}")
}
Expand All @@ -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"))
Expand Down Expand Up @@ -431,6 +509,14 @@ project("spring-web") {

project("spring-orm") {
description = "Spring Object/Relational Mapping"

compileTestJava {
// necessary to avoid java.lang.VerifyError on toplink compilation
// TODO: remove this block when we remove toplink
sourceCompatibility=1.6
targetCompatibility=1.6
}

dependencies {
compile("aopalliance:aopalliance:1.0")
optional("org.hibernate:hibernate-core:3.3.2.GA")
Expand Down Expand Up @@ -629,7 +715,6 @@ project("spring-test-mvc") {
testCompile("javax.activation:activation:1.1")
testCompile("javax.mail:mail:1.4")
testCompile("javax.xml.bind:jaxb-api:2.2.6")
testCompile("org.easymock:easymockclassextension:${easymockVersion}")
testCompile("org.apache.tiles:tiles-request-api:1.0.1")
testCompile("org.apache.tiles:tiles-api:3.0.1")
testCompile("org.apache.tiles:tiles-core:3.0.1") {
Expand Down
4 changes: 2 additions & 2 deletions 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 {
Expand Down
24 changes: 12 additions & 12 deletions import-into-idea.md
@@ -1,32 +1,32 @@
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
5. Code away

## 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
1 change: 1 addition & 0 deletions settings.gradle
Expand Up @@ -22,3 +22,4 @@ include "spring-web"
include "spring-webmvc"
include "spring-webmvc-portlet"
include "spring-webmvc-tiles3"
include "spring-build-junit"
10 changes: 5 additions & 5 deletions 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.
Expand All @@ -18,14 +18,14 @@

import org.aopalliance.aop.Advice;

/**
/**
* Base interface holding AOP <b>advice</b> (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). <i>This interface is not for use by Spring users, but to
* allow for commonality in support for different types of advice.</i>
*
* <p>Spring AOP is based around <b>around advice</b> delivered via method
* <b>interception</b>, compliant with the AOP Alliance interception API.
* <b>interception</b>, compliant with the AOP Alliance interception API.
* The Advisor interface allows support for different types of advice,
* such as <b>before</b> and <b>after</b> advice, which need not be
* implemented using interception.
Expand All @@ -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.
* <p><b>Note that this method is not currently used by the framework.</b>
* Typical Advisor implementations always return <code>true</code>.
* 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
Expand Down
@@ -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.
Expand Down Expand Up @@ -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 <code>null</code>.
* @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
Expand Down
@@ -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.
Expand All @@ -25,6 +25,7 @@
* @author Juergen Hoeller
* @since 2.0
*/
@SuppressWarnings("serial")
public class AopInvocationException extends NestedRuntimeException {

/**
Expand Down
@@ -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.
Expand All @@ -18,7 +18,7 @@

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 <b>introduction</b>.
Expand All @@ -37,7 +37,7 @@
* @see IntroductionAdvisor
*/
public interface DynamicIntroductionAdvice extends Advice {

/**
* Does this introduction advice implement the given interface?
* @param intf the interface to check
Expand Down
@@ -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.
Expand Down Expand Up @@ -30,7 +30,7 @@
* @see IntroductionInterceptor
*/
public interface IntroductionAdvisor extends Advisor, IntroductionInfo {

/**
* Return the filter determining which target classes this introduction
* should apply to.
Expand All @@ -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.
Expand Down
@@ -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.
Expand Down Expand Up @@ -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 <code>null</code>, 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 <code>true</code> if the object on whose behalf we are
* asking is the subject on one or more introductions; <code>false</code> 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);
Expand Down
@@ -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.
Expand Down Expand Up @@ -29,7 +29,7 @@
* @since 1.1.1
*/
public interface IntroductionInfo {

/**
* Return the additional interfaces introduced by this Advisor or Advice.
* @return the introduced interfaces
Expand Down

0 comments on commit 7736dc3

Please sign in to comment.