Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -149,8 +149,9 @@ public abstract class AbstractNamedValueMethodArgumentResolver implements Handle
|
||||
if (info.name.isEmpty()) {
|
||||
name = parameter.getParameterName();
|
||||
if (name == null) {
|
||||
throw new IllegalArgumentException("Name for argument type [" + parameter.getParameterType().getName() +
|
||||
"] not available, and parameter name information not found in class file either.");
|
||||
throw new IllegalArgumentException(
|
||||
"Name for argument of type [" + parameter.getNestedParameterType().getName() +
|
||||
"] not specified, and parameter name information not found in class file either.");
|
||||
}
|
||||
}
|
||||
String defaultValue = (ValueConstants.DEFAULT_NONE.equals(info.defaultValue) ? null : info.defaultValue);
|
||||
|
||||
@@ -111,7 +111,7 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
|
||||
private final Map<String, ReceiptHandler> receiptHandlers = new ConcurrentHashMap<>(4);
|
||||
|
||||
/* Whether the client is willfully closing the connection */
|
||||
private volatile boolean closing = false;
|
||||
private volatile boolean closing;
|
||||
|
||||
|
||||
/**
|
||||
@@ -256,7 +256,7 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
|
||||
private Message<byte[]> createMessage(StompHeaderAccessor accessor, @Nullable Object payload) {
|
||||
accessor.updateSimpMessageHeadersFromStompHeaders();
|
||||
Message<byte[]> message;
|
||||
if (isEmpty(payload)) {
|
||||
if (StringUtils.isEmpty(payload) || (payload instanceof byte[] && ((byte[]) payload).length == 0)) {
|
||||
message = MessageBuilder.createMessage(EMPTY_PAYLOAD, accessor.getMessageHeaders());
|
||||
}
|
||||
else {
|
||||
@@ -271,10 +271,6 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
|
||||
return message;
|
||||
}
|
||||
|
||||
private boolean isEmpty(@Nullable Object payload) {
|
||||
return (StringUtils.isEmpty(payload) || (payload instanceof byte[] && ((byte[]) payload).length == 0));
|
||||
}
|
||||
|
||||
private void execute(Message<byte[]> message) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
StompHeaderAccessor accessor = MessageHeaderAccessor.getAccessor(message, StompHeaderAccessor.class);
|
||||
|
||||
Reference in New Issue
Block a user