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 f5b6d2a delete useless judgment (#3326)
f5b6d2a is described below
commit f5b6d2aa94591ef446a4c81b438fb501d5feaa8e
Author: huazhongming <[email protected]>
AuthorDate: Mon Jan 28 17:44:00 2019 +0800
delete useless judgment (#3326)
---
.../apache/dubbo/rpc/protocol/injvm/InjvmProtocol.java | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git
a/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmProtocol.java
b/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmProtocol.java
index e6959d4..1181e89 100644
---
a/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmProtocol.java
+++
b/dubbo-rpc/dubbo-rpc-injvm/src/main/java/org/apache/dubbo/rpc/protocol/injvm/InjvmProtocol.java
@@ -93,27 +93,23 @@ public class InjvmProtocol extends AbstractProtocol
implements Protocol {
}
public boolean isInjvmRefer(URL url) {
- final boolean isJvmRefer;
String scope = url.getParameter(Constants.SCOPE_KEY);
// Since injvm protocol is configured explicitly, we don't need to set
any extra flag, use normal refer process.
- if (Constants.LOCAL_PROTOCOL.toString().equals(url.getProtocol())) {
- isJvmRefer = false;
- } else if (Constants.SCOPE_LOCAL.equals(scope) ||
(url.getParameter(Constants.LOCAL_PROTOCOL, false))) {
+ if (Constants.SCOPE_LOCAL.equals(scope) ||
(url.getParameter(Constants.LOCAL_PROTOCOL, false))) {
// if it's declared as local reference
// 'scope=local' is equivalent to 'injvm=true', injvm will be
deprecated in the future release
- isJvmRefer = true;
+ return true;
} else if (Constants.SCOPE_REMOTE.equals(scope)) {
// it's declared as remote reference
- isJvmRefer = false;
+ return false;
} else if (url.getParameter(Constants.GENERIC_KEY, false)) {
// generic invocation is not local reference
- isJvmRefer = false;
+ return false;
} else if (getExporter(exporterMap, url) != null) {
// by default, go through local reference if there's the service
exposed locally
- isJvmRefer = true;
+ return true;
} else {
- isJvmRefer = false;
+ return false;
}
- return isJvmRefer;
}
}