From 24f5fce37b3a8c141da5468f8c82e1ac654c6b24 Mon Sep 17 00:00:00 2001 From: Sky Date: Wed, 25 Oct 2017 07:15:13 -0500 Subject: [PATCH] NPE bug fixed. The operator '+' has a higher operation priority than '?:'. A NPE will be thrown if getUrl() returns null, which is not expected. --- .../alibaba/dubbo/rpc/listener/ListenerInvokerWrapper.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/listener/ListenerInvokerWrapper.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/listener/ListenerInvokerWrapper.java index d9b850920c4..e27c2b1a798 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/listener/ListenerInvokerWrapper.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/listener/ListenerInvokerWrapper.java @@ -76,7 +76,7 @@ public Result invoke(Invocation invocation) throws RpcException { @Override public String toString() { - return getInterface() + " -> " + getUrl() == null ? " " : getUrl().toString(); + return getInterface() + " -> " + (getUrl() == null ? " " : getUrl().toString()); } public void destroy() { @@ -97,4 +97,4 @@ public void destroy() { } } -} \ No newline at end of file +}