Program: 85159
Project: 85159
Buggy source:
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void doExportUrls(){
  List<URL> registryURLs=loadRegistries();
  for (  ProtocolConfig protocolConfig : protocols) {
    String name=protocolConfig.getName();
    if (name == null || name.length() == 0) {
      name="String_Node_Str";
    }
    String host=protocolConfig.getHost();
    if (provider != null && (host == null || host.length() == 0)) {
      host=provider.getHost();
    }
    boolean anyhost=false;
    if (NetUtils.isInvalidLocalHost(host)) {
      anyhost=true;
      try {
        host=InetAddress.getLocalHost().getHostAddress();
      }
 catch (      UnknownHostException e) {
        logger.warn(e.getMessage(),e);
      }
      if (NetUtils.isInvalidLocalHost(host)) {
        if (registryURLs != null && registryURLs.size() > 0) {
          for (          URL registryURL : registryURLs) {
            try {
              Socket socket=new Socket(registryURL.getHost(),registryURL.getPort());
              try {
                host=socket.getLocalAddress().getHostAddress();
                break;
              }
  finally {
                socket.close();
              }
            }
 catch (            Exception e) {
              logger.warn(e.getMessage(),e);
            }
          }
        }
        if (NetUtils.isInvalidLocalHost(host)) {
          host=NetUtils.getLocalHost();
        }
      }
    }
    Integer port=protocolConfig.getPort();
    if (provider != null && (port == null || port == 0)) {
      port=provider.getPort();
    }
    if (port == null || port == 0) {
      port=ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(name).getDefaultPort();
    }
    if (port == null || port <= 0) {
      port=NetUtils.getAvailablePort();
      logger.warn("String_Node_Str" + port + "String_Node_Str"+ name);
    }
    Map<String,String> map=new HashMap<String,String>();
    if (anyhost) {
      map.put(Constants.ANYHOST_KEY,"String_Node_Str");
    }
    map.put("String_Node_Str",Version.getVersion());
    appendParameters(map,application);
    appendParameters(map,provider);
    appendParameters(map,protocolConfig);
    appendParameters(map,this);
    map.put("String_Node_Str","String_Node_Str");
    if (methods != null && methods.size() > 0) {
      for (      MethodConfig method : methods) {
        appendParameters(map,method,method.getName());
        List<ArgumentConfig> arguments=method.getArguments();
        if (arguments != null && arguments.size() > 0) {
          for (          ArgumentConfig argument : arguments) {
            if (argument.getType() != null && argument.getType().length() > 0) {
              Method[] methods=interfaceClass.getMethods();
              if (methods != null && methods.length > 0) {
                for (int i=0; i < methods.length; i++) {
                  String methodName=methods[i].getName();
                  if (methodName.equals(method.getName())) {
                    Class<?>[] argtypes=methods[i].getParameterTypes();
                    if (argument.getIndex() != -1) {
                      if (argtypes[argument.getIndex()].getName().equals(argument.getType())) {
                        appendParameters(map,argument,method.getName() + "String_Node_Str" + argument.getIndex());
                      }
 else {
                        throw new IllegalArgumentException("String_Node_Str" + argument.getIndex() + "String_Node_Str"+ argument.getType());
                      }
                    }
 else {
                      for (int j=0; j < argtypes.length; j++) {
                        Class<?> argclazz=argtypes[j];
                        if (argclazz.getName().equals(argument.getType())) {
                          appendParameters(map,argument,method.getName() + "String_Node_Str" + j);
                          if (argument.getIndex() != -1 && argument.getIndex() != j) {
                            throw new IllegalArgumentException("String_Node_Str" + argument.getIndex() + "String_Node_Str"+ argument.getType());
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
 else             if (argument.getIndex() != -1) {
              appendParameters(map,argument,method.getName() + "String_Node_Str" + argument.getIndex());
            }
 else {
              throw new IllegalArgumentException("String_Node_Str");
            }
          }
        }
      }
    }
    if (generic) {
      map.put("String_Node_Str",String.valueOf(true));
      map.put("String_Node_Str",Constants.ANY_VALUE);
    }
 else {
      map.put("String_Node_Str",Version.getVersion(interfaceClass,version));
      map.put("String_Node_Str",StringUtils.join(new HashSet<String>(Arrays.asList(Wrapper.getWrapper(interfaceClass).getDeclaredMethodNames())),"String_Node_Str"));
    }
    if (!ConfigUtils.isEmpty(token)) {
      if (ConfigUtils.isDefault(token)) {
        map.put("String_Node_Str",UUID.randomUUID().toString());
      }
 else {
        map.put("String_Node_Str",token);
      }
    }
    if ("String_Node_Str".equals(protocolConfig.getName())) {
      protocolConfig.setPort(0);
      protocolConfig.setRegister(false);
      map.put("String_Node_Str","String_Node_Str");
    }
    String contextPath=protocolConfig.getContextpath();
    if ((contextPath == null || contextPath.length() == 0) && provider != null) {
      contextPath=provider.getContextpath();
    }
    URL url=new URL(name,host,port,(contextPath == null || contextPath.length() == 0 ? "String_Node_Str" : contextPath + "String_Node_Str") + path,map);
    if (logger.isInfoEnabled()) {
      logger.info("String_Node_Str" + interfaceClass.getName() + "String_Node_Str"+ url);
    }
    if (registryURLs != null && registryURLs.size() > 0 && url.getParameter("String_Node_Str",true)) {
      for (      URL registryURL : registryURLs) {
        URL monitorUrl=loadMonitor(registryURL);
        if (monitorUrl != null) {
          url=url.addParameterAndEncoded(Constants.MONITOR_KEY,monitorUrl.toFullString());
        }
        String providerURL=url.toFullString();
        if (logger.isInfoEnabled()) {
          logger.info("String_Node_Str" + interfaceClass.getName() + "String_Node_Str"+ providerURL+ "String_Node_Str"+ registryURL);
        }
        Invoker<?> invoker=proxyFactory.getInvoker(ref,(Class)interfaceClass,registryURL.addParameterAndEncoded(RpcConstants.EXPORT_KEY,providerURL));
        Exporter<?> exporter=protocol.export(invoker);
        exporters.add(exporter);
      }
    }
 else {
      Invoker<?> invoker=proxyFactory.getInvoker(ref,(Class)interfaceClass,url);
      Exporter<?> exporter=protocol.export(invoker);
      exporters.add(exporter);
    }
    this.urls.add(url);
  }
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void doExportUrls(){
  List<URL> registryURLs=loadRegistries();
  for (  ProtocolConfig protocolConfig : protocols) {
    String name=protocolConfig.getName();
    if (name == null || name.length() == 0) {
      name="String_Node_Str";
    }
    String host=protocolConfig.getHost();
    if (provider != null && (host == null || host.length() == 0)) {
      host=provider.getHost();
    }
    boolean anyhost=false;
    if (NetUtils.isInvalidLocalHost(host)) {
      anyhost=true;
      try {
        host=InetAddress.getLocalHost().getHostAddress();
      }
 catch (      UnknownHostException e) {
        logger.warn(e.getMessage(),e);
      }
      if (NetUtils.isInvalidLocalHost(host)) {
        if (registryURLs != null && registryURLs.size() > 0) {
          for (          URL registryURL : registryURLs) {
            try {
              Socket socket=new Socket(registryURL.getHost(),registryURL.getPort());
              try {
                host=socket.getLocalAddress().getHostAddress();
                break;
              }
  finally {
                socket.close();
              }
            }
 catch (            Exception e) {
              logger.warn(e.getMessage(),e);
            }
          }
        }
        if (NetUtils.isInvalidLocalHost(host)) {
          host=NetUtils.getLocalHost();
        }
      }
    }
    Integer port=protocolConfig.getPort();
    if (provider != null && (port == null || port == 0)) {
      port=provider.getPort();
    }
    if (port == null || port == 0) {
      port=ExtensionLoader.getExtensionLoader(Protocol.class).getExtension(name).getDefaultPort();
    }
    if (port == null || port <= 0) {
      port=NetUtils.getAvailablePort();
      logger.warn("String_Node_Str" + port + "String_Node_Str"+ name);
    }
    Map<String,String> map=new HashMap<String,String>();
    if (anyhost) {
      map.put(Constants.ANYHOST_KEY,"String_Node_Str");
    }
    map.put("String_Node_Str",Version.getVersion());
    appendParameters(map,application);
    appendParameters(map,provider);
    appendParameters(map,protocolConfig);
    appendParameters(map,this);
    map.put("String_Node_Str","String_Node_Str");
    if (methods != null && methods.size() > 0) {
      for (      MethodConfig method : methods) {
        appendParameters(map,method,method.getName());
        List<ArgumentConfig> arguments=method.getArguments();
        if (arguments != null && arguments.size() > 0) {
          for (          ArgumentConfig argument : arguments) {
            if (argument.getType() != null && argument.getType().length() > 0) {
              Method[] methods=interfaceClass.getMethods();
              if (methods != null && methods.length > 0) {
                for (int i=0; i < methods.length; i++) {
                  String methodName=methods[i].getName();
                  if (methodName.equals(method.getName())) {
                    Class<?>[] argtypes=methods[i].getParameterTypes();
                    if (argument.getIndex() != -1) {
                      if (argtypes[argument.getIndex()].getName().equals(argument.getType())) {
                        appendParameters(map,argument,method.getName() + "String_Node_Str" + argument.getIndex());
                      }
 else {
                        throw new IllegalArgumentException("String_Node_Str" + argument.getIndex() + "String_Node_Str"+ argument.getType());
                      }
                    }
 else {
                      for (int j=0; j < argtypes.length; j++) {
                        Class<?> argclazz=argtypes[j];
                        if (argclazz.getName().equals(argument.getType())) {
                          appendParameters(map,argument,method.getName() + "String_Node_Str" + j);
                          if (argument.getIndex() != -1 && argument.getIndex() != j) {
                            throw new IllegalArgumentException("String_Node_Str" + argument.getIndex() + "String_Node_Str"+ argument.getType());
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
 else             if (argument.getIndex() != -1) {
              appendParameters(map,argument,method.getName() + "String_Node_Str" + argument.getIndex());
            }
 else {
              throw new IllegalArgumentException("String_Node_Str");
            }
          }
        }
      }
    }
    if (generic) {
      map.put("String_Node_Str",String.valueOf(true));
      map.put("String_Node_Str",Constants.ANY_VALUE);
    }
 else {
      map.put("String_Node_Str",Version.getVersion(interfaceClass,version));
      map.put("String_Node_Str",StringUtils.join(new HashSet<String>(Arrays.asList(Wrapper.getWrapper(interfaceClass).getDeclaredMethodNames())),"String_Node_Str"));
    }
    if (!ConfigUtils.isEmpty(token)) {
      if (ConfigUtils.isDefault(token)) {
        map.put("String_Node_Str",UUID.randomUUID().toString());
      }
 else {
        map.put("String_Node_Str",token);
      }
    }
    if ("String_Node_Str".equals(protocolConfig.getName())) {
      protocolConfig.setRegister(false);
      map.put("String_Node_Str","String_Node_Str");
    }
    String contextPath=protocolConfig.getContextpath();
    if ((contextPath == null || contextPath.length() == 0) && provider != null) {
      contextPath=provider.getContextpath();
    }
    URL url=new URL(name,host,port,(contextPath == null || contextPath.length() == 0 ? "String_Node_Str" : contextPath + "String_Node_Str") + path,map);
    if (logger.isInfoEnabled()) {
      logger.info("String_Node_Str" + interfaceClass.getName() + "String_Node_Str"+ url);
    }
    if (registryURLs != null && registryURLs.size() > 0 && url.getParameter("String_Node_Str",true)) {
      for (      URL registryURL : registryURLs) {
        URL monitorUrl=loadMonitor(registryURL);
        if (monitorUrl != null) {
          url=url.addParameterAndEncoded(Constants.MONITOR_KEY,monitorUrl.toFullString());
        }
        String providerURL=url.toFullString();
        if (logger.isInfoEnabled()) {
          logger.info("String_Node_Str" + interfaceClass.getName() + "String_Node_Str"+ providerURL+ "String_Node_Str"+ registryURL);
        }
        Invoker<?> invoker=proxyFactory.getInvoker(ref,(Class)interfaceClass,registryURL.addParameterAndEncoded(RpcConstants.EXPORT_KEY,providerURL));
        Exporter<?> exporter=protocol.export(invoker);
        exporters.add(exporter);
      }
    }
 else {
      Invoker<?> invoker=proxyFactory.getInvoker(ref,(Class)interfaceClass,url);
      Exporter<?> exporter=protocol.export(invoker);
      exporters.add(exporter);
    }
    this.urls.add(url);
  }
}