guohao commented on a change in pull request #8757:
URL: https://github.com/apache/dubbo/pull/8757#discussion_r709715348



##########
File path: 
dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
##########
@@ -490,18 +496,22 @@ private void createInvokerForRemote() {
                 // registry url is available
                 // for multi-subscription scenario, use 'zone-aware' policy by 
default
                 String cluster = registryUrl.getParameter(CLUSTER_KEY, 
ZoneAwareCluster.NAME);
-                // The invoker wrap sequence would be: 
ZoneAwareClusterInvoker(StaticDirectory) -> 
FailoverClusterInvoker(RegistryDirectory, routing happens here) -> Invoker
+                // The invoker wrap sequence would be: 
ZoneAwareClusterInvoker(StaticDirectory) -> FailoverClusterInvoker
+                // (RegistryDirectory, routing happens here) -> Invoker
                 invoker = Cluster.getCluster(registryUrl.getScopeModel(), 
cluster, false).join(new StaticDirectory(registryUrl, invokers));
             } else {
                 // not a registry url, must be direct invoke.
-                String cluster = CollectionUtils.isNotEmpty(invokers) ?
-                    (invokers.get(0).getUrl() != null ? 
invokers.get(0).getUrl().getParameter(CLUSTER_KEY, ZoneAwareCluster.NAME) :
-                        Cluster.DEFAULT)
-                    : Cluster.DEFAULT;
-                ScopeModel scopeModel = CollectionUtils.isNotEmpty(invokers) ?
-                    (invokers.get(0).getUrl() != null ? 
invokers.get(0).getUrl().getScopeModel() : null)
-                    : null;
-                invoker = Cluster.getCluster(scopeModel, cluster).join(new 
StaticDirectory(invokers));
+                if (CollectionUtils.isEmpty(invokers)) {
+                    throw new IllegalArgumentException("invokers == null");
+                }
+                URL curUrl = invokers.get(0).getUrl();
+                String cluster = curUrl.getParameter(CLUSTER_KEY, 
Cluster.DEFAULT);
+                // ?
+                // (invokers.get(0).getUrl() != null ? 
invokers.get(0).getUrl().getParameter(CLUSTER_KEY,

Review comment:
       Remove unused code




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to