Merge branch '5.2.x'

# Conflicts:
#	build.gradle
#	spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractBeanFactory.java
#	spring-context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationInterceptor.java
This commit is contained in:
Juergen Hoeller 2020-05-14 00:33:37 +02:00
commit 26c205589b
8 changed files with 63 additions and 42 deletions

View File

@ -23,8 +23,8 @@ configure(allprojects) { project ->
dependencyManagement { dependencyManagement {
imports { imports {
mavenBom "com.fasterxml.jackson:jackson-bom:2.10.3" mavenBom "com.fasterxml.jackson:jackson-bom:2.10.4"
mavenBom "io.netty:netty-bom:4.1.49.Final" mavenBom "io.netty:netty-bom:4.1.50.Final"
mavenBom "io.projectreactor:reactor-bom:Dysprosium-SR7" mavenBom "io.projectreactor:reactor-bom:Dysprosium-SR7"
mavenBom "io.rsocket:rsocket-bom:1.0.0" mavenBom "io.rsocket:rsocket-bom:1.0.0"
mavenBom "org.eclipse.jetty:jetty-bom:9.4.28.v20200408" mavenBom "org.eclipse.jetty:jetty-bom:9.4.28.v20200408"
@ -114,19 +114,19 @@ configure(allprojects) { project ->
dependency "net.sf.ehcache:ehcache:2.10.6" dependency "net.sf.ehcache:ehcache:2.10.6"
dependency "org.ehcache:jcache:1.0.1" dependency "org.ehcache:jcache:1.0.1"
dependency "org.ehcache:ehcache:3.4.0" dependency "org.ehcache:ehcache:3.4.0"
dependency "org.hibernate:hibernate-core:5.4.14.Final" dependency "org.hibernate:hibernate-core:5.4.15.Final"
dependency "org.hibernate:hibernate-validator:6.1.4.Final" dependency "org.hibernate:hibernate-validator:6.1.5.Final"
dependency "org.webjars:webjars-locator-core:0.44" dependency "org.webjars:webjars-locator-core:0.44"
dependency "org.webjars:underscorejs:1.8.3" dependency "org.webjars:underscorejs:1.8.3"
dependencySet(group: 'org.apache.tomcat', version: '9.0.34') { dependencySet(group: 'org.apache.tomcat', version: '9.0.35') {
entry 'tomcat-util' entry 'tomcat-util'
entry('tomcat-websocket') { entry('tomcat-websocket') {
exclude group: "org.apache.tomcat", name: "tomcat-websocket-api" exclude group: "org.apache.tomcat", name: "tomcat-websocket-api"
exclude group: "org.apache.tomcat", name: "tomcat-servlet-api" exclude group: "org.apache.tomcat", name: "tomcat-servlet-api"
} }
} }
dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.34') { dependencySet(group: 'org.apache.tomcat.embed', version: '9.0.35') {
entry 'tomcat-embed-core' entry 'tomcat-embed-core'
entry 'tomcat-embed-websocket' entry 'tomcat-embed-websocket'
} }
@ -326,7 +326,7 @@ configure([rootProject] + javaProjects) { project ->
} }
checkstyle { checkstyle {
toolVersion = "8.31" toolVersion = "8.32"
configDirectory.set(rootProject.file("src/checkstyle")) configDirectory.set(rootProject.file("src/checkstyle"))
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -52,7 +52,7 @@ import org.springframework.validation.annotation.Validated;
* at the type level of the containing target class, applying to all public service methods * at the type level of the containing target class, applying to all public service methods
* of that class. By default, JSR-303 will validate against its default group only. * of that class. By default, JSR-303 will validate against its default group only.
* *
* <p>As of Spring 5.0, this functionality requires a Bean Validation 1.1 provider. * <p>As of Spring 5.0, this functionality requires a Bean Validation 1.1+ provider.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 3.1 * @since 3.1

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -50,7 +50,7 @@ import org.springframework.validation.annotation.Validated;
* inline constraint annotations. Validation groups can be specified through {@code @Validated} * inline constraint annotations. Validation groups can be specified through {@code @Validated}
* as well. By default, JSR-303 will validate against its default group only. * as well. By default, JSR-303 will validate against its default group only.
* *
* <p>As of Spring 5.0, this functionality requires a Bean Validation 1.1 provider. * <p>As of Spring 5.0, this functionality requires a Bean Validation 1.1+ provider.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 3.1 * @since 3.1

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -464,15 +464,25 @@ public class ResolvableType implements Serializable {
*/ */
public ResolvableType getSuperType() { public ResolvableType getSuperType() {
Class<?> resolved = resolve(); Class<?> resolved = resolve();
if (resolved == null || resolved.getGenericSuperclass() == null) { if (resolved == null) {
return NONE; return NONE;
} }
ResolvableType superType = this.superType; try {
if (superType == null) { Type superclass = resolved.getGenericSuperclass();
superType = forType(resolved.getGenericSuperclass(), this); if (superclass == null) {
this.superType = superType; return NONE;
}
ResolvableType superType = this.superType;
if (superType == null) {
superType = forType(superclass, this);
this.superType = superType;
}
return superType;
}
catch (TypeNotPresentException ex) {
// Ignore non-present types in generic signature
return NONE;
} }
return superType;
} }
/** /**
@ -544,13 +554,18 @@ public class ResolvableType implements Serializable {
} }
Class<?> resolved = resolve(); Class<?> resolved = resolve();
if (resolved != null) { if (resolved != null) {
for (Type genericInterface : resolved.getGenericInterfaces()) { try {
if (genericInterface instanceof Class) { for (Type genericInterface : resolved.getGenericInterfaces()) {
if (forClass((Class<?>) genericInterface).hasGenerics()) { if (genericInterface instanceof Class) {
return true; if (forClass((Class<?>) genericInterface).hasGenerics()) {
return true;
}
} }
} }
} }
catch (TypeNotPresentException ex) {
// Ignore non-present types in generic signature
}
return getSuperType().hasUnresolvableGenerics(); return getSuperType().hasUnresolvableGenerics();
} }
return false; return false;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -38,6 +38,7 @@ import javax.xml.stream.events.StartElement;
import javax.xml.stream.events.XMLEvent; import javax.xml.stream.events.XMLEvent;
import org.xml.sax.Attributes; import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import org.xml.sax.ext.Locator2; import org.xml.sax.ext.Locator2;
import org.xml.sax.helpers.AttributesImpl; import org.xml.sax.helpers.AttributesImpl;
@ -163,9 +164,11 @@ class StaxEventXMLReader extends AbstractStaxXMLReader {
this.encoding = startDocument.getCharacterEncodingScheme(); this.encoding = startDocument.getCharacterEncodingScheme();
} }
} }
if (getContentHandler() != null) {
ContentHandler contentHandler = getContentHandler();
if (contentHandler != null) {
final Location location = event.getLocation(); final Location location = event.getLocation();
getContentHandler().setDocumentLocator(new Locator2() { contentHandler.setDocumentLocator(new Locator2() {
@Override @Override
public int getColumnNumber() { public int getColumnNumber() {
return (location != null ? location.getColumnNumber() : -1); return (location != null ? location.getColumnNumber() : -1);
@ -194,7 +197,7 @@ class StaxEventXMLReader extends AbstractStaxXMLReader {
return encoding; return encoding;
} }
}); });
getContentHandler().startDocument(); contentHandler.startDocument();
} }
} }

View File

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,6 +23,7 @@ import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamReader;
import org.xml.sax.Attributes; import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException; import org.xml.sax.SAXException;
import org.xml.sax.ext.Locator2; import org.xml.sax.ext.Locator2;
import org.xml.sax.helpers.AttributesImpl; import org.xml.sax.helpers.AttributesImpl;
@ -139,9 +140,11 @@ class StaxStreamXMLReader extends AbstractStaxXMLReader {
} }
this.encoding = this.reader.getCharacterEncodingScheme(); this.encoding = this.reader.getCharacterEncodingScheme();
} }
if (getContentHandler() != null) {
ContentHandler contentHandler = getContentHandler();
if (contentHandler != null) {
final Location location = this.reader.getLocation(); final Location location = this.reader.getLocation();
getContentHandler().setDocumentLocator(new Locator2() { contentHandler.setDocumentLocator(new Locator2() {
@Override @Override
public int getColumnNumber() { public int getColumnNumber() {
return (location != null ? location.getColumnNumber() : -1); return (location != null ? location.getColumnNumber() : -1);
@ -170,7 +173,7 @@ class StaxStreamXMLReader extends AbstractStaxXMLReader {
return encoding; return encoding;
} }
}); });
getContentHandler().startDocument(); contentHandler.startDocument();
if (this.reader.standaloneSet()) { if (this.reader.standaloneSet()) {
setStandalone(this.reader.isStandalone()); setStandalone(this.reader.isStandalone());
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -415,8 +415,8 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider {
TableParameterMetaData meta = new TableParameterMetaData(columnName, dataType, nullable); TableParameterMetaData meta = new TableParameterMetaData(columnName, dataType, nullable);
this.tableParameterMetaData.add(meta); this.tableParameterMetaData.add(meta);
if (logger.isDebugEnabled()) { if (logger.isDebugEnabled()) {
logger.debug("Retrieved meta-data: " + meta.getParameterName() + " " + logger.debug("Retrieved meta-data: '" + meta.getParameterName() + "', sqlType=" +
meta.getSqlType() + " " + meta.isNullable()); meta.getSqlType() + ", nullable=" + meta.isNullable());
} }
} }
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -45,14 +45,14 @@ public class SQLErrorCodeSQLExceptionTranslatorTests {
private static SQLErrorCodes ERROR_CODES = new SQLErrorCodes(); private static SQLErrorCodes ERROR_CODES = new SQLErrorCodes();
static { static {
ERROR_CODES.setBadSqlGrammarCodes(new String[] { "1", "2" }); ERROR_CODES.setBadSqlGrammarCodes("1", "2");
ERROR_CODES.setInvalidResultSetAccessCodes(new String[] { "3", "4" }); ERROR_CODES.setInvalidResultSetAccessCodes("3", "4");
ERROR_CODES.setDuplicateKeyCodes(new String[] {"10"}); ERROR_CODES.setDuplicateKeyCodes("10");
ERROR_CODES.setDataAccessResourceFailureCodes(new String[] { "5" }); ERROR_CODES.setDataAccessResourceFailureCodes("5");
ERROR_CODES.setDataIntegrityViolationCodes(new String[] { "6" }); ERROR_CODES.setDataIntegrityViolationCodes("6");
ERROR_CODES.setCannotAcquireLockCodes(new String[] { "7" }); ERROR_CODES.setCannotAcquireLockCodes("7");
ERROR_CODES.setDeadlockLoserCodes(new String[] { "8" }); ERROR_CODES.setDeadlockLoserCodes("8");
ERROR_CODES.setCannotSerializeTransactionCodes(new String[] { "9" }); ERROR_CODES.setCannotSerializeTransactionCodes("9");
} }