Polishing

This commit is contained in:
Juergen Hoeller 2017-09-27 01:46:16 +02:00
parent 9fdc4404a5
commit 5f167fd7f8
8 changed files with 31 additions and 27 deletions

View File

@ -89,14 +89,14 @@ public class KeyNamingStrategy implements ObjectNamingStrategy, InitializingBean
* containing object name mappings.
*/
public void setMappingLocation(Resource location) {
this.mappingLocations = new Resource[]{location};
this.mappingLocations = new Resource[] {location};
}
/**
* Set location of properties files to be loaded,
* containing object name mappings.
*/
public void setMappingLocations(Resource[] mappingLocations) {
public void setMappingLocations(Resource... mappingLocations) {
this.mappingLocations = mappingLocations;
}

View File

@ -106,10 +106,12 @@ public class ReflectiveMethodExecutor implements MethodExecutor {
public TypedValue execute(EvaluationContext context, Object target, Object... arguments) throws AccessException {
try {
if (arguments != null) {
this.argumentConversionOccurred = ReflectionHelper.convertArguments(context.getTypeConverter(), arguments, this.method, this.varargsPosition);
}
if (this.method.isVarArgs()) {
arguments = ReflectionHelper.setupArgumentsForVarargsInvocation(this.method.getParameterTypes(), arguments);
this.argumentConversionOccurred = ReflectionHelper.convertArguments(
context.getTypeConverter(), arguments, this.method, this.varargsPosition);
if (this.method.isVarArgs()) {
arguments = ReflectionHelper.setupArgumentsForVarargsInvocation(
this.method.getParameterTypes(), arguments);
}
}
ReflectionUtils.makeAccessible(this.method);
Object value = this.method.invoke(target, arguments);

View File

@ -96,13 +96,15 @@ class TransactionContext {
throw new IllegalStateException(
"Cannot start a new transaction without ending the existing transaction first.");
}
this.flaggedForRollback = this.defaultRollback;
this.transactionStatus = this.transactionManager.getTransaction(this.transactionDefinition);
++this.transactionsStarted;
if (logger.isInfoEnabled()) {
logger.info(String.format(
"Began transaction (%s) for test context %s; transaction manager [%s]; rollback [%s]",
this.transactionsStarted, this.testContext, this.transactionManager, flaggedForRollback));
"Began transaction (%s) for test context %s; transaction manager [%s]; rollback [%s]",
this.transactionsStarted, this.testContext, this.transactionManager, flaggedForRollback));
}
}

View File

@ -67,8 +67,8 @@ class InterceptingAsyncClientHttpRequest extends AbstractBufferingAsyncClientHtt
protected ListenableFuture<ClientHttpResponse> executeInternal(HttpHeaders headers, byte[] body)
throws IOException {
return new AsyncRequestExecution().executeAsync(this, body);
}
return new AsyncRequestExecution().executeAsync(this, body);
}
@Override
public HttpMethod getMethod() {

View File

@ -110,55 +110,55 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping
}
/**
* Returns the URL patterns of this {@link RequestMappingInfo};
* or instance with 0 patterns, never {@code null}.
* Return the URL patterns of this {@link RequestMappingInfo};
* or instance with 0 patterns (never {@code null}).
*/
public PatternsRequestCondition getPatternsCondition() {
return this.patternsCondition;
}
/**
* Returns the HTTP request methods of this {@link RequestMappingInfo};
* or instance with 0 request methods, never {@code null}.
* Return the HTTP request methods of this {@link RequestMappingInfo};
* or instance with 0 request methods (never {@code null}).
*/
public RequestMethodsRequestCondition getMethodsCondition() {
return this.methodsCondition;
}
/**
* Returns the "parameters" condition of this {@link RequestMappingInfo};
* or instance with 0 parameter expressions, never {@code null}.
* Return the "parameters" condition of this {@link RequestMappingInfo};
* or instance with 0 parameter expressions (never {@code null}).
*/
public ParamsRequestCondition getParamsCondition() {
return this.paramsCondition;
}
/**
* Returns the "headers" condition of this {@link RequestMappingInfo};
* or instance with 0 header expressions, never {@code null}.
* Return the "headers" condition of this {@link RequestMappingInfo};
* or instance with 0 header expressions (never {@code null}).
*/
public HeadersRequestCondition getHeadersCondition() {
return this.headersCondition;
}
/**
* Returns the "consumes" condition of this {@link RequestMappingInfo};
* or instance with 0 consumes expressions, never {@code null}.
* Return the "consumes" condition of this {@link RequestMappingInfo};
* or instance with 0 consumes expressions (never {@code null}).
*/
public ConsumesRequestCondition getConsumesCondition() {
return this.consumesCondition;
}
/**
* Returns the "produces" condition of this {@link RequestMappingInfo};
* or instance with 0 produces expressions, never {@code null}.
* Return the "produces" condition of this {@link RequestMappingInfo};
* or instance with 0 produces expressions (never {@code null}).
*/
public ProducesRequestCondition getProducesCondition() {
return this.producesCondition;
}
/**
* Returns the "custom" condition of this {@link RequestMappingInfo}; or {@code null}.
* Return the "custom" condition of this {@link RequestMappingInfo}, or {@code null}.
*/
public RequestCondition<?> getCustomCondition() {
return this.customConditionHolder.getCondition();
@ -166,7 +166,7 @@ public final class RequestMappingInfo implements RequestCondition<RequestMapping
/**
* Combines "this" request mapping info (i.e. the current instance) with another request mapping info instance.
* Combine "this" request mapping info (i.e. the current instance) with another request mapping info instance.
* <p>Example: combine type- and method-level request mappings.
* @return a new request mapping info instance; never {@code null}
*/

View File

@ -56,7 +56,7 @@ public class Param {
}
/**
* Return the raw parameter value
* Return the raw parameter value.
*/
public String getValue() {
return this.value;

View File

@ -231,7 +231,7 @@ public class UrlTag extends HtmlEscapingAwareTag implements ParamAware {
// HTML and/or JavaScript escape, if demanded.
urlStr = htmlEscape(urlStr);
urlStr = this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(urlStr) : urlStr;
urlStr = (this.javaScriptEscape ? JavaScriptUtils.javaScriptEscape(urlStr) : urlStr);
return urlStr;
}

View File

@ -34,11 +34,11 @@ import org.springframework.web.socket.server.support.WebSocketHttpRequestHandler
import org.springframework.web.socket.sockjs.SockJsService;
import org.springframework.web.socket.sockjs.support.SockJsHttpRequestHandler;
import org.springframework.web.socket.sockjs.transport.handler.WebSocketTransportHandler;
/**
* An abstract base class for configuring STOMP over WebSocket/SockJS endpoints.
*
* @author Rossen Stoyanchev
* @author Juergen Hoeller
* @since 4.0
*/
public class WebMvcStompWebSocketEndpointRegistration implements StompWebSocketEndpointRegistration {