Program: 30030
Project: 30030
Buggy source:
public String getLogFileForGivenTarget(String targetServerName) throws IOException {
  Server targetServer=domain.getServerNamed(targetServerName);
  String serverNode=targetServer.getNodeRef();
  if (targetServer.isDas()) {
    String logFileDetailsForServer=loggingConfig.getLoggingFileDetails();
    logFileDetailsForServer=TranslatedConfigView.getTranslatedValue(logFileDetailsForServer).toString();
    return logFileDetailsForServer;
  }
 else {
    String logFileDetailsForInstance=getInstanceLogFileDirectory(targetServer);
    Node node=domain.getNodes().getNode(serverNode);
    String loggingDir="String_Node_Str";
    String loggingFile="String_Node_Str";
    if (logFileDetailsForInstance.contains("String_Node_Str") && node.getNodeDir() != null) {
      loggingDir=node.getNodeDir() + File.separator + serverNode+ File.separator+ targetServerName;
      loggingFile=logFileDetailsForInstance.replace("String_Node_Str",loggingDir);
    }
 else     if (logFileDetailsForInstance.contains("String_Node_Str") && node.getInstallDir() != null) {
      loggingDir=node.getInstallDir() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ serverNode+ File.separator+ targetServerName;
      loggingFile=logFileDetailsForInstance.replace("String_Node_Str",loggingDir);
    }
 else {
      loggingFile=logFileDetailsForInstance;
    }
    if (node.isLocal()) {
      return loggingFile;
    }
 else {
      String logFileName=logFileDetailsForInstance.substring(logFileDetailsForInstance.lastIndexOf(File.separator) + 1,logFileDetailsForInstance.length());
      File instanceFile=new LogFilterForInstance().downloadGivenInstanceLogFile(habitat,targetServer,domain,logger,targetServerName,env.getDomainRoot().getAbsolutePath(),logFileName,logFileDetailsForInstance);
      return instanceFile.getAbsolutePath();
    }
  }
}

Fixed version (ground truth):
public String getLogFileForGivenTarget(String targetServerName) throws IOException {
  Server targetServer=domain.getServerNamed(targetServerName);
  String serverNode=targetServer.getNodeRef();
  if (targetServer.isDas()) {
    String logFileDetailsForServer=loggingConfig.getLoggingFileDetails();
    logFileDetailsForServer=TranslatedConfigView.getTranslatedValue(logFileDetailsForServer).toString();
    return logFileDetailsForServer;
  }
 else {
    String logFileDetailsForInstance=getInstanceLogFileDirectory(targetServer);
    Node node=domain.getNodes().getNode(serverNode);
    String loggingDir="String_Node_Str";
    String loggingFile="String_Node_Str";
    if (logFileDetailsForInstance.contains("String_Node_Str") && node.getNodeDir() != null) {
      loggingDir=node.getNodeDir() + File.separator + serverNode+ File.separator+ targetServerName;
      loggingFile=logFileDetailsForInstance.replace("String_Node_Str",loggingDir);
    }
 else     if (logFileDetailsForInstance.contains("String_Node_Str") && node.getInstallDir() != null) {
      loggingDir=node.getInstallDir() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ serverNode+ File.separator+ targetServerName;
      loggingFile=logFileDetailsForInstance.replace("String_Node_Str",loggingDir);
    }
 else {
      loggingFile=logFileDetailsForInstance;
    }
    if (node.isLocal()) {
      return loggingFile;
    }
 else {
      String logFileName=logFileDetailsForInstance.substring(logFileDetailsForInstance.lastIndexOf(File.separator) + 1,logFileDetailsForInstance.length());
      File instanceFile=null;
      try {
        instanceFile=new LogFilterForInstance().downloadGivenInstanceLogFile(habitat,targetServer,domain,logger,targetServerName,env.getDomainRoot().getAbsolutePath(),logFileName,logFileDetailsForInstance);
      }
 catch (      WindowsException we) {
        throw new IOException("String_Node_Str");
      }
      return instanceFile.getAbsolutePath();
    }
  }
}