test_class.declarator: invokers = new ArrayList<Invoker<IHelloService>>()
test_class.original_string: List<Invoker<IHelloService>> invokers = new ArrayList<Invoker<IHelloService>>();
test_class.type: List<Invoker<IHelloService>>
test_class.var_name: invokers
test_class.declarator: selectedInvokers = new ArrayList<Invoker<IHelloService>>()
test_class.original_string: List<Invoker<IHelloService>> selectedInvokers = new ArrayList<Invoker<IHelloService>>();
test_class.type: List<Invoker<IHelloService>>
test_class.var_name: selectedInvokers
test_class.declarator: cluster
test_class.original_string: AbstractClusterInvoker<IHelloService> cluster;
test_class.type: AbstractClusterInvoker<IHelloService>
test_class.var_name: cluster
test_class.declarator: cluster_nocheck
test_class.original_string: AbstractClusterInvoker<IHelloService> cluster_nocheck;
test_class.type: AbstractClusterInvoker<IHelloService>
test_class.var_name: cluster_nocheck
test_class.declarator: dic
test_class.original_string: StaticDirectory<IHelloService> dic;
test_class.type: StaticDirectory<IHelloService>
test_class.var_name: dic
test_class.declarator: invocation = new RpcInvocation()
test_class.original_string: RpcInvocation invocation = new RpcInvocation();
test_class.type: RpcInvocation
test_class.var_name: invocation
test_class.declarator: url = URL.valueOf("registry://localhost:9090/org.apache.dubbo.rpc.cluster.support.AbstractClusterInvokerTest.IHelloService?refer=" + URL.encode("application=abstractClusterInvokerTest"))
test_class.original_string: URL url = URL.valueOf("registry://localhost:9090/org.apache.dubbo.rpc.cluster.support.AbstractClusterInvokerTest.IHelloService?refer=" + URL.encode("application=abstractClusterInvokerTest"));
test_class.type: URL
test_class.var_name: url
test_class.declarator: consumerUrl = URL.valueOf("dubbo://localhost:9090?application=abstractClusterInvokerTest")
test_class.original_string: URL consumerUrl = URL.valueOf("dubbo://localhost:9090?application=abstractClusterInvokerTest");
test_class.type: URL
test_class.var_name: consumerUrl
test_class.declarator: invoker1
test_class.original_string: Invoker<IHelloService> invoker1;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker1
test_class.declarator: invoker2
test_class.original_string: Invoker<IHelloService> invoker2;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker2
test_class.declarator: invoker3
test_class.original_string: Invoker<IHelloService> invoker3;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker3
test_class.declarator: invoker4
test_class.original_string: Invoker<IHelloService> invoker4;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker4
test_class.declarator: invoker5
test_class.original_string: Invoker<IHelloService> invoker5;
test_class.type: Invoker<IHelloService>
test_class.var_name: invoker5
test_class.declarator: mockedInvoker1
test_class.original_string: Invoker<IHelloService> mockedInvoker1;
test_class.type: Invoker<IHelloService>
test_class.var_name: mockedInvoker1
test_class.file: dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvokerTest.java
test_class.identifier: AbstractClusterInvokerTest
test_case.body: @Test
      public void testSelectAgainAndCheckAvailable() {
  
          LoadBalance lb = ExtensionLoader.getExtensionLoader(LoadBalance.class).getExtension(RoundRobinLoadBalance.NAME);
          initlistsize5();
          {
              //Boundary condition test .
              selectedInvokers.clear();
              selectedInvokers.add(invoker1);
              selectedInvokers.add(invoker2);
              selectedInvokers.add(invoker3);
              selectedInvokers.add(invoker5);
              Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
              Assertions.assertSame(sinvoker, invoker4);
          }
          {
              //Boundary condition test .
              selectedInvokers.clear();
              selectedInvokers.add(invoker2);
              selectedInvokers.add(invoker3);
              selectedInvokers.add(invoker4);
              selectedInvokers.add(invoker5);
              Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
              Assertions.assertTrue(sinvoker == invoker2 || sinvoker == invoker4);
          }
          {
              //Boundary condition test .
              for (int i = 0; i < 100; i++) {
                  selectedInvokers.clear();
                  Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
                  Assertions.assertTrue(sinvoker == invoker2 || sinvoker == invoker4);
              }
          }
          {
              //Boundary condition test .
              for (int i = 0; i < 100; i++) {
                  selectedInvokers.clear();
                  selectedInvokers.add(invoker1);
                  selectedInvokers.add(invoker3);
                  selectedInvokers.add(invoker5);
                  Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
                  Assertions.assertTrue(sinvoker == invoker2 || sinvoker == invoker4);
              }
          }
          {
              //Boundary condition test .
              for (int i = 0; i < 100; i++) {
                  selectedInvokers.clear();
                  selectedInvokers.add(invoker1);
                  selectedInvokers.add(invoker3);
                  selectedInvokers.add(invoker2);
                  selectedInvokers.add(invoker4);
                  selectedInvokers.add(invoker5);
                  Invoker sinvoker = cluster.select(lb, invocation, invokers, selectedInvokers);
                  Assertions.assertTrue(sinvoker == invoker2 || sinvoker == invoker4);
              }
          }
      }
test_case.class_method_signature: AbstractClusterInvokerTest.testSelectAgainAndCheckAvailable()
test_case.full_signature: @Test public void testSelectAgainAndCheckAvailable()
test_case.identifier: testSelectAgainAndCheckAvailable
test_case.invocations: getExtension getExtensionLoader initlistsize5 clear add add add add select assertSame clear add add add add select assertTrue clear select assertTrue clear add add add select assertTrue clear add add add add add select assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testSelectAgainAndCheckAvailable()
focal_class.declarator: logger = LoggerFactory.getLogger(AbstractClusterInvoker.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(AbstractClusterInvoker.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: directory
focal_class.modifier: protected
focal_class.original_string: protected Directory<T> directory;
focal_class.type: Directory<T>
focal_class.var_name: directory
focal_class.declarator: availablecheck
focal_class.modifier: protected
focal_class.original_string: protected boolean availablecheck;
focal_class.type: boolean
focal_class.var_name: availablecheck
focal_class.declarator: destroyed = new AtomicBoolean(false)
focal_class.modifier: private
focal_class.original_string: private AtomicBoolean destroyed = new AtomicBoolean(false);
focal_class.type: AtomicBoolean
focal_class.var_name: destroyed
focal_class.declarator: stickyInvoker = null
focal_class.modifier: private volatile
focal_class.original_string: private volatile Invoker<T> stickyInvoker = null;
focal_class.type: Invoker<T>
focal_class.var_name: stickyInvoker
focal_class.file: dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/AbstractClusterInvoker.java
focal_class.identifier: AbstractClusterInvoker
focal_class.interfaces: implements ClusterInvoker<T>
focal_class.class_method_signature: AbstractClusterInvoker.AbstractClusterInvoker()
focal_class.full_signature: public  AbstractClusterInvoker()
focal_class.identifier: AbstractClusterInvoker
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  AbstractClusterInvoker()
focal_class.class_method_signature: AbstractClusterInvoker.AbstractClusterInvoker(Directory<T> directory)
focal_class.full_signature: public  AbstractClusterInvoker(Directory<T> directory)
focal_class.identifier: AbstractClusterInvoker
focal_class.modifiers: public
focal_class.parameters: (Directory<T> directory)
focal_class.signature:  AbstractClusterInvoker(Directory<T> directory)
focal_class.class_method_signature: AbstractClusterInvoker.AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.full_signature: public  AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.identifier: AbstractClusterInvoker
focal_class.modifiers: public
focal_class.parameters: (Directory<T> directory, URL url)
focal_class.signature:  AbstractClusterInvoker(Directory<T> directory, URL url)
focal_class.class_method_signature: AbstractClusterInvoker.getInterface()
focal_class.full_signature: @Override public Class<T> getInterface()
focal_class.identifier: getInterface
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Class<T>
focal_class.signature: Class<T> getInterface()
focal_class.class_method_signature: AbstractClusterInvoker.getUrl()
focal_class.full_signature: @Override public URL getUrl()
focal_class.identifier: getUrl
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getUrl()
focal_class.class_method_signature: AbstractClusterInvoker.getRegistryUrl()
focal_class.full_signature: public URL getRegistryUrl()
focal_class.identifier: getRegistryUrl
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getRegistryUrl()
focal_class.class_method_signature: AbstractClusterInvoker.isAvailable()
focal_class.full_signature: @Override public boolean isAvailable()
focal_class.identifier: isAvailable
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isAvailable()
focal_class.class_method_signature: AbstractClusterInvoker.getDirectory()
focal_class.full_signature: public Directory<T> getDirectory()
focal_class.identifier: getDirectory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Directory<T>
focal_class.signature: Directory<T> getDirectory()
focal_class.class_method_signature: AbstractClusterInvoker.destroy()
focal_class.full_signature: @Override public void destroy()
focal_class.identifier: destroy
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void destroy()
focal_class.class_method_signature: AbstractClusterInvoker.isDestroyed()
focal_class.full_signature: @Override public boolean isDestroyed()
focal_class.identifier: isDestroyed
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isDestroyed()
focal_class.class_method_signature: AbstractClusterInvoker.select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.full_signature: protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.identifier: select
focal_class.modifiers: protected
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.class_method_signature: AbstractClusterInvoker.doSelect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.full_signature: private Invoker<T> doSelect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.identifier: doSelect
focal_class.modifiers: private
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> doSelect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_class.class_method_signature: AbstractClusterInvoker.reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.full_signature: private Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.identifier: reselect
focal_class.modifiers: private
focal_class.parameters: (LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.return: Invoker<T>
focal_class.signature: Invoker<T> reselect(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected, boolean availablecheck)
focal_class.class_method_signature: AbstractClusterInvoker.invoke(final Invocation invocation)
focal_class.full_signature: @Override public Result invoke(final Invocation invocation)
focal_class.identifier: invoke
focal_class.modifiers: @Override public
focal_class.parameters: (final Invocation invocation)
focal_class.return: Result
focal_class.signature: Result invoke(final Invocation invocation)
focal_class.class_method_signature: AbstractClusterInvoker.checkWhetherDestroyed()
focal_class.full_signature: protected void checkWhetherDestroyed()
focal_class.identifier: checkWhetherDestroyed
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkWhetherDestroyed()
focal_class.class_method_signature: AbstractClusterInvoker.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_class.class_method_signature: AbstractClusterInvoker.checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.full_signature: protected void checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.identifier: checkInvokers
focal_class.modifiers: protected
focal_class.parameters: (List<Invoker<T>> invokers, Invocation invocation)
focal_class.return: void
focal_class.signature: void checkInvokers(List<Invoker<T>> invokers, Invocation invocation)
focal_class.class_method_signature: AbstractClusterInvoker.doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.full_signature: protected abstract Result doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.identifier: doInvoke
focal_class.modifiers: protected abstract
focal_class.parameters: (Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.return: Result
focal_class.signature: Result doInvoke(Invocation invocation, List<Invoker<T>> invokers,
                                         LoadBalance loadbalance)
focal_class.class_method_signature: AbstractClusterInvoker.list(Invocation invocation)
focal_class.full_signature: protected List<Invoker<T>> list(Invocation invocation)
focal_class.identifier: list
focal_class.modifiers: protected
focal_class.parameters: (Invocation invocation)
focal_class.return: List<Invoker<T>>
focal_class.signature: List<Invoker<T>> list(Invocation invocation)
focal_class.class_method_signature: AbstractClusterInvoker.initLoadBalance(List<Invoker<T>> invokers, Invocation invocation)
focal_class.full_signature: protected LoadBalance initLoadBalance(List<Invoker<T>> invokers, Invocation invocation)
focal_class.identifier: initLoadBalance
focal_class.modifiers: protected
focal_class.parameters: (List<Invoker<T>> invokers, Invocation invocation)
focal_class.return: LoadBalance
focal_class.signature: LoadBalance initLoadBalance(List<Invoker<T>> invokers, Invocation invocation)
focal_method.body: protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected) throws RpcException {
  
          if (CollectionUtils.isEmpty(invokers)) {
              return null;
          }
          String methodName = invocation == null ? StringUtils.EMPTY_STRING : invocation.getMethodName();
  
          boolean sticky = invokers.get(0).getUrl()
                  .getMethodParameter(methodName, CLUSTER_STICKY_KEY, DEFAULT_CLUSTER_STICKY);
  
          //ignore overloaded method
          if (stickyInvoker != null && !invokers.contains(stickyInvoker)) {
              stickyInvoker = null;
          }
          //ignore concurrency problem
          if (sticky && stickyInvoker != null && (selected == null || !selected.contains(stickyInvoker))) {
              if (availablecheck && stickyInvoker.isAvailable()) {
                  return stickyInvoker;
              }
          }
  
          Invoker<T> invoker = doSelect(loadbalance, invocation, invokers, selected);
  
          if (sticky) {
              stickyInvoker = invoker;
          }
          return invoker;
      }
focal_method.class_method_signature: AbstractClusterInvoker.select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_method.full_signature: protected Invoker<T> select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_method.identifier: select
focal_method.invocations: isEmpty getMethodName getMethodParameter getUrl get contains contains isAvailable doSelect
focal_method.modifiers: protected
focal_method.parameters: (LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)
focal_method.return: Invoker<T>
focal_method.signature: Invoker<T> select(LoadBalance loadbalance, Invocation invocation,
                                  List<Invoker<T>> invokers, List<Invoker<T>> selected)