Polish
This commit is contained in:
committed by
Juergen Hoeller
parent
1c24dc1f27
commit
625e210676
@@ -63,7 +63,7 @@ public interface StompSession {
|
||||
* {@link StompHeaders} instead of just a destination. The headers must
|
||||
* contain a destination and may also have other headers such as
|
||||
* "content-type" or custom headers for the broker to propagate to
|
||||
* subscribers, or broker-specific, non-standard headers..
|
||||
* subscribers, or broker-specific, non-standard headers.
|
||||
* @param headers the message headers
|
||||
* @param payload the message payload
|
||||
* @return a Receiptable for tracking receipts
|
||||
|
||||
@@ -1678,7 +1678,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
|
||||
|
||||
/**
|
||||
* Return a {@code HttpHeaders} object that can only be read, not written to.
|
||||
* Return an {@code HttpHeaders} object that can only be read, not written to.
|
||||
*/
|
||||
public static HttpHeaders readOnlyHttpHeaders(HttpHeaders headers) {
|
||||
Assert.notNull(headers, "HttpHeaders must not be null");
|
||||
@@ -1691,7 +1691,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@code HttpHeaders} object that can be read and written to.
|
||||
* Return an {@code HttpHeaders} object that can be read and written to.
|
||||
* @since 5.1.1
|
||||
*/
|
||||
public static HttpHeaders writableHttpHeaders(HttpHeaders headers) {
|
||||
|
||||
@@ -301,11 +301,12 @@ public class HttpWebHandlerAdapter extends WebHandlerDecorator implements HttpHa
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isDisconnectedClientError(Throwable ex) {
|
||||
private boolean isDisconnectedClientError(Throwable ex) {
|
||||
String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage();
|
||||
message = (message != null ? message.toLowerCase() : "");
|
||||
String className = ex.getClass().getSimpleName();
|
||||
return (message.contains("broken pipe") || DISCONNECTED_CLIENT_EXCEPTIONS.contains(className));
|
||||
if (message != null && message.toLowerCase().contains("broken pipe")) {
|
||||
return true;
|
||||
}
|
||||
return DISCONNECTED_CLIENT_EXCEPTIONS.contains(ex.getClass().getSimpleName());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -217,7 +217,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
||||
private String formatMappings(Class<?> userType, Map<Method, T> methods) {
|
||||
String formattedType = Arrays.stream(ClassUtils.getPackageName(userType).split("\\."))
|
||||
.map(p -> p.substring(0, 1))
|
||||
.collect(Collectors.joining(".", "", ".")) + userType.getSimpleName();
|
||||
.collect(Collectors.joining(".", "", "." + userType.getSimpleName()));
|
||||
Function<Method, String> methodFormatter = method -> Arrays.stream(method.getParameterTypes())
|
||||
.map(Class::getSimpleName)
|
||||
.collect(Collectors.joining(",", "(", ")"));
|
||||
@@ -249,16 +249,11 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
||||
* @return the created HandlerMethod
|
||||
*/
|
||||
protected HandlerMethod createHandlerMethod(Object handler, Method method) {
|
||||
HandlerMethod handlerMethod;
|
||||
if (handler instanceof String) {
|
||||
String beanName = (String) handler;
|
||||
handlerMethod = new HandlerMethod(beanName,
|
||||
return new HandlerMethod((String) handler,
|
||||
obtainApplicationContext().getAutowireCapableBeanFactory(), method);
|
||||
}
|
||||
else {
|
||||
handlerMethod = new HandlerMethod(handler, method);
|
||||
}
|
||||
return handlerMethod;
|
||||
return new HandlerMethod(handler, method);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -287,7 +287,7 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
||||
private String formatMappings(Class<?> userType, Map<Method, T> methods) {
|
||||
String formattedType = Arrays.stream(ClassUtils.getPackageName(userType).split("\\."))
|
||||
.map(p -> p.substring(0, 1))
|
||||
.collect(Collectors.joining(".", "", ".")) + userType.getSimpleName();
|
||||
.collect(Collectors.joining(".", "", "." + userType.getSimpleName()));
|
||||
Function<Method, String> methodFormatter = method -> Arrays.stream(method.getParameterTypes())
|
||||
.map(Class::getSimpleName)
|
||||
.collect(Collectors.joining(",", "(", ")"));
|
||||
@@ -319,16 +319,11 @@ public abstract class AbstractHandlerMethodMapping<T> extends AbstractHandlerMap
|
||||
* @return the created HandlerMethod
|
||||
*/
|
||||
protected HandlerMethod createHandlerMethod(Object handler, Method method) {
|
||||
HandlerMethod handlerMethod;
|
||||
if (handler instanceof String) {
|
||||
String beanName = (String) handler;
|
||||
handlerMethod = new HandlerMethod(beanName,
|
||||
return new HandlerMethod((String) handler,
|
||||
obtainApplicationContext().getAutowireCapableBeanFactory(), method);
|
||||
}
|
||||
else {
|
||||
handlerMethod = new HandlerMethod(handler, method);
|
||||
}
|
||||
return handlerMethod;
|
||||
return new HandlerMethod(handler, method);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user