Polishing

This commit is contained in:
Juergen Hoeller
2018-03-07 16:24:40 +01:00
parent c15f23bf0c
commit 346d0e271d
10 changed files with 116 additions and 147 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -156,8 +156,8 @@ public abstract class PropertyMatches {
if (s2.isEmpty()) {
return s1.length();
}
int[][] d = new int[s1.length() + 1][s2.length() + 1];
int[][] d = new int[s1.length() + 1][s2.length() + 1];
for (int i = 0; i <= s1.length(); i++) {
d[i][0] = i;
}
@@ -166,18 +166,17 @@ public abstract class PropertyMatches {
}
for (int i = 1; i <= s1.length(); i++) {
char s_i = s1.charAt(i - 1);
char c1 = s1.charAt(i - 1);
for (int j = 1; j <= s2.length(); j++) {
int cost;
char t_j = s2.charAt(j - 1);
if (s_i == t_j) {
char c2 = s2.charAt(j - 1);
if (c1 == c2) {
cost = 0;
}
else {
cost = 1;
}
d[i][j] = Math.min(Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1),
d[i - 1][j - 1] + cost);
d[i][j] = Math.min(Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1), d[i - 1][j - 1] + cost);
}
}
@@ -190,24 +189,23 @@ public abstract class PropertyMatches {
private static class BeanPropertyMatches extends PropertyMatches {
public BeanPropertyMatches(String propertyName, Class<?> beanClass, int maxDistance) {
super(propertyName, calculateMatches(propertyName,
BeanUtils.getPropertyDescriptors(beanClass), maxDistance));
super(propertyName,
calculateMatches(propertyName, BeanUtils.getPropertyDescriptors(beanClass), maxDistance));
}
/**
* Generate possible property alternatives for the given property and
* class. Internally uses the {@code getStringDistance} method, which
* in turn uses the Levenshtein algorithm to determine the distance between
* two Strings.
* @param propertyDescriptors the JavaBeans property descriptors to search
* Generate possible property alternatives for the given property and class.
* Internally uses the {@code getStringDistance} method, which in turn uses
* the Levenshtein algorithm to determine the distance between two Strings.
* @param descriptors the JavaBeans property descriptors to search
* @param maxDistance the maximum distance to accept
*/
private static String[] calculateMatches(String propertyName, PropertyDescriptor[] propertyDescriptors, int maxDistance) {
private static String[] calculateMatches(String name, PropertyDescriptor[] descriptors, int maxDistance) {
List<String> candidates = new ArrayList<String>();
for (PropertyDescriptor pd : propertyDescriptors) {
for (PropertyDescriptor pd : descriptors) {
if (pd.getWriteMethod() != null) {
String possibleAlternative = pd.getName();
if (calculateStringDistance(propertyName, possibleAlternative) <= maxDistance) {
if (calculateStringDistance(name, possibleAlternative) <= maxDistance) {
candidates.add(possibleAlternative);
}
}
@@ -216,21 +214,16 @@ public abstract class PropertyMatches {
return StringUtils.toStringArray(candidates);
}
@Override
public String buildErrorMessage() {
String propertyName = getPropertyName();
String[] possibleMatches = getPossibleMatches();
StringBuilder msg = new StringBuilder();
msg.append("Bean property '");
msg.append(propertyName);
msg.append("' is not writable or has an invalid setter method. ");
if (ObjectUtils.isEmpty(possibleMatches)) {
msg.append("Does the parameter type of the setter match the return type of the getter?");
StringBuilder msg = new StringBuilder(160);
msg.append("Bean property '").append(getPropertyName()).append(
"' is not writable or has an invalid setter method. ");
if (!ObjectUtils.isEmpty(getPossibleMatches())) {
appendHintMessage(msg);
}
else {
appendHintMessage(msg);
msg.append("Does the parameter type of the setter match the return type of the getter?");
}
return msg.toString();
}
@@ -243,13 +236,13 @@ public abstract class PropertyMatches {
super(propertyName, calculateMatches(propertyName, beanClass, maxDistance));
}
private static String[] calculateMatches(final String propertyName, Class<?> beanClass, final int maxDistance) {
private static String[] calculateMatches(final String name, Class<?> clazz, final int maxDistance) {
final List<String> candidates = new ArrayList<String>();
ReflectionUtils.doWithFields(beanClass, new ReflectionUtils.FieldCallback() {
ReflectionUtils.doWithFields(clazz, new ReflectionUtils.FieldCallback() {
@Override
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
String possibleAlternative = field.getName();
if (calculateStringDistance(propertyName, possibleAlternative) <= maxDistance) {
if (calculateStringDistance(name, possibleAlternative) <= maxDistance) {
candidates.add(possibleAlternative);
}
}
@@ -260,14 +253,10 @@ public abstract class PropertyMatches {
@Override
public String buildErrorMessage() {
String propertyName = getPropertyName();
String[] possibleMatches = getPossibleMatches();
StringBuilder msg = new StringBuilder();
msg.append("Bean property '");
msg.append(propertyName);
msg.append("' has no matching field. ");
if (!ObjectUtils.isEmpty(possibleMatches)) {
StringBuilder msg = new StringBuilder(80);
msg.append("Bean property '").append(getPropertyName()).append("' has no matching field.");
if (!ObjectUtils.isEmpty(getPossibleMatches())) {
msg.append(' ');
appendHintMessage(msg);
}
return msg.toString();

View File

@@ -22,17 +22,16 @@
<xsd:complexType>
<xsd:annotation>
<xsd:documentation source="java:org.springframework.cache.annotation.AnnotationCacheOperationDefinitionSource"><![CDATA[
Indicates that cache configuration is defined by Java 5
annotations on bean classes, and that proxies are automatically
to be created for the relevant annotated beans.
Indicates that cache configuration is defined by annotations on bean classes,
and that proxies are automatically to be created for the relevant annotated beans.
The default annotations supported are Spring's @Cacheable, @CachePut and @CacheEvict. If
spring-context-support and the JSR-107 API are on the classpath, additional proxies are
automatically created for JSR-107 annotated beans, that is @CacheResult, @CachePut,
The default annotations supported are Spring's @Cacheable, @CachePut and @CacheEvict.
If spring-context-support and the JSR-107 API are on the classpath, additional proxies
are automatically created for JSR-107 annotated beans, that is @CacheResult, @CachePut,
@CacheRemove and @CacheRemoveAll.
See org.springframework.cache.annotation.EnableCaching Javadoc
for information on code-based alternatives to this XML element.
See org.springframework.cache.annotation.EnableCaching javadoc for information on
code-based alternatives to this XML element.
]]></xsd:documentation>
</xsd:annotation>
<xsd:attribute name="cache-manager" type="xsd:string" default="cacheManager">
@@ -148,8 +147,7 @@
<xsd:complexType>
<xsd:annotation>
<xsd:documentation source="java:org.springframework.cache.interceptor.CacheInterceptor"><![CDATA[
Defines the cache semantics of the AOP advice that is to be
executed.
Defines the cache semantics of the AOP advice that is to be executed.
That is, this advice element is where the cacheable semantics of
any number of methods are defined (where cacheable semantics
@@ -243,7 +241,6 @@
example, 'get*', 'handle*', '*Order', 'on*Event', etc.]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="definitionsType">
@@ -296,7 +293,6 @@
invoked (default) or before.]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

View File

@@ -22,17 +22,16 @@
<xsd:complexType>
<xsd:annotation>
<xsd:documentation source="java:org.springframework.cache.annotation.AnnotationCacheOperationDefinitionSource"><![CDATA[
Indicates that cache configuration is defined by Java 5
annotations on bean classes, and that proxies are automatically
to be created for the relevant annotated beans.
Indicates that cache configuration is defined by annotations on bean classes,
and that proxies are automatically to be created for the relevant annotated beans.
The default annotations supported are Spring's @Cacheable, @CachePut and @CacheEvict. If
spring-context-support and the JSR-107 API are on the classpath, additional proxies are
automatically created for JSR-107 annotated beans, that is @CacheResult, @CachePut,
The default annotations supported are Spring's @Cacheable, @CachePut and @CacheEvict.
If spring-context-support and the JSR-107 API are on the classpath, additional proxies
are automatically created for JSR-107 annotated beans, that is @CacheResult, @CachePut,
@CacheRemove and @CacheRemoveAll.
See org.springframework.cache.annotation.EnableCaching Javadoc
for information on code-based alternatives to this XML element.
See org.springframework.cache.annotation.EnableCaching javadoc for information on
code-based alternatives to this XML element.
]]></xsd:documentation>
</xsd:annotation>
<xsd:attribute name="cache-manager" type="xsd:string" default="cacheManager">
@@ -148,8 +147,7 @@
<xsd:complexType>
<xsd:annotation>
<xsd:documentation source="java:org.springframework.cache.interceptor.CacheInterceptor"><![CDATA[
Defines the cache semantics of the AOP advice that is to be
executed.
Defines the cache semantics of the AOP advice that is to be executed.
That is, this advice element is where the cacheable semantics of
any number of methods are defined (where cacheable semantics
@@ -243,7 +241,6 @@
example, 'get*', 'handle*', '*Order', 'on*Event', etc.]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="definitionsType">
@@ -296,7 +293,6 @@
invoked (default) or before.]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

View File

@@ -22,17 +22,16 @@
<xsd:complexType>
<xsd:annotation>
<xsd:documentation source="java:org.springframework.cache.annotation.AnnotationCacheOperationDefinitionSource"><![CDATA[
Indicates that cache configuration is defined by Java 5
annotations on bean classes, and that proxies are automatically
to be created for the relevant annotated beans.
Indicates that cache configuration is defined by annotations on bean classes,
and that proxies are automatically to be created for the relevant annotated beans.
The default annotations supported are Spring's @Cacheable, @CachePut and @CacheEvict. If
spring-context-support and the JSR-107 API are on the classpath, additional proxies are
automatically created for JSR-107 annotated beans, that is @CacheResult, @CachePut,
The default annotations supported are Spring's @Cacheable, @CachePut and @CacheEvict.
If spring-context-support and the JSR-107 API are on the classpath, additional proxies
are automatically created for JSR-107 annotated beans, that is @CacheResult, @CachePut,
@CacheRemove and @CacheRemoveAll.
See org.springframework.cache.annotation.EnableCaching Javadoc
for information on code-based alternatives to this XML element.
See org.springframework.cache.annotation.EnableCaching javadoc for information on
code-based alternatives to this XML element.
]]></xsd:documentation>
</xsd:annotation>
<xsd:attribute name="cache-manager" type="xsd:string" default="cacheManager">
@@ -148,8 +147,7 @@
<xsd:complexType>
<xsd:annotation>
<xsd:documentation source="java:org.springframework.cache.interceptor.CacheInterceptor"><![CDATA[
Defines the cache semantics of the AOP advice that is to be
executed.
Defines the cache semantics of the AOP advice that is to be executed.
That is, this advice element is where the cacheable semantics of
any number of methods are defined (where cacheable semantics
@@ -243,7 +241,6 @@
example, 'get*', 'handle*', '*Order', 'on*Event', etc.]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
<xsd:complexType name="definitionsType">
@@ -303,7 +300,6 @@
invoked (default) or before.]]></xsd:documentation>
</xsd:annotation>
</xsd:attribute>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>

View File

@@ -20,12 +20,12 @@
<xsd:element name="annotation-driven">
<xsd:annotation>
<xsd:documentation><![CDATA[
Enables the detection of @JmsListener annotation on any Spring-managed object. If
present, a message listener container will be created to receive the relevant
Enables the detection of @JmsListener annotation on any Spring-managed object.
If present, a message listener container will be created to receive the relevant
messages and invoke the annotated method accordingly.
See Javadoc for the org.springframework.jms.annotation.EnableJms annotation for
information on code-based alternatives to this XML element.
See org.springframework.jms.annotation.EnableJms javadoc for information on
code-based alternatives to this XML element.
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -68,7 +68,7 @@
processor. By default, DefaultMessageHandlerMethodFactory is used and it can be configured
further to support additional method arguments or to customize conversion and validation
support. See org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory
Javadoc for more details.
javadoc for more details.
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
@@ -77,8 +77,6 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
@@ -180,7 +178,7 @@
A reference to the DestinationResolver strategy for resolving destination names.
Default is a DynamicDestinationResolver, using the JMS provider's queue/topic
name resolution. Alternatively, specify a reference to a JndiDestinationResolver
(typically in a J2EE environment).
(typically in a Java EE environment).
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
@@ -248,7 +246,7 @@
The cache level for JMS resources: "none", "connection", "session", "consumer"
or "auto". By default ("auto"), the cache level will effectively be "consumer",
unless an external transaction manager has been specified - in which case the
effective default will be "none" (assuming J2EE-style transaction management
effective default will be "none" (assuming Java EE-style transaction management
where the given ConnectionFactory is an XA-aware pool).
]]></xsd:documentation>
</xsd:annotation>
@@ -364,14 +362,13 @@
<xsd:element name="jca-listener-container">
<xsd:annotation>
<xsd:documentation><![CDATA[
Each listener child element will be hosted by a container whose configuration
is determined by this parent element. This variant builds standard JCA-based
listener containers, operating against a specified JCA ResourceAdapter
(which needs to be provided by the JMS message broker, e.g. ActiveMQ). When
a factory-id attribute is present, the configuration defined by this element is
exposed as a org.springframework.jms.config.JmsListenerContainerFactory. It is
therefore possible to only define this element without any child to just expose
a container factory.
Each listener child element will be hosted by a container whose configuration is
determined by this parent element. This variant builds standard JCA-based listener
containers, operating against a specified JCA ResourceAdapter (which needs to be
provided by the JMS message broker, e.g. ActiveMQ). When a factory-id attribute is
present, the configuration defined by this element is exposed as a bean of type
org.springframework.jms.config.JmsListenerContainerFactory. It is therefore possible
to only define this element without any child to just expose a container factory.
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation>
@@ -386,7 +383,8 @@
<xsd:attribute name="factory-id" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Expose the settings defined by this element as a org.springframework.jms.config.JmsListenerContainerFactory
Expose the settings defined by this element as a bean of type
org.springframework.jms.config.JmsListenerContainerFactory
so that they can be reused with other endpoints.
]]></xsd:documentation>
</xsd:annotation>
@@ -423,7 +421,7 @@
<xsd:documentation><![CDATA[
A reference to the DestinationResolver strategy for resolving destination names.
Default is to pass in the destination name Strings into the JCA ActivationSpec as-is.
Alternatively, specify a reference to a JndiDestinationResolver (typically in a J2EE
Alternatively, specify a reference to a JndiDestinationResolver (typically in a Java EE
environment, in particular if the server insists on receiving Destination objects).
]]></xsd:documentation>
<xsd:appinfo>
@@ -588,7 +586,7 @@
The name of the default response destination to send response messages to.
This will be applied in case of a request message that does not carry
a "JMSReplyTo" field. The type of this destination will be determined
by the listener-container's "destination-type" attribute.
by the listener-container's "response-destination-type" attribute.
Note: This only applies to a listener method with a return value,
for which each result object will be converted into a response message.
]]></xsd:documentation>

View File

@@ -20,12 +20,12 @@
<xsd:element name="annotation-driven">
<xsd:annotation>
<xsd:documentation><![CDATA[
Enables the detection of @JmsListener annotation on any Spring-managed object. If
present, a message listener container will be created to receive the relevant
Enables the detection of @JmsListener annotation on any Spring-managed object.
If present, a message listener container will be created to receive the relevant
messages and invoke the annotated method accordingly.
See Javadoc for the org.springframework.jms.annotation.EnableJms annotation for
information on code-based alternatives to this XML element.
See org.springframework.jms.annotation.EnableJms javadoc for information on
code-based alternatives to this XML element.
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -68,7 +68,7 @@
processor. By default, DefaultMessageHandlerMethodFactory is used and it can be configured
further to support additional method arguments or to customize conversion and validation
support. See org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory
Javadoc for more details.
javadoc for more details.
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
@@ -77,8 +77,6 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
@@ -180,7 +178,7 @@
A reference to the DestinationResolver strategy for resolving destination names.
Default is a DynamicDestinationResolver, using the JMS provider's queue/topic
name resolution. Alternatively, specify a reference to a JndiDestinationResolver
(typically in a J2EE environment).
(typically in a Java EE environment).
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
@@ -262,7 +260,7 @@
The cache level for JMS resources: "none", "connection", "session", "consumer"
or "auto". By default ("auto"), the cache level will effectively be "consumer",
unless an external transaction manager has been specified - in which case the
effective default will be "none" (assuming J2EE-style transaction management
effective default will be "none" (assuming Java EE-style transaction management
where the given ConnectionFactory is an XA-aware pool).
]]></xsd:documentation>
</xsd:annotation>
@@ -378,14 +376,13 @@
<xsd:element name="jca-listener-container">
<xsd:annotation>
<xsd:documentation><![CDATA[
Each listener child element will be hosted by a container whose configuration
is determined by this parent element. This variant builds standard JCA-based
listener containers, operating against a specified JCA ResourceAdapter
(which needs to be provided by the JMS message broker, e.g. ActiveMQ). When
a factory-id attribute is present, the configuration defined by this element is
exposed as a org.springframework.jms.config.JmsListenerContainerFactory. It is
therefore possible to only define this element without any child to just expose
a container factory.
Each listener child element will be hosted by a container whose configuration is
determined by this parent element. This variant builds standard JCA-based listener
containers, operating against a specified JCA ResourceAdapter (which needs to be
provided by the JMS message broker, e.g. ActiveMQ). When a factory-id attribute is
present, the configuration defined by this element is exposed as a bean of type
org.springframework.jms.config.JmsListenerContainerFactory. It is therefore possible
to only define this element without any child to just expose a container factory.
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation>
@@ -400,7 +397,8 @@
<xsd:attribute name="factory-id" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Expose the settings defined by this element as a org.springframework.jms.config.JmsListenerContainerFactory
Expose the settings defined by this element as a bean of type
org.springframework.jms.config.JmsListenerContainerFactory
so that they can be reused with other endpoints.
]]></xsd:documentation>
</xsd:annotation>
@@ -437,7 +435,7 @@
<xsd:documentation><![CDATA[
A reference to the DestinationResolver strategy for resolving destination names.
Default is to pass in the destination name Strings into the JCA ActivationSpec as-is.
Alternatively, specify a reference to a JndiDestinationResolver (typically in a J2EE
Alternatively, specify a reference to a JndiDestinationResolver (typically in a Java EE
environment, in particular if the server insists on receiving Destination objects).
]]></xsd:documentation>
<xsd:appinfo>
@@ -478,8 +476,8 @@
<xsd:attribute name="response-destination-type" default="queue">
<xsd:annotation>
<xsd:documentation><![CDATA[
The JMS destination type for responses: "queue", "topic". Default
is the value of the "destination-type" attribute.
The JMS destination type for responses: "queue", "topic".
Default is the value of the "destination-type" attribute.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>

View File

@@ -20,12 +20,12 @@
<xsd:element name="annotation-driven">
<xsd:annotation>
<xsd:documentation><![CDATA[
Enables the detection of @JmsListener annotation on any Spring-managed object. If
present, a message listener container will be created to receive the relevant
Enables the detection of @JmsListener annotation on any Spring-managed object.
If present, a message listener container will be created to receive the relevant
messages and invoke the annotated method accordingly.
See Javadoc for the org.springframework.jms.annotation.EnableJms annotation for
information on code-based alternatives to this XML element.
See org.springframework.jms.annotation.EnableJms javadoc for information on
code-based alternatives to this XML element.
]]></xsd:documentation>
</xsd:annotation>
<xsd:complexType>
@@ -68,7 +68,7 @@
processor. By default, DefaultMessageHandlerMethodFactory is used and it can be configured
further to support additional method arguments or to customize conversion and validation
support. See org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory
Javadoc for more details.
javadoc for more details.
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
@@ -77,8 +77,6 @@
</xsd:appinfo>
</xsd:annotation>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
@@ -180,7 +178,7 @@
A reference to the DestinationResolver strategy for resolving destination names.
Default is a DynamicDestinationResolver, using the JMS provider's queue/topic
name resolution. Alternatively, specify a reference to a JndiDestinationResolver
(typically in a J2EE environment).
(typically in a Java EE environment).
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation kind="ref">
@@ -262,7 +260,7 @@
The cache level for JMS resources: "none", "connection", "session", "consumer"
or "auto". By default ("auto"), the cache level will effectively be "consumer",
unless an external transaction manager has been specified - in which case the
effective default will be "none" (assuming J2EE-style transaction management
effective default will be "none" (assuming Java EE-style transaction management
where the given ConnectionFactory is an XA-aware pool).
]]></xsd:documentation>
</xsd:annotation>
@@ -378,14 +376,13 @@
<xsd:element name="jca-listener-container">
<xsd:annotation>
<xsd:documentation><![CDATA[
Each listener child element will be hosted by a container whose configuration
is determined by this parent element. This variant builds standard JCA-based
listener containers, operating against a specified JCA ResourceAdapter
(which needs to be provided by the JMS message broker, e.g. ActiveMQ). When
a factory-id attribute is present, the configuration defined by this element is
exposed as a org.springframework.jms.config.JmsListenerContainerFactory. It is
therefore possible to only define this element without any child to just expose
a container factory.
Each listener child element will be hosted by a container whose configuration is
determined by this parent element. This variant builds standard JCA-based listener
containers, operating against a specified JCA ResourceAdapter (which needs to be
provided by the JMS message broker, e.g. ActiveMQ). When a factory-id attribute is
present, the configuration defined by this element is exposed as a bean of type
org.springframework.jms.config.JmsListenerContainerFactory. It is therefore possible
to only define this element without any child to just expose a container factory.
]]></xsd:documentation>
<xsd:appinfo>
<tool:annotation>
@@ -400,7 +397,8 @@
<xsd:attribute name="factory-id" type="xsd:string">
<xsd:annotation>
<xsd:documentation><![CDATA[
Expose the settings defined by this element as a org.springframework.jms.config.JmsListenerContainerFactory
Expose the settings defined by this element as a bean of type
org.springframework.jms.config.JmsListenerContainerFactory
so that they can be reused with other endpoints.
]]></xsd:documentation>
</xsd:annotation>
@@ -437,7 +435,7 @@
<xsd:documentation><![CDATA[
A reference to the DestinationResolver strategy for resolving destination names.
Default is to pass in the destination name Strings into the JCA ActivationSpec as-is.
Alternatively, specify a reference to a JndiDestinationResolver (typically in a J2EE
Alternatively, specify a reference to a JndiDestinationResolver (typically in a Java EE
environment, in particular if the server insists on receiving Destination objects).
]]></xsd:documentation>
<xsd:appinfo>
@@ -478,8 +476,8 @@
<xsd:attribute name="response-destination-type" default="queue">
<xsd:annotation>
<xsd:documentation><![CDATA[
The JMS destination type for responses: "queue", "topic". Default
is the value of the "destination-type" attribute.
The JMS destination type for responses: "queue", "topic".
Default is the value of the "destination-type" attribute.
]]></xsd:documentation>
</xsd:annotation>
<xsd:simpleType>

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -775,7 +775,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
* by the {@code Date} header.
* <p>The date is returned as the number of milliseconds since
* January 1, 1970 GMT. Returns -1 when the date is unknown.
* @throws IllegalArgumentException if the value can't be converted to a date
* @throws IllegalArgumentException if the value cannot be converted to a date
*/
public long getDate() {
return getFirstDate(DATE);

View File

@@ -70,18 +70,18 @@ public class GsonHttpMessageConverter extends AbstractGenericHttpMessageConverte
*/
public GsonHttpMessageConverter() {
super(MediaType.APPLICATION_JSON, new MediaType("application", "*+json"));
this.setDefaultCharset(DEFAULT_CHARSET);
setDefaultCharset(DEFAULT_CHARSET);
}
/**
* Set the {@code Gson} instance to use.
* If not set, a default {@link Gson#Gson() Gson} instance is used.
* If not set, a default {@link Gson#Gson() Gson} instance will be used.
* <p>Setting a custom-configured {@code Gson} is one way to take further
* control of the JSON serialization process.
*/
public void setGson(Gson gson) {
Assert.notNull(gson, "'gson' is required");
Assert.notNull(gson, "A Gson instance is required");
this.gson = gson;
}

View File

@@ -24,7 +24,6 @@ import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
@@ -155,7 +154,7 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
HttpServletRequest request, Map<String, String> uriVariables) {
Map<String, MultiValueMap<String, String>> result = new LinkedHashMap<String, MultiValueMap<String, String>>();
for (Entry<String, String> uriVar : uriVariables.entrySet()) {
for (Map.Entry<String, String> uriVar : uriVariables.entrySet()) {
String uriVarValue = uriVar.getValue();
int equalsIndex = uriVarValue.indexOf('=');
@@ -189,11 +188,10 @@ public abstract class RequestMappingInfoHandlerMapping extends AbstractHandlerMe
* but not by consumable/producible media types
*/
@Override
protected HandlerMethod handleNoMatch(Set<RequestMappingInfo> infos, String lookupPath,
HttpServletRequest request) throws ServletException {
protected HandlerMethod handleNoMatch(
Set<RequestMappingInfo> infos, String lookupPath, HttpServletRequest request) throws ServletException {
PartialMatchHelper helper = new PartialMatchHelper(infos, request);
if (helper.isEmpty()) {
return null;
}