test_class.declarator: list = new ListTelnetHandler()
test_class.modifier: private static
test_class.original_string: private static TelnetHandler list = new ListTelnetHandler();
test_class.type: TelnetHandler
test_class.var_name: list
test_class.declarator: mockChannel
test_class.modifier: private
test_class.original_string: private Channel mockChannel;
test_class.type: Channel
test_class.var_name: mockChannel
test_class.declarator: repository = ApplicationModel.getServiceRepository()
test_class.modifier: private final
test_class.original_string: private final ServiceRepository repository = ApplicationModel.getServiceRepository();
test_class.type: ServiceRepository
test_class.var_name: repository
test_class.file: dubbo-plugin/dubbo-qos/src/test/java/org/apache/dubbo/qos/legacy/ListTelnetHandlerTest.java
test_class.identifier: ListTelnetHandlerTest
test_case.body: @Test
      public void testInvalidMessage() throws RemotingException {
          mockChannel = mock(Channel.class);
          given(mockChannel.getAttribute("telnet.service")).willReturn(null);
  
          String result = list.telnet(mockChannel, "xx");
          assertEquals("No such service: xx", result);
      }
test_case.class_method_signature: ListTelnetHandlerTest.testInvalidMessage()
test_case.full_signature: @Test public void testInvalidMessage()
test_case.identifier: testInvalidMessage
test_case.invocations: mock willReturn given getAttribute telnet assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testInvalidMessage()
focal_class.declarator: serviceRepository = ApplicationModel.getServiceRepository()
focal_class.modifier: private
focal_class.original_string: private ServiceRepository serviceRepository = ApplicationModel.getServiceRepository();
focal_class.type: ServiceRepository
focal_class.var_name: serviceRepository
focal_class.file: dubbo-plugin/dubbo-qos/src/main/java/org/apache/dubbo/qos/legacy/ListTelnetHandler.java
focal_class.identifier: ListTelnetHandler
focal_class.interfaces: implements TelnetHandler
focal_class.class_method_signature: ListTelnetHandler.telnet(Channel channel, String message)
focal_class.full_signature: @Override public String telnet(Channel channel, String message)
focal_class.identifier: telnet
focal_class.modifiers: @Override public
focal_class.parameters: (Channel channel, String message)
focal_class.return: String
focal_class.signature: String telnet(Channel channel, String message)
focal_class.class_method_signature: ListTelnetHandler.printAllServices(StringBuilder buf, boolean detail)
focal_class.full_signature: private void printAllServices(StringBuilder buf, boolean detail)
focal_class.identifier: printAllServices
focal_class.modifiers: private
focal_class.parameters: (StringBuilder buf, boolean detail)
focal_class.return: void
focal_class.signature: void printAllServices(StringBuilder buf, boolean detail)
focal_class.class_method_signature: ListTelnetHandler.printAllProvidedServices(StringBuilder buf, boolean detail)
focal_class.full_signature: private void printAllProvidedServices(StringBuilder buf, boolean detail)
focal_class.identifier: printAllProvidedServices
focal_class.modifiers: private
focal_class.parameters: (StringBuilder buf, boolean detail)
focal_class.return: void
focal_class.signature: void printAllProvidedServices(StringBuilder buf, boolean detail)
focal_class.class_method_signature: ListTelnetHandler.printAllReferredServices(StringBuilder buf, boolean detail)
focal_class.full_signature: private void printAllReferredServices(StringBuilder buf, boolean detail)
focal_class.identifier: printAllReferredServices
focal_class.modifiers: private
focal_class.parameters: (StringBuilder buf, boolean detail)
focal_class.return: void
focal_class.signature: void printAllReferredServices(StringBuilder buf, boolean detail)
focal_class.class_method_signature: ListTelnetHandler.printSpecifiedService(String service, StringBuilder buf, boolean detail)
focal_class.full_signature: private void printSpecifiedService(String service, StringBuilder buf, boolean detail)
focal_class.identifier: printSpecifiedService
focal_class.modifiers: private
focal_class.parameters: (String service, StringBuilder buf, boolean detail)
focal_class.return: void
focal_class.signature: void printSpecifiedService(String service, StringBuilder buf, boolean detail)
focal_class.class_method_signature: ListTelnetHandler.printSpecifiedProvidedService(String service, StringBuilder buf, boolean detail)
focal_class.full_signature: private void printSpecifiedProvidedService(String service, StringBuilder buf, boolean detail)
focal_class.identifier: printSpecifiedProvidedService
focal_class.modifiers: private
focal_class.parameters: (String service, StringBuilder buf, boolean detail)
focal_class.return: void
focal_class.signature: void printSpecifiedProvidedService(String service, StringBuilder buf, boolean detail)
focal_class.class_method_signature: ListTelnetHandler.printSpecifiedReferredService(String service, StringBuilder buf, boolean detail)
focal_class.full_signature: private void printSpecifiedReferredService(String service, StringBuilder buf, boolean detail)
focal_class.identifier: printSpecifiedReferredService
focal_class.modifiers: private
focal_class.parameters: (String service, StringBuilder buf, boolean detail)
focal_class.return: void
focal_class.signature: void printSpecifiedReferredService(String service, StringBuilder buf, boolean detail)
focal_class.class_method_signature: ListTelnetHandler.printMethod(Method method, StringBuilder buf, boolean detail)
focal_class.full_signature: private void printMethod(Method method, StringBuilder buf, boolean detail)
focal_class.identifier: printMethod
focal_class.modifiers: private
focal_class.parameters: (Method method, StringBuilder buf, boolean detail)
focal_class.return: void
focal_class.signature: void printMethod(Method method, StringBuilder buf, boolean detail)
focal_class.class_method_signature: ListTelnetHandler.isProviderMatched(String service, ProviderModel provider)
focal_class.full_signature: private boolean isProviderMatched(String service, ProviderModel provider)
focal_class.identifier: isProviderMatched
focal_class.modifiers: private
focal_class.parameters: (String service, ProviderModel provider)
focal_class.return: boolean
focal_class.signature: boolean isProviderMatched(String service, ProviderModel provider)
focal_class.class_method_signature: ListTelnetHandler.isConsumerMatcher(String service,ConsumerModel consumer)
focal_class.full_signature: private boolean isConsumerMatcher(String service,ConsumerModel consumer)
focal_class.identifier: isConsumerMatcher
focal_class.modifiers: private
focal_class.parameters: (String service,ConsumerModel consumer)
focal_class.return: boolean
focal_class.signature: boolean isConsumerMatcher(String service,ConsumerModel consumer)
focal_method.body: @Override
      public String telnet(Channel channel, String message) {
          StringBuilder buf = new StringBuilder();
          String service = null;
          boolean detail = false;
          if (message.length() > 0) {
              String[] parts = message.split("\\s+");
              for (String part : parts) {
                  if ("-l".equals(part)) {
                      detail = true;
                  } else {
                      if (!StringUtils.isEmpty(service)) {
                          return "Invalid parameter " + part;
                      }
                      service = part;
                  }
              }
          } else {
              service = (String) channel.getAttribute(ChangeTelnetHandler.SERVICE_KEY);
              if (StringUtils.isNotEmpty(service)) {
                  buf.append("Use default service ").append(service).append(".\r\n");
              }
          }
  
          if (StringUtils.isEmpty(service)) {
              printAllServices(buf, detail);
          } else {
              printSpecifiedService(service, buf, detail);
  
              if (buf.length() == 0) {
                  buf.append("No such service: ").append(service);
              }
          }
          return buf.toString();
      }
focal_method.class_method_signature: ListTelnetHandler.telnet(Channel channel, String message)
focal_method.full_signature: @Override public String telnet(Channel channel, String message)
focal_method.identifier: telnet
focal_method.invocations: length split equals isEmpty getAttribute isNotEmpty append append append isEmpty printAllServices printSpecifiedService length append append toString
focal_method.modifiers: @Override public
focal_method.parameters: (Channel channel, String message)
focal_method.return: String
focal_method.signature: String telnet(Channel channel, String message)