test_class.declarator: localAddress = "127.0.0.1"
test_class.original_string: String localAddress = "127.0.0.1";
test_class.type: String
test_class.var_name: localAddress
test_class.file: dubbo-common/src/test/java/org/apache/dubbo/common/utils/UrlUtilsTest.java
test_class.identifier: UrlUtilsTest
test_case.body: @Test
      public void testParseUrl() {
          String address = "remote://root:alibaba@127.0.0.1:9090/dubbo.test.api";
          URL url = UrlUtils.parseURL(address, null);
          assertEquals(localAddress + ":9090", url.getAddress());
          assertEquals("root", url.getUsername());
          assertEquals("alibaba", url.getPassword());
          assertEquals("dubbo.test.api", url.getPath());
          assertEquals(9090, url.getPort());
          assertEquals("remote", url.getProtocol());
      }
test_case.class_method_signature: UrlUtilsTest.testParseUrl()
test_case.full_signature: @Test public void testParseUrl()
test_case.identifier: testParseUrl
test_case.invocations: parseURL assertEquals getAddress assertEquals getUsername assertEquals getPassword assertEquals getPath assertEquals getPort assertEquals getProtocol
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testParseUrl()
focal_class.declarator: URL_PARAM_STARTING_SYMBOL = "?"
focal_class.modifier: private final static
focal_class.original_string: private final static String URL_PARAM_STARTING_SYMBOL = "?";
focal_class.type: String
focal_class.var_name: URL_PARAM_STARTING_SYMBOL
focal_class.file: dubbo-common/src/main/java/org/apache/dubbo/common/utils/UrlUtils.java
focal_class.identifier: UrlUtils
focal_class.class_method_signature: UrlUtils.parseURL(String address, Map<String, String> defaults)
focal_class.full_signature: public static URL parseURL(String address, Map<String, String> defaults)
focal_class.identifier: parseURL
focal_class.modifiers: public static
focal_class.parameters: (String address, Map<String, String> defaults)
focal_class.return: URL
focal_class.signature: URL parseURL(String address, Map<String, String> defaults)
focal_class.class_method_signature: UrlUtils.parseURLs(String address, Map<String, String> defaults)
focal_class.full_signature: public static List<URL> parseURLs(String address, Map<String, String> defaults)
focal_class.identifier: parseURLs
focal_class.modifiers: public static
focal_class.parameters: (String address, Map<String, String> defaults)
focal_class.return: List<URL>
focal_class.signature: List<URL> parseURLs(String address, Map<String, String> defaults)
focal_class.class_method_signature: UrlUtils.convertRegister(Map<String, Map<String, String>> register)
focal_class.full_signature: public static Map<String, Map<String, String>> convertRegister(Map<String, Map<String, String>> register)
focal_class.identifier: convertRegister
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Map<String, String>> register)
focal_class.return: Map<String, Map<String, String>>
focal_class.signature: Map<String, Map<String, String>> convertRegister(Map<String, Map<String, String>> register)
focal_class.class_method_signature: UrlUtils.convertSubscribe(Map<String, String> subscribe)
focal_class.full_signature: public static Map<String, String> convertSubscribe(Map<String, String> subscribe)
focal_class.identifier: convertSubscribe
focal_class.modifiers: public static
focal_class.parameters: (Map<String, String> subscribe)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> convertSubscribe(Map<String, String> subscribe)
focal_class.class_method_signature: UrlUtils.revertRegister(Map<String, Map<String, String>> register)
focal_class.full_signature: public static Map<String, Map<String, String>> revertRegister(Map<String, Map<String, String>> register)
focal_class.identifier: revertRegister
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Map<String, String>> register)
focal_class.return: Map<String, Map<String, String>>
focal_class.signature: Map<String, Map<String, String>> revertRegister(Map<String, Map<String, String>> register)
focal_class.class_method_signature: UrlUtils.revertSubscribe(Map<String, String> subscribe)
focal_class.full_signature: public static Map<String, String> revertSubscribe(Map<String, String> subscribe)
focal_class.identifier: revertSubscribe
focal_class.modifiers: public static
focal_class.parameters: (Map<String, String> subscribe)
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> revertSubscribe(Map<String, String> subscribe)
focal_class.class_method_signature: UrlUtils.revertNotify(Map<String, Map<String, String>> notify)
focal_class.full_signature: public static Map<String, Map<String, String>> revertNotify(Map<String, Map<String, String>> notify)
focal_class.identifier: revertNotify
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Map<String, String>> notify)
focal_class.return: Map<String, Map<String, String>>
focal_class.signature: Map<String, Map<String, String>> revertNotify(Map<String, Map<String, String>> notify)
focal_class.class_method_signature: UrlUtils.revertForbid(List<String> forbid, Set<URL> subscribed)
focal_class.full_signature: public static List<String> revertForbid(List<String> forbid, Set<URL> subscribed)
focal_class.identifier: revertForbid
focal_class.modifiers: public static
focal_class.parameters: (List<String> forbid, Set<URL> subscribed)
focal_class.return: List<String>
focal_class.signature: List<String> revertForbid(List<String> forbid, Set<URL> subscribed)
focal_class.class_method_signature: UrlUtils.getEmptyUrl(String service, String category)
focal_class.full_signature: public static URL getEmptyUrl(String service, String category)
focal_class.identifier: getEmptyUrl
focal_class.modifiers: public static
focal_class.parameters: (String service, String category)
focal_class.return: URL
focal_class.signature: URL getEmptyUrl(String service, String category)
focal_class.class_method_signature: UrlUtils.isMatchCategory(String category, String categories)
focal_class.full_signature: public static boolean isMatchCategory(String category, String categories)
focal_class.identifier: isMatchCategory
focal_class.modifiers: public static
focal_class.parameters: (String category, String categories)
focal_class.return: boolean
focal_class.signature: boolean isMatchCategory(String category, String categories)
focal_class.class_method_signature: UrlUtils.isMatch(URL consumerUrl, URL providerUrl)
focal_class.full_signature: public static boolean isMatch(URL consumerUrl, URL providerUrl)
focal_class.identifier: isMatch
focal_class.modifiers: public static
focal_class.parameters: (URL consumerUrl, URL providerUrl)
focal_class.return: boolean
focal_class.signature: boolean isMatch(URL consumerUrl, URL providerUrl)
focal_class.class_method_signature: UrlUtils.isMatchGlobPattern(String pattern, String value, URL param)
focal_class.full_signature: public static boolean isMatchGlobPattern(String pattern, String value, URL param)
focal_class.identifier: isMatchGlobPattern
focal_class.modifiers: public static
focal_class.parameters: (String pattern, String value, URL param)
focal_class.return: boolean
focal_class.signature: boolean isMatchGlobPattern(String pattern, String value, URL param)
focal_class.class_method_signature: UrlUtils.isMatchGlobPattern(String pattern, String value)
focal_class.full_signature: public static boolean isMatchGlobPattern(String pattern, String value)
focal_class.identifier: isMatchGlobPattern
focal_class.modifiers: public static
focal_class.parameters: (String pattern, String value)
focal_class.return: boolean
focal_class.signature: boolean isMatchGlobPattern(String pattern, String value)
focal_class.class_method_signature: UrlUtils.isServiceKeyMatch(URL pattern, URL value)
focal_class.full_signature: public static boolean isServiceKeyMatch(URL pattern, URL value)
focal_class.identifier: isServiceKeyMatch
focal_class.modifiers: public static
focal_class.parameters: (URL pattern, URL value)
focal_class.return: boolean
focal_class.signature: boolean isServiceKeyMatch(URL pattern, URL value)
focal_class.class_method_signature: UrlUtils.classifyUrls(List<URL> urls, Predicate<URL> predicate)
focal_class.full_signature: public static List<URL> classifyUrls(List<URL> urls, Predicate<URL> predicate)
focal_class.identifier: classifyUrls
focal_class.modifiers: public static
focal_class.parameters: (List<URL> urls, Predicate<URL> predicate)
focal_class.return: List<URL>
focal_class.signature: List<URL> classifyUrls(List<URL> urls, Predicate<URL> predicate)
focal_class.class_method_signature: UrlUtils.isConfigurator(URL url)
focal_class.full_signature: public static boolean isConfigurator(URL url)
focal_class.identifier: isConfigurator
focal_class.modifiers: public static
focal_class.parameters: (URL url)
focal_class.return: boolean
focal_class.signature: boolean isConfigurator(URL url)
focal_class.class_method_signature: UrlUtils.isRoute(URL url)
focal_class.full_signature: public static boolean isRoute(URL url)
focal_class.identifier: isRoute
focal_class.modifiers: public static
focal_class.parameters: (URL url)
focal_class.return: boolean
focal_class.signature: boolean isRoute(URL url)
focal_class.class_method_signature: UrlUtils.isProvider(URL url)
focal_class.full_signature: public static boolean isProvider(URL url)
focal_class.identifier: isProvider
focal_class.modifiers: public static
focal_class.parameters: (URL url)
focal_class.return: boolean
focal_class.signature: boolean isProvider(URL url)
focal_class.class_method_signature: UrlUtils.isRegistry(URL url)
focal_class.full_signature: public static boolean isRegistry(URL url)
focal_class.identifier: isRegistry
focal_class.modifiers: public static
focal_class.parameters: (URL url)
focal_class.return: boolean
focal_class.signature: boolean isRegistry(URL url)
focal_class.class_method_signature: UrlUtils.isServiceDiscoveryRegistryType(URL url)
focal_class.full_signature: public static boolean isServiceDiscoveryRegistryType(URL url)
focal_class.identifier: isServiceDiscoveryRegistryType
focal_class.modifiers: public static
focal_class.parameters: (URL url)
focal_class.return: boolean
focal_class.signature: boolean isServiceDiscoveryRegistryType(URL url)
focal_class.class_method_signature: UrlUtils.isServiceDiscoveryRegistryType(Map<String, String> parameters)
focal_class.full_signature: public static boolean isServiceDiscoveryRegistryType(Map<String, String> parameters)
focal_class.identifier: isServiceDiscoveryRegistryType
focal_class.modifiers: public static
focal_class.parameters: (Map<String, String> parameters)
focal_class.return: boolean
focal_class.signature: boolean isServiceDiscoveryRegistryType(Map<String, String> parameters)
focal_class.class_method_signature: UrlUtils.isItemMatch(String pattern, String value)
focal_class.full_signature: static boolean isItemMatch(String pattern, String value)
focal_class.identifier: isItemMatch
focal_class.modifiers: static
focal_class.parameters: (String pattern, String value)
focal_class.return: boolean
focal_class.signature: boolean isItemMatch(String pattern, String value)
focal_class.class_method_signature: UrlUtils.parseServiceKey(String serviceKey)
focal_class.full_signature: public static String[] parseServiceKey(String serviceKey)
focal_class.identifier: parseServiceKey
focal_class.modifiers: public static
focal_class.parameters: (String serviceKey)
focal_class.return: String[]
focal_class.signature: String[] parseServiceKey(String serviceKey)
focal_method.body: public static URL parseURL(String address, Map<String, String> defaults) {
          if (address == null || address.length() == 0) {
              return null;
          }
          String url;
          if (address.contains("://") || address.contains(URL_PARAM_STARTING_SYMBOL)) {
              url = address;
          } else {
              String[] addresses = COMMA_SPLIT_PATTERN.split(address);
              url = addresses[0];
              if (addresses.length > 1) {
                  StringBuilder backup = new StringBuilder();
                  for (int i = 1; i < addresses.length; i++) {
                      if (i > 1) {
                          backup.append(',');
                      }
                      backup.append(addresses[i]);
                  }
                  url += URL_PARAM_STARTING_SYMBOL + RemotingConstants.BACKUP_KEY + "=" + backup.toString();
              }
          }
          String defaultProtocol = defaults == null ? null : defaults.get(PROTOCOL_KEY);
          if (defaultProtocol == null || defaultProtocol.length() == 0) {
              defaultProtocol = DUBBO_PROTOCOL;
          }
          String defaultUsername = defaults == null ? null : defaults.get(USERNAME_KEY);
          String defaultPassword = defaults == null ? null : defaults.get(PASSWORD_KEY);
          int defaultPort = StringUtils.parseInteger(defaults == null ? null : defaults.get(PORT_KEY));
          String defaultPath = defaults == null ? null : defaults.get(PATH_KEY);
          Map<String, String> defaultParameters = defaults == null ? null : new HashMap<>(defaults);
          if (defaultParameters != null) {
              defaultParameters.remove(PROTOCOL_KEY);
              defaultParameters.remove(USERNAME_KEY);
              defaultParameters.remove(PASSWORD_KEY);
              defaultParameters.remove(HOST_KEY);
              defaultParameters.remove(PORT_KEY);
              defaultParameters.remove(PATH_KEY);
          }
          URL u = URL.valueOf(url);
          boolean changed = false;
          String protocol = u.getProtocol();
          String username = u.getUsername();
          String password = u.getPassword();
          String host = u.getHost();
          int port = u.getPort();
          String path = u.getPath();
          Map<String, String> parameters = new HashMap<>(u.getParameters());
          if (protocol == null || protocol.length() == 0) {
              changed = true;
              protocol = defaultProtocol;
          }
          if ((username == null || username.length() == 0) && defaultUsername != null && defaultUsername.length() > 0) {
              changed = true;
              username = defaultUsername;
          }
          if ((password == null || password.length() == 0) && defaultPassword != null && defaultPassword.length() > 0) {
              changed = true;
              password = defaultPassword;
          }
          /*if (u.isAnyHost() || u.isLocalHost()) {
              changed = true;
              host = NetUtils.getLocalHost();
          }*/
          if (port <= 0) {
              if (defaultPort > 0) {
                  changed = true;
                  port = defaultPort;
              } else {
                  changed = true;
                  port = 9090;
              }
          }
          if (path == null || path.length() == 0) {
              if (defaultPath != null && defaultPath.length() > 0) {
                  changed = true;
                  path = defaultPath;
              }
          }
          if (defaultParameters != null && defaultParameters.size() > 0) {
              for (Map.Entry<String, String> entry : defaultParameters.entrySet()) {
                  String key = entry.getKey();
                  String defaultValue = entry.getValue();
                  if (defaultValue != null && defaultValue.length() > 0) {
                      String value = parameters.get(key);
                      if (StringUtils.isEmpty(value)) {
                          changed = true;
                          parameters.put(key, defaultValue);
                      }
                  }
              }
          }
          if (changed) {
              u = new URL(protocol, username, password, host, port, path, parameters);
          }
          return u;
      }
focal_method.class_method_signature: UrlUtils.parseURL(String address, Map<String, String> defaults)
focal_method.full_signature: public static URL parseURL(String address, Map<String, String> defaults)
focal_method.identifier: parseURL
focal_method.invocations: length contains contains split append append toString get length get get parseInteger get get remove remove remove remove remove remove valueOf getProtocol getUsername getPassword getHost getPort getPath getParameters length length length length length length length size entrySet getKey getValue length get isEmpty put
focal_method.modifiers: public static
focal_method.parameters: (String address, Map<String, String> defaults)
focal_method.return: URL
focal_method.signature: URL parseURL(String address, Map<String, String> defaults)