File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/protocol Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 2222import org .apache .dubbo .common .logger .Logger ;
2323import org .apache .dubbo .common .logger .LoggerFactory ;
2424import org .apache .dubbo .common .utils .ArrayUtils ;
25+ import org .apache .dubbo .common .utils .CollectionUtils ;
2526import org .apache .dubbo .common .utils .NetUtils ;
2627import org .apache .dubbo .rpc .Invocation ;
2728import org .apache .dubbo .rpc .Invoker ;
@@ -134,11 +135,11 @@ public Result invoke(Invocation inv) throws RpcException {
134135 }
135136 RpcInvocation invocation = (RpcInvocation ) inv ;
136137 invocation .setInvoker (this );
137- if (attachment != null && ! attachment . isEmpty ( )) {
138+ if (CollectionUtils . isNotEmptyMap ( attachment )) {
138139 invocation .addAttachmentsIfAbsent (attachment );
139140 }
140141 Map <String , String > contextAttachments = RpcContext .getContext ().getAttachments ();
141- if (contextAttachments != null && ! contextAttachments . isEmpty ( )) {
142+ if (CollectionUtils . isNotEmptyMap ( contextAttachments )) {
142143 /**
143144 * invocation.addAttachmentsIfAbsent(context){@link RpcInvocation#addAttachmentsIfAbsent(Map)}should not be used here,
144145 * because the {@link RpcContext#setAttachment(String, String)} is passed in the Filter when the call is triggered
You can’t perform that action at this time.
0 commit comments