Program: 59247
Project: 59247
Buggy source:
private URL resolveUrl(){
  final UrlBuilder urlBuilder=UrlBuilder.create();
  final GrapheneConfiguration grapheneConfiguration=this.grapheneConfiguration.get();
  if (grapheneConfiguration.getScheme() != null) {
    urlBuilder.protocol(grapheneConfiguration.getScheme());
  }
  final CubeDockerConfiguration cubeDockerConfiguration=cubeDockerConfigurationInstance.get();
  final String configuredUrl=grapheneConfiguration.getUrl();
  if (configuredUrl != null && !configuredUrl.isEmpty()) {
    if (isAnAbsoluteUrl(configuredUrl) || startWithDockerHost(configuredUrl)) {
      String replacedWithDockerHostUrl=configuredUrl;
      if (isAnAbsoluteUrl(configuredUrl)) {
        replacedWithDockerHostUrl=configuredUrl.substring(1);
      }
      replacedWithDockerHostUrl=replacedWithDockerHostUrl.replace("String_Node_Str",cubeDockerConfiguration.getDockerServerIp());
      urlBuilder.host(resolveHost(replacedWithDockerHostUrl));
      urlBuilder.port(resolvePort(replacedWithDockerHostUrl));
      urlBuilder.context(resolveContext(replacedWithDockerHostUrl));
    }
 else {
      urlBuilder.host(cubeDockerConfiguration.getDockerServerIp());
      urlBuilder.port(resolveBindPort(NO_PORT));
      urlBuilder.context(configuredUrl);
    }
  }
 else {
    urlBuilder.host(cubeDockerConfiguration.getDockerServerIp());
    urlBuilder.port(resolveBindPort(NO_PORT));
  }
  try {
    return urlBuilder.build();
  }
 catch (  MalformedURLException e) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
private URL resolveUrl(){
  final UrlBuilder urlBuilder=UrlBuilder.create();
  final GrapheneConfiguration grapheneConfiguration=this.grapheneConfiguration.get();
  if (grapheneConfiguration.getScheme() != null) {
    urlBuilder.protocol(grapheneConfiguration.getScheme());
  }
  final CubeDockerConfiguration cubeDockerConfiguration=cubeDockerConfigurationInstance.get();
  final String configuredUrl=grapheneConfiguration.getUrl();
  if (configuredUrl != null && !configuredUrl.isEmpty()) {
    if (isAnAbsoluteUrl(configuredUrl) || startWithDockerHost(configuredUrl)) {
      String replacedWithDockerHostUrl=configuredUrl;
      if (isAnAbsoluteUrl(configuredUrl)) {
        replacedWithDockerHostUrl=configuredUrl.substring(1);
      }
      replacedWithDockerHostUrl=replacedWithDockerHostUrl.replace("String_Node_Str",cubeDockerConfiguration.getDockerServerIp());
      urlBuilder.host(resolveHost(replacedWithDockerHostUrl));
      urlBuilder.port(resolvePort(replacedWithDockerHostUrl));
      urlBuilder.context(resolveContext(replacedWithDockerHostUrl));
    }
 else {
      final SinglePortBindResolver.PortBindInfo portBindInfo=resolveBindPort(NO_PORT);
      urlBuilder.host(getInternalIp(cubeDockerConfiguration,portBindInfo));
      urlBuilder.port(portBindInfo.getBindPort());
      urlBuilder.context(configuredUrl);
    }
  }
 else {
    final SinglePortBindResolver.PortBindInfo portBindInfo=resolveBindPort(NO_PORT);
    urlBuilder.host(getInternalIp(cubeDockerConfiguration,portBindInfo));
    urlBuilder.port(portBindInfo.getBindPort());
  }
  try {
    return urlBuilder.build();
  }
 catch (  MalformedURLException e) {
    throw new IllegalStateException("String_Node_Str");
  }
}