Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: spring-projects/spring-framework
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.3.26.RELEASE
Choose a base ref
...
head repository: spring-projects/spring-framework
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.3.27.RELEASE
Choose a head ref
  • 13 commits
  • 38 files changed
  • 4 contributors

Commits on Jan 14, 2020

  1. Copy the full SHA
    4443381 View commit details

Commits on Jan 16, 2020

  1. Copy the full SHA
    032100c View commit details

Commits on Jan 17, 2020

  1. Upgrade to Gradle 4.10.2

    Due to an upgrade of the Artifactory publication plugin on the CI
    server, we need to upgrade the build for 4.3.x to Gradle 4.x.
    
    Closes gh-24392
    sbrannen committed Jan 17, 2020
    Copy the full SHA
    2dcce8c View commit details

Commits on Feb 12, 2020

  1. Copy the full SHA
    ef1be17 View commit details
  2. Polishing

    jhoeller committed Feb 12, 2020
    Copy the full SHA
    322d7be View commit details

Commits on Mar 13, 2020

  1. Polishing

    jhoeller committed Mar 13, 2020
    Copy the full SHA
    6e579b0 View commit details

Commits on Mar 24, 2020

  1. Polishing

    jhoeller committed Mar 24, 2020
    Copy the full SHA
    01ec5d8 View commit details

Commits on Apr 3, 2020

  1. Copy the full SHA
    eb81337 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f929109 View commit details

Commits on Apr 17, 2020

  1. Retain brackets for IPV6 address in MockHttpServletRequest

    According to the Javadoc for ServletRequest's getServerName() method,
    when the `Host` header is set, the server name is "the value of the
    part before ':' in the Host header value ...". For a value representing
    an IPV6 address such as `[::ffff:abcd:abcd]`, the enclosing square
    brackets should therefore not be stripped from the enclosed IPV6
    address.
    
    However, the changes made in conjunction with gh-16704 introduced a
    regression in Spring Framework 4.1 for the getServerName() method in
    MockHttpServletRequest by stripping the enclosing brackets from the
    IPV6 address in the `Host` header. Similarly, the changes made in
    conjunction with gh-20686 introduced a regression in Spring Framework
    4.3.13 and 5.0.2 in the getRequestURL() method in
    MockHttpServletRequest by delegating to the getServerName() method
    which strips the enclosing brackets.
    
    This commit fixes the implementation of getServerName() so that the
    enclosing brackets are no longer stripped from an IPV6 address in the
    `Host` header. The implementation of getRequestURL() is therefore also
    fixed.
    
    In addition, in order to avoid a NullPointerException, the
    implementations of getServerName() and getServerPort() now assert that
    an IPV6 address present in the `Host` header correctly contains an
    opening and closing bracket and throw an IllegalStateException if that
    is not the case.
    
    Closes gh-24916
    sbrannen committed Apr 17, 2020
    Copy the full SHA
    f60bb82 View commit details

Commits on Apr 21, 2020

  1. Escape quoted filename in HttpHeaders

    This is primarily to align with similar changes applied to
    ContentDisposition in 5.x.
    
    Closes gh-24580
    rstoyanchev committed Apr 21, 2020
    Copy the full SHA
    85c5a0c View commit details

Commits on Apr 27, 2020

  1. Polishing

    jhoeller committed Apr 27, 2020
    Copy the full SHA
    6893207 View commit details

Commits on Apr 28, 2020

  1. Copy the full SHA
    82a5f5c View commit details
Showing with 393 additions and 251 deletions.
  1. +4 −43 build.gradle
  2. +1 −1 gradle.properties
  3. +1 −1 gradle/ide.gradle
  4. BIN gradle/wrapper/gradle-wrapper.jar
  5. +1 −2 gradle/wrapper/gradle-wrapper.properties
  6. +17 −9 gradlew
  7. +0 −6 gradlew.bat
  8. +29 −52 spring-aop/src/main/java/org/springframework/aop/framework/ProxyFactoryBean.java
  9. +2 −1 spring-aspects/src/main/java/org/springframework/scheduling/aspectj/AspectJAsyncConfiguration.java
  10. +2 −1 .../main/java/org/springframework/transaction/aspectj/AspectJTransactionManagementConfiguration.java
  11. +10 −3 spring-beans/src/main/java/org/springframework/beans/factory/FactoryBean.java
  12. +3 −3 spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
  13. +3 −0 spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
  14. +33 −0 spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
  15. +3 −2 spring-context/src/main/java/org/springframework/context/annotation/AutoProxyRegistrar.java
  16. +6 −5 spring-context/src/main/java/org/springframework/context/annotation/Configuration.java
  17. +2 −1 spring-context/src/main/java/org/springframework/context/annotation/ImportSelector.java
  18. +2 −1 ...ng-context/src/main/java/org/springframework/context/annotation/LoadTimeWeavingConfiguration.java
  19. +2 −1 spring-context/src/main/java/org/springframework/context/annotation/MBeanExportConfiguration.java
  20. +33 −23 spring-context/src/main/java/org/springframework/context/annotation/PropertySource.java
  21. +2 −0 spring-context/src/test/resources/org/springframework/scripting/groovy/ScriptBean.groovy
  22. +2 −0 spring-context/src/test/resources/org/springframework/scripting/groovy/TestFactoryBean.groovy
  23. +2 −0 spring-context/src/test/resources/org/springframework/scripting/groovy/simple.groovy
  24. +3 −1 spring-core/src/main/java/org/springframework/core/io/support/PropertySourceFactory.java
  25. +7 −12 spring-core/src/main/java/org/springframework/util/ClassUtils.java
  26. +3 −2 spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceTransactionManager.java
  27. +2 −2 spring-jdbc/src/main/java/org/springframework/jdbc/datasource/SingleConnectionDataSource.java
  28. +4 −4 spring-jdbc/src/main/java/org/springframework/jdbc/datasource/init/DatabasePopulatorUtils.java
  29. +11 −5 spring-test/src/main/java/org/springframework/mock/web/MockHttpServletRequest.java
  30. +74 −7 spring-test/src/test/java/org/springframework/mock/web/MockHttpServletRequestTests.java
  31. +2 −1 ...main/java/org/springframework/transaction/annotation/ProxyTransactionManagementConfiguration.java
  32. +31 −20 spring-web/src/main/java/org/springframework/http/HttpHeaders.java
  33. +2 −2 spring-web/src/main/java/org/springframework/web/client/RestTemplate.java
  34. +2 −2 spring-web/src/main/java/org/springframework/web/cors/DefaultCorsProcessor.java
  35. +66 −25 spring-web/src/test/java/org/springframework/http/HttpHeadersTests.java
  36. +11 −5 spring-web/src/test/java/org/springframework/mock/web/test/MockHttpServletRequest.java
  37. +8 −8 spring-webmvc/src/main/java/org/springframework/web/servlet/view/velocity/VelocityToolboxView.java
  38. +7 −0 src/dist/license.txt
47 changes: 4 additions & 43 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -3,17 +3,13 @@ buildscript {
maven { url "https://repo.spring.io/plugins-release" }
}
dependencies {
classpath("org.springframework.build.gradle:propdeps-plugin:0.0.7")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2")
classpath("io.spring.gradle:propdeps-plugin:0.0.9.RELEASE")
classpath("io.spring.gradle:docbook-reference-plugin:0.3.1")
classpath("org.asciidoctor:asciidoctor-gradle-plugin:1.5.2")
classpath("ws.antonov.gradle.plugins:gradle-plugin-protobuf:0.9.1")
}
}

plugins {
id "org.sonarqube" version "1.1"
}

ext {
linkHomepage = 'https://projects.spring.io/spring-framework'
linkCi = 'https://build.spring.io/browse/SPR'
@@ -222,12 +218,6 @@ configure(subprojects - project(":spring-build-src")) { subproject ->
jacoco("org.jacoco:org.jacoco.agent:0.7.5.201505241946:runtime")
}

gradle.taskGraph.whenReady {taskGraph ->
if (taskGraph.hasTask(':sonarqube')) {
test.jvmArgs "-javaagent:${configurations.jacoco.asPath}=destfile=${buildDir}/jacoco.exec,includes=org.springframework.*"
}
}

jar {
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
@@ -1134,20 +1124,6 @@ project("spring-framework-bom") {
}
}

sonarqube {
properties {
property "sonar.projectName", "Spring Framework"
property "sonar.profile", "Spring Framework"
property "sonar.jacoco.reportPath", "${buildDir.name}/jacoco.exec"
property "sonar.links.homepage", linkHomepage
property "sonar.links.ci", linkCi
property "sonar.links.issue", linkIssue
property "sonar.links.scm", linkScmUrl
property "sonar.links.scm_dev", linkScmDevConnection
property "sonar.java.coveragePlugin", "jacoco"
}
}

configure(rootProject) {
description = "Spring Framework"

@@ -1370,9 +1346,9 @@ configure(rootProject) {
archives distZip
}

task wrapper(type: Wrapper) {
wrapper {
description = "Generates gradlew[.bat] scripts"
gradleVersion = "2.14.1"
gradleVersion = "4.10.2"

doLast() {
def gradleOpts = "-XX:MaxMetaspaceSize=1024m -Xmx1024m"
@@ -1388,21 +1364,6 @@ configure(rootProject) {

}

configure([project(':spring-build-src'), project(':spring-framework-bom')]) {
sonarqube {
skipProject = true
}
}

configure(project(':spring-core')) {
sonarqube {
properties {
property "sonar.exclusions",
"src/main/java/org/springframework/cglib/**/*,src/main/java/org/springframework/asm/**/*"
}
}
}

/*
* Support publication of artifacts versioned by topic branch.
* CI builds supply `-P BRANCH_NAME=<TOPIC>` to gradle at build time.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=4.3.26.BUILD-SNAPSHOT
version=4.3.27.RELEASE
2 changes: 1 addition & 1 deletion gradle/ide.gradle
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ eclipse.classpath.file.whenMerged { classpath ->
def projectName = matcher[0][1]
def path = "/${projectName}"
if(!classpath.entries.find { e -> e instanceof ProjectDependency && e.path == path }) {
def dependency = new ProjectDependency(path, project(":${projectName}").path)
def dependency = new ProjectDependency(path)
dependency.exported = true
classpath.entries.add(dependency)
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Aug 17 21:21:18 CEST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip
26 changes: 17 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
@@ -34,11 +34,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
@@ -155,11 +155,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -50,7 +50,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
@@ -61,11 +60,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2020 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,7 @@
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.aopalliance.aop.Advice;
import org.aopalliance.intercept.Interceptor;
@@ -334,11 +332,8 @@ private synchronized Object newPrototypeInstance() {
// an independent instance of the configuration.
// In this case, no proxy will have an instance of this object's configuration,
// but will have an independent copy.
if (logger.isTraceEnabled()) {
logger.trace("Creating copy of prototype ProxyFactoryBean config: " + this);
}

ProxyCreatorSupport copy = new ProxyCreatorSupport(getAopProxyFactory());

// The copy needs a fresh advisor chain, and a fresh TargetSource.
TargetSource targetSource = freshTargetSource();
copy.copyConfigurationFrom(this, targetSource, freshAdvisorChain());
@@ -349,9 +344,6 @@ private synchronized Object newPrototypeInstance() {
}
copy.setFrozen(this.freezeProxy);

if (logger.isTraceEnabled()) {
logger.trace("Using ProxyCreatorSupport copy: " + copy);
}
return getProxy(copy.createAopProxy());
}

@@ -438,16 +430,12 @@ private synchronized void initializeAdvisorChain() throws AopConfigException, Be

// Materialize interceptor chain from bean names.
for (String name : this.interceptorNames) {
if (logger.isTraceEnabled()) {
logger.trace("Configuring advisor or advice '" + name + "'");
}

if (name.endsWith(GLOBAL_SUFFIX)) {
if (!(this.beanFactory instanceof ListableBeanFactory)) {
throw new AopConfigException(
"Can only use global advisors or interceptors with a ListableBeanFactory");
}
addGlobalAdvisor((ListableBeanFactory) this.beanFactory,
addGlobalAdvisors((ListableBeanFactory) this.beanFactory,
name.substring(0, name.length() - GLOBAL_SUFFIX.length()));
}

@@ -464,7 +452,7 @@ private synchronized void initializeAdvisorChain() throws AopConfigException, Be
// Avoid unnecessary creation of prototype bean just for advisor chain initialization.
advice = new PrototypePlaceholderAdvisor(name);
}
addAdvisorOnChainCreation(advice, name);
addAdvisorOnChainCreation(advice);
}
}
}
@@ -487,11 +475,10 @@ private List<Advisor> freshAdvisorChain() {
if (logger.isDebugEnabled()) {
logger.debug("Refreshing bean named '" + pa.getBeanName() + "'");
}
// Replace the placeholder with a fresh prototype instance resulting
// from a getBean() lookup
// Replace the placeholder with a fresh prototype instance resulting from a getBean lookup
if (this.beanFactory == null) {
throw new IllegalStateException("No BeanFactory available anymore (probably due to serialization) " +
"- cannot resolve prototype advisor '" + pa.getBeanName() + "'");
throw new IllegalStateException("No BeanFactory available anymore (probably due to " +
"serialization) - cannot resolve prototype advisor '" + pa.getBeanName() + "'");
}
Object bean = this.beanFactory.getBean(pa.getBeanName());
Advisor refreshedAdvisor = namedBeanToAdvisor(bean);
@@ -508,28 +495,26 @@ private List<Advisor> freshAdvisorChain() {
/**
* Add all global interceptors and pointcuts.
*/
private void addGlobalAdvisor(ListableBeanFactory beanFactory, String prefix) {
private void addGlobalAdvisors(ListableBeanFactory beanFactory, String prefix) {
String[] globalAdvisorNames =
BeanFactoryUtils.beanNamesForTypeIncludingAncestors(beanFactory, Advisor.class);
String[] globalInterceptorNames =
BeanFactoryUtils.beanNamesForTypeIncludingAncestors(beanFactory, Interceptor.class);
List<Object> beans = new ArrayList<Object>(globalAdvisorNames.length + globalInterceptorNames.length);
Map<Object, String> names = new HashMap<Object, String>(beans.size());
for (String name : globalAdvisorNames) {
Object bean = beanFactory.getBean(name);
beans.add(bean);
names.put(bean, name);
}
for (String name : globalInterceptorNames) {
Object bean = beanFactory.getBean(name);
beans.add(bean);
names.put(bean, name);
}
AnnotationAwareOrderComparator.sort(beans);
for (Object bean : beans) {
String name = names.get(bean);
if (name.startsWith(prefix)) {
addAdvisorOnChainCreation(bean, name);
if (globalAdvisorNames.length > 0 || globalInterceptorNames.length > 0) {
List<Object> beans = new ArrayList<Object>(globalAdvisorNames.length + globalInterceptorNames.length);
for (String name : globalAdvisorNames) {
if (name.startsWith(prefix)) {
beans.add(beanFactory.getBean(name));
}
}
for (String name : globalInterceptorNames) {
if (name.startsWith(prefix)) {
beans.add(beanFactory.getBean(name));
}
}
AnnotationAwareOrderComparator.sort(beans);
for (Object bean : beans) {
addAdvisorOnChainCreation(bean);
}
}
}
@@ -540,17 +525,11 @@ private void addGlobalAdvisor(ListableBeanFactory beanFactory, String prefix) {
* Because of these three possibilities, we can't type the signature
* more strongly.
* @param next advice, advisor or target object
* @param name bean name from which we obtained this object in our owning
* bean factory
*/
private void addAdvisorOnChainCreation(Object next, String name) {
private void addAdvisorOnChainCreation(Object next) {
// We need to convert to an Advisor if necessary so that our source reference
// matches what we find from superclass interceptors.
Advisor advisor = namedBeanToAdvisor(next);
if (logger.isTraceEnabled()) {
logger.trace("Adding advisor with name '" + name + "'");
}
addAdvisor(advisor);
addAdvisor(namedBeanToAdvisor(next));
}

/**
@@ -561,9 +540,7 @@ private void addAdvisorOnChainCreation(Object next, String name) {
*/
private TargetSource freshTargetSource() {
if (this.targetName == null) {
if (logger.isTraceEnabled()) {
logger.trace("Not refreshing target: Bean name not specified in 'interceptorNames'.");
}
// Not refreshing target: bean name not specified in 'interceptorNames'
return this.targetSource;
}
else {
@@ -591,8 +568,8 @@ private Advisor namedBeanToAdvisor(Object next) {
// We expected this to be an Advisor or Advice,
// but it wasn't. This is a configuration error.
throw new AopConfigException("Unknown advisor type " + next.getClass() +
"; Can only include Advisor or Advice type beans in interceptorNames chain except for last entry," +
"which may also be target or TargetSource", ex);
"; can only include Advisor or Advice type beans in interceptorNames chain " +
"except for last entry which may also be target instance or TargetSource", ex);
}
}

@@ -603,7 +580,7 @@ private Advisor namedBeanToAdvisor(Object next) {
protected void adviceChanged() {
super.adviceChanged();
if (this.singleton) {
logger.debug("Advice has changed; recaching singleton instance");
logger.debug("Advice has changed; re-caching singleton instance");
synchronized (this) {
this.singletonInstance = null;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2020 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,6 +36,7 @@
* @see org.springframework.scheduling.annotation.ProxyAsyncConfiguration
*/
@Configuration
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public class AspectJAsyncConfiguration extends AbstractAsyncConfiguration {

@Bean(name = TaskManagementConfigUtils.ASYNC_EXECUTION_ASPECT_BEAN_NAME)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2020 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 @@
* @see TransactionManagementConfigurationSelector
*/
@Configuration
@Role(BeanDefinition.ROLE_INFRASTRUCTURE)
public class AspectJTransactionManagementConfiguration extends AbstractTransactionManagementConfiguration {

@Bean(name = TransactionManagementConfigUtils.TRANSACTION_ASPECT_BEAN_NAME)
Loading