This is an automated email from the ASF dual-hosted git repository.
yiji 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 7f262f9 simplify map empty judgment (#3376)
7f262f9 is described below
commit 7f262f960b830db3b80d35451f259430ae56b1c8
Author: yì jí <[email protected]>
AuthorDate: Tue Jan 29 13:38:51 2019 +0800
simplify map empty judgment (#3376)
---
.../src/main/java/org/apache/dubbo/rpc/protocol/AbstractInvoker.java | 4 ++--
1 file changed, 2 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 d59af2b..4cd9148 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
@@ -134,11 +134,11 @@ public abstract class AbstractInvoker<T> implements
Invoker<T> {
}
RpcInvocation invocation = (RpcInvocation) inv;
invocation.setInvoker(this);
- if (attachment != null && attachment.size() > 0) {
+ if (attachment != null && !attachment.isEmpty()) {
invocation.addAttachmentsIfAbsent(attachment);
}
Map<String, String> contextAttachments =
RpcContext.getContext().getAttachments();
- if (contextAttachments != null && contextAttachments.size() != 0) {
+ if (contextAttachments != null && !contextAttachments.isEmpty()) {
/**
* 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