Browse Source

Polishing

pull/1290/head
Juergen Hoeller 9 years ago
parent
commit
9cb4de8b5e
  1. 8
      spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java
  2. 2
      spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java
  3. 24
      spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java
  4. 12
      spring-web/src/main/java/org/springframework/web/client/RestOperations.java
  5. 2
      spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java

8
spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java vendored

@ -254,16 +254,16 @@ public abstract class AbstractPropertyResolver implements ConfigurablePropertyRe @@ -254,16 +254,16 @@ public abstract class AbstractPropertyResolver implements ConfigurablePropertyRe
if (targetType == null) {
return (T) value;
}
ConversionService csToUse = this.conversionService;
if (csToUse == null) {
ConversionService conversionServiceToUse = this.conversionService;
if (conversionServiceToUse == null) {
// Avoid initialization of shared DefaultConversionService if
// no standard type conversion is needed in the first place...
if (ClassUtils.isAssignableValue(targetType, value)) {
return (T) value;
}
csToUse = DefaultConversionService.getSharedInstance();
conversionServiceToUse = DefaultConversionService.getSharedInstance();
}
return csToUse.convert(value, targetType);
return conversionServiceToUse.convert(value, targetType);
}

2
spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java

@ -251,7 +251,7 @@ public class SQLErrorCodesFactory { @@ -251,7 +251,7 @@ public class SQLErrorCodesFactory {
/**
* Clear the cache for the specified {@link DataSource}, if registered.
* @param dataSource the {@code DataSource} identifying the database
* @return the corresponding {@code SQLErrorCodes} object,
* @return the corresponding {@code SQLErrorCodes} object that got removed,
* or {@code null} if not registered
* @since 4.3.5
* @see #registerDatabase(DataSource, String)

24
spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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,27 +23,27 @@ import com.thoughtworks.xstream.io.HierarchicalStreamReader; @@ -23,27 +23,27 @@ import com.thoughtworks.xstream.io.HierarchicalStreamReader;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
/**
* XStream {@link Converter} that supports all classes but throws exceptions
* for (un)marshalling.
* XStream {@link Converter} that supports all classes, but throws exceptions for
* (un)marshalling.
*
* <p>Main purpose of this class is to
* {@linkplain com.thoughtworks.xstream.XStream#registerConverter(Converter, int) register}
* this converter as a catch-all converter with a
* <p>The main purpose of this class is to
* {@linkplain com.thoughtworks.xstream.XStream#registerConverter(com.thoughtworks.xstream.converters.Converter, int) register}
* this converter as a catch-all last converter with a
* {@linkplain com.thoughtworks.xstream.XStream#PRIORITY_NORMAL normal}
* or higher priority, in addition to converters that explicitly support the domain
* classes that should be supported. As a result, default XStream converters with lower
* priorities and possible security vulnerabilities do not get invoked.
* or higher priority, in addition to converters that explicitly handle the domain
* classes that should be supported. As a result, default XStream converters with
* lower priorities and possible security vulnerabilities do not get invoked.
*
* <p>For instance:</p>
* <p>For instance:
* <pre class="code">
* XStreamMarshaller unmarshaller = new XStreamMarshaller();
* unmarshaller.getXStream().registerConverter(new MyDomainClassConverter(), XStream.PRIORITY_VERY_HIGH);
* unmarshaller.getXStream().registerConverter(new CatchAllConverter(), XStream.PRIORITY_NORMAL);
* MyDomainClass o = unmarshaller.unmarshal(source);
* MyDomainClass myObject = unmarshaller.unmarshal(source);
* </pre
*
* @author Arjen Poutsma
* @since 4.0
* @since 3.2.5
*/
public class CatchAllConverter implements Converter {

12
spring-web/src/main/java/org/springframework/web/client/RestOperations.java

@ -310,12 +310,12 @@ public interface RestOperations { @@ -310,12 +310,12 @@ public interface RestOperations {
/**
* Update a resource by PATCHing the given object to the URI template,
* and returns the representation found in the response.
* and return the representation found in the response.
* <p>URI Template variables are expanded using the given URI variables, if any.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request.
* @param url the URL
* @param request the Object to be PATCHed (may be {@code null})
* @param request the object to be PATCHed (may be {@code null})
* @param responseType the type of the return value
* @param uriVariables the variables to expand the template
* @return the converted object
@ -327,12 +327,12 @@ public interface RestOperations { @@ -327,12 +327,12 @@ public interface RestOperations {
/**
* Update a resource by PATCHing the given object to the URI template,
* and returns the representation found in the response.
* and return the representation found in the response.
* <p>URI Template variables are expanded using the given map.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request.
* @param url the URL
* @param request the Object to be PATCHed (may be {@code null})
* @param request the object to be PATCHed (may be {@code null})
* @param responseType the type of the return value
* @param uriVariables the variables to expand the template
* @return the converted object
@ -344,11 +344,11 @@ public interface RestOperations { @@ -344,11 +344,11 @@ public interface RestOperations {
/**
* Update a resource by PATCHing the given object to the URL,
* and returns the representation found in the response.
* and return the representation found in the response.
* <p>The {@code request} parameter can be a {@link HttpEntity} in order to
* add additional HTTP headers to the request.
* @param url the URL
* @param request the Object to be PATCHed (may be {@code null})
* @param request the object to be PATCHed (may be {@code null})
* @param responseType the type of the return value
* @return the converted object
* @since 4.3.5

2
spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java

@ -175,7 +175,6 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE @@ -175,7 +175,6 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
/**
* Configure a {@link StompEncoder} for encoding STOMP frames
* @param encoder the encoder
* @since 4.3.5
*/
public void setEncoder(StompEncoder encoder) {
@ -184,7 +183,6 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE @@ -184,7 +183,6 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
/**
* Configure a {@link StompDecoder} for decoding STOMP frames
* @param decoder the decoder
* @since 4.3.5
*/
public void setDecoder(StompDecoder decoder) {

Loading…
Cancel
Save