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:
@@ -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");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -464,15 +464,25 @@ public class ResolvableType implements Serializable {
|
||||
*/
|
||||
public ResolvableType getSuperType() {
|
||||
Class<?> resolved = resolve();
|
||||
if (resolved == null || resolved.getGenericSuperclass() == null) {
|
||||
if (resolved == null) {
|
||||
return NONE;
|
||||
}
|
||||
ResolvableType superType = this.superType;
|
||||
if (superType == null) {
|
||||
superType = forType(resolved.getGenericSuperclass(), this);
|
||||
this.superType = superType;
|
||||
try {
|
||||
Type superclass = resolved.getGenericSuperclass();
|
||||
if (superclass == null) {
|
||||
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();
|
||||
if (resolved != null) {
|
||||
for (Type genericInterface : resolved.getGenericInterfaces()) {
|
||||
if (genericInterface instanceof Class) {
|
||||
if (forClass((Class<?>) genericInterface).hasGenerics()) {
|
||||
return true;
|
||||
try {
|
||||
for (Type genericInterface : resolved.getGenericInterfaces()) {
|
||||
if (genericInterface instanceof Class) {
|
||||
if (forClass((Class<?>) genericInterface).hasGenerics()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (TypeNotPresentException ex) {
|
||||
// Ignore non-present types in generic signature
|
||||
}
|
||||
return getSuperType().hasUnresolvableGenerics();
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -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");
|
||||
* 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 org.xml.sax.Attributes;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.ext.Locator2;
|
||||
import org.xml.sax.helpers.AttributesImpl;
|
||||
@@ -163,9 +164,11 @@ class StaxEventXMLReader extends AbstractStaxXMLReader {
|
||||
this.encoding = startDocument.getCharacterEncodingScheme();
|
||||
}
|
||||
}
|
||||
if (getContentHandler() != null) {
|
||||
|
||||
ContentHandler contentHandler = getContentHandler();
|
||||
if (contentHandler != null) {
|
||||
final Location location = event.getLocation();
|
||||
getContentHandler().setDocumentLocator(new Locator2() {
|
||||
contentHandler.setDocumentLocator(new Locator2() {
|
||||
@Override
|
||||
public int getColumnNumber() {
|
||||
return (location != null ? location.getColumnNumber() : -1);
|
||||
@@ -194,7 +197,7 @@ class StaxEventXMLReader extends AbstractStaxXMLReader {
|
||||
return encoding;
|
||||
}
|
||||
});
|
||||
getContentHandler().startDocument();
|
||||
contentHandler.startDocument();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -23,6 +23,7 @@ import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamReader;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.ContentHandler;
|
||||
import org.xml.sax.SAXException;
|
||||
import org.xml.sax.ext.Locator2;
|
||||
import org.xml.sax.helpers.AttributesImpl;
|
||||
@@ -139,9 +140,11 @@ class StaxStreamXMLReader extends AbstractStaxXMLReader {
|
||||
}
|
||||
this.encoding = this.reader.getCharacterEncodingScheme();
|
||||
}
|
||||
if (getContentHandler() != null) {
|
||||
|
||||
ContentHandler contentHandler = getContentHandler();
|
||||
if (contentHandler != null) {
|
||||
final Location location = this.reader.getLocation();
|
||||
getContentHandler().setDocumentLocator(new Locator2() {
|
||||
contentHandler.setDocumentLocator(new Locator2() {
|
||||
@Override
|
||||
public int getColumnNumber() {
|
||||
return (location != null ? location.getColumnNumber() : -1);
|
||||
@@ -170,7 +173,7 @@ class StaxStreamXMLReader extends AbstractStaxXMLReader {
|
||||
return encoding;
|
||||
}
|
||||
});
|
||||
getContentHandler().startDocument();
|
||||
contentHandler.startDocument();
|
||||
if (this.reader.standaloneSet()) {
|
||||
setStandalone(this.reader.isStandalone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user