Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2019 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -154,7 +154,6 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
|
|||||||
@Override
|
@Override
|
||||||
@Nullable
|
@Nullable
|
||||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||||
MethodInvocation invocation;
|
|
||||||
Object oldProxy = null;
|
Object oldProxy = null;
|
||||||
boolean setProxyContext = false;
|
boolean setProxyContext = false;
|
||||||
|
|
||||||
@@ -207,7 +206,8 @@ final class JdkDynamicAopProxy implements AopProxy, InvocationHandler, Serializa
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// We need to create a method invocation...
|
// We need to create a method invocation...
|
||||||
invocation = new ReflectiveMethodInvocation(proxy, target, method, args, targetClass, chain);
|
MethodInvocation invocation =
|
||||||
|
new ReflectiveMethodInvocation(proxy, target, method, args, targetClass, chain);
|
||||||
// Proceed to the joinpoint through the interceptor chain.
|
// Proceed to the joinpoint through the interceptor chain.
|
||||||
retVal = invocation.proceed();
|
retVal = invocation.proceed();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -522,8 +522,7 @@ class TypeConverterDelegate {
|
|||||||
return original;
|
return original;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
for (int i = 0; it.hasNext(); i++) {
|
||||||
for (; it.hasNext(); i++) {
|
|
||||||
Object element = it.next();
|
Object element = it.next();
|
||||||
String indexedPropertyName = buildIndexedPropertyName(propertyName, i);
|
String indexedPropertyName = buildIndexedPropertyName(propertyName, i);
|
||||||
Object convertedElement = convertIfNecessary(indexedPropertyName, null, element,
|
Object convertedElement = convertIfNecessary(indexedPropertyName, null, element,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2019 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -21,7 +21,6 @@ import java.util.concurrent.Callable;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
@@ -60,7 +59,7 @@ public class DeferredResult<T> {
|
|||||||
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
private final Long timeout;
|
private final Long timeoutValue;
|
||||||
|
|
||||||
private final Supplier<?> timeoutResult;
|
private final Supplier<?> timeoutResult;
|
||||||
|
|
||||||
@@ -89,35 +88,36 @@ public class DeferredResult<T> {
|
|||||||
* <p>By default not set in which case the default configured in the MVC
|
* <p>By default not set in which case the default configured in the MVC
|
||||||
* Java Config or the MVC namespace is used, or if that's not set, then the
|
* Java Config or the MVC namespace is used, or if that's not set, then the
|
||||||
* timeout depends on the default of the underlying server.
|
* timeout depends on the default of the underlying server.
|
||||||
* @param timeout timeout value in milliseconds
|
* @param timeoutValue timeout value in milliseconds
|
||||||
*/
|
*/
|
||||||
public DeferredResult(Long timeout) {
|
public DeferredResult(Long timeoutValue) {
|
||||||
this(timeout, () -> RESULT_NONE);
|
this(timeoutValue, () -> RESULT_NONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a DeferredResult with a timeout value and a default result to use
|
* Create a DeferredResult with a timeout value and a default result to use
|
||||||
* in case of timeout.
|
* in case of timeout.
|
||||||
* @param timeout timeout value in milliseconds (ignored if {@code null})
|
* @param timeoutValue timeout value in milliseconds (ignored if {@code null})
|
||||||
* @param timeoutResult the result to use
|
* @param timeoutResult the result to use
|
||||||
*/
|
*/
|
||||||
public DeferredResult(@Nullable Long timeout, final Object timeoutResult) {
|
public DeferredResult(@Nullable Long timeoutValue, final Object timeoutResult) {
|
||||||
this.timeoutResult = () -> timeoutResult;
|
this.timeoutResult = () -> timeoutResult;
|
||||||
this.timeout = timeout;
|
this.timeoutValue = timeoutValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Variant of {@link #DeferredResult(Long, Object)} that accepts a dynamic
|
* Variant of {@link #DeferredResult(Long, Object)} that accepts a dynamic
|
||||||
* fallback value based on a {@link Supplier}.
|
* fallback value based on a {@link Supplier}.
|
||||||
* @param timeout timeout value in milliseconds (ignored if {@code null})
|
* @param timeoutValue timeout value in milliseconds (ignored if {@code null})
|
||||||
* @param timeoutResult the result supplier to use
|
* @param timeoutResult the result supplier to use
|
||||||
* @since 5.1.1
|
* @since 5.1.1
|
||||||
*/
|
*/
|
||||||
public DeferredResult(@Nullable Long timeout, Supplier<?> timeoutResult) {
|
public DeferredResult(@Nullable Long timeoutValue, Supplier<?> timeoutResult) {
|
||||||
this.timeoutResult = timeoutResult;
|
this.timeoutResult = timeoutResult;
|
||||||
this.timeout = timeout;
|
this.timeoutValue = timeoutValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return {@code true} if this DeferredResult is no longer usable either
|
* Return {@code true} if this DeferredResult is no longer usable either
|
||||||
* because it was previously set or because the underlying request expired.
|
* because it was previously set or because the underlying request expired.
|
||||||
@@ -155,7 +155,7 @@ public class DeferredResult<T> {
|
|||||||
*/
|
*/
|
||||||
@Nullable
|
@Nullable
|
||||||
final Long getTimeoutValue() {
|
final Long getTimeoutValue() {
|
||||||
return this.timeout;
|
return this.timeoutValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2002-2018 the original author or authors.
|
* Copyright 2002-2019 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -354,7 +354,7 @@ public abstract class AbstractSockJsService implements SockJsService, CorsConfig
|
|||||||
String requestInfo = (logger.isDebugEnabled() ? request.getMethod() + " " + request.getURI() : null);
|
String requestInfo = (logger.isDebugEnabled() ? request.getMethod() + " " + request.getURI() : null);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (sockJsPath.equals("") || sockJsPath.equals("/")) {
|
if (sockJsPath.isEmpty() || sockJsPath.equals("/")) {
|
||||||
if (requestInfo != null) {
|
if (requestInfo != null) {
|
||||||
logger.debug("Processing transport request: " + requestInfo);
|
logger.debug("Processing transport request: " + requestInfo);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user