This is an automated email from the ASF dual-hosted git repository.
iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new a074319 follow up for #3376 (#3377)
a074319 is described below
commit a074319c4e05fe1f84495e1095b115acdb89c17a
Author: Ian Luo <[email protected]>
AuthorDate: Tue Jan 29 16:35:24 2019 +0800
follow up for #3376 (#3377)
---
.../src/main/java/org/apache/dubbo/rpc/protocol/AbstractInvoker.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AbstractInvoker.java
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AbstractInvoker.java
index 4cd9148..3df1f1d 100644
---
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AbstractInvoker.java
+++
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol/AbstractInvoker.java
@@ -22,6 +22,7 @@ import org.apache.dubbo.common.Version;
import org.apache.dubbo.common.logger.Logger;
import org.apache.dubbo.common.logger.LoggerFactory;
import org.apache.dubbo.common.utils.ArrayUtils;
+import org.apache.dubbo.common.utils.CollectionUtils;
import org.apache.dubbo.common.utils.NetUtils;
import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.Invoker;
@@ -134,11 +135,11 @@ public abstract class AbstractInvoker<T> implements
Invoker<T> {
}
RpcInvocation invocation = (RpcInvocation) inv;
invocation.setInvoker(this);
- if (attachment != null && !attachment.isEmpty()) {
+ if (CollectionUtils.isNotEmptyMap(attachment)) {
invocation.addAttachmentsIfAbsent(attachment);
}
Map<String, String> contextAttachments =
RpcContext.getContext().getAttachments();
- if (contextAttachments != null && !contextAttachments.isEmpty()) {
+ if (CollectionUtils.isNotEmptyMap(contextAttachments)) {
/**
* invocation.addAttachmentsIfAbsent(context){@link
RpcInvocation#addAttachmentsIfAbsent(Map)}should not be used here,
* because the {@link RpcContext#setAttachment(String, String)} is
passed in the Filter when the call is triggered