Skip to content

Commit b149265

Browse files
committed
use equal explicit class to replace anonymous class
1 parent 6a1dd65 commit b149265

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AvailableCluster.java

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,7 @@ public class AvailableCluster implements Cluster {
3636

3737
@Override
3838
public <T> Invoker<T> join(Directory<T> directory) throws RpcException {
39-
40-
return new AbstractClusterInvoker<T>(directory) {
41-
@Override
42-
public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {
43-
for (Invoker<T> invoker : invokers) {
44-
if (invoker.isAvailable()) {
45-
return invoker.invoke(invocation);
46-
}
47-
}
48-
throw new RpcException("No provider available in " + invokers);
49-
}
50-
};
51-
39+
return new AvailableClusterInvoker<>(directory);
5240
}
5341

5442
}

0 commit comments

Comments
 (0)