From b149265d8ee466f63f44701b3607791a5ebc6c17 Mon Sep 17 00:00:00 2001 From: tswstarplanet Date: Sat, 11 May 2019 02:55:36 +0800 Subject: [PATCH] use equal explicit class to replace anonymous class --- .../rpc/cluster/support/AvailableCluster.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AvailableCluster.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AvailableCluster.java index 85e91e0527fa..dc186771e55f 100644 --- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AvailableCluster.java +++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AvailableCluster.java @@ -36,19 +36,7 @@ public class AvailableCluster implements Cluster { @Override public Invoker join(Directory directory) throws RpcException { - - return new AbstractClusterInvoker(directory) { - @Override - public Result doInvoke(Invocation invocation, List> invokers, LoadBalance loadbalance) throws RpcException { - for (Invoker invoker : invokers) { - if (invoker.isAvailable()) { - return invoker.invoke(invocation); - } - } - throw new RpcException("No provider available in " + invokers); - } - }; - + return new AvailableClusterInvoker<>(directory); } }