From 9cb4de8b5eb375cf328b6283311cc2c0d961f4ce Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 20 Dec 2016 21:11:07 +0100 Subject: [PATCH] Polishing --- .../core/env/AbstractPropertyResolver.java | 8 +++---- .../jdbc/support/SQLErrorCodesFactory.java | 2 +- .../oxm/xstream/CatchAllConverter.java | 24 +++++++++---------- .../web/client/RestOperations.java | 12 +++++----- .../messaging/StompSubProtocolHandler.java | 2 -- 5 files changed, 23 insertions(+), 25 deletions(-) diff --git a/spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java b/spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java index 11c5ff7644d..3de43d0d925 100644 --- a/spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java +++ b/spring-core/src/main/java/org/springframework/core/env/AbstractPropertyResolver.java @@ -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); } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java index cd5c2ae68f1..49148fda93b 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java @@ -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) diff --git a/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java b/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java index ee799f973f2..d129529cc84 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java @@ -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; 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. * - *

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 + *

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. * - *

For instance:

+ *

For instance: *

  * 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);
  * 
URI Template variables are expanded using the given URI variables, if any. *

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 { /** * 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. *

URI Template variables are expanded using the given map. *

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 { /** * 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. *

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 diff --git a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java index e669201f18c..78603874e78 100644 --- a/spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java +++ b/spring-websocket/src/main/java/org/springframework/web/socket/messaging/StompSubProtocolHandler.java @@ -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 /** * Configure a {@link StompDecoder} for decoding STOMP frames - * @param decoder the decoder * @since 4.3.5 */ public void setDecoder(StompDecoder decoder) {