Program: 59669
Project: 59669
Buggy source:
/** 
 * We leave a file behind in job submission directory so that clr client can figure out the applicationId and yarn rest endpoint.
 * @param driverFolder
 * @param applicationId
 * @throws IOException
 */
private void writeDriverHttpEndPoint(final File driverFolder,final String applicationId,final Path dfsPath) throws IOException {
  final FileSystem fs=FileSystem.get(yarnConfiguration);
  final Path httpEndpointPath=new Path(dfsPath,fileNames.getDriverHttpEndpoint());
  String trackingUri=null;
  for (int i=0; i < 60; i++) {
    try {
      LOG.log(Level.INFO,"String_Node_Str" + i + "String_Node_Str"+ httpEndpointPath.toString());
      if (fs.exists(httpEndpointPath)) {
        FSDataInputStream input=fs.open(httpEndpointPath);
        BufferedReader reader=new BufferedReader(new InputStreamReader(input,"String_Node_Str"));
        trackingUri=reader.readLine();
        reader.close();
        break;
      }
    }
 catch (    Exception ex) {
    }
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException ex2) {
      break;
    }
  }
  if (null == trackingUri) {
    trackingUri="String_Node_Str";
    LOG.log(Level.WARNING,"String_Node_Str" + httpEndpointPath.toString());
  }
  final File driverHttpEndpointFile=new File(driverFolder,fileNames.getDriverHttpEndpoint());
  BufferedWriter out=new BufferedWriter(new FileWriter(driverHttpEndpointFile));
  out.write(applicationId + "String_Node_Str");
  out.write(trackingUri + "String_Node_Str");
  String addr=yarnConfiguration.get("String_Node_Str");
  if (null == addr || addr.startsWith("String_Node_Str")) {
    String str2=yarnConfiguration.get("String_Node_Str");
    if (null != str2) {
      for (      String rm : str2.split("String_Node_Str")) {
        out.write(yarnConfiguration.get("String_Node_Str" + rm) + "String_Node_Str");
      }
    }
  }
 else {
    out.write(addr + "String_Node_Str");
  }
  out.close();
}

Fixed version (ground truth):
/** 
 * We leave a file behind in job submission directory so that clr client can figure out the applicationId and yarn rest endpoint.
 * @param driverFolder
 * @param applicationId
 * @throws IOException
 */
private void writeDriverHttpEndPoint(final File driverFolder,final String applicationId,final Path dfsPath) throws IOException {
  final FileSystem fs=FileSystem.get(yarnConfiguration);
  final Path httpEndpointPath=new Path(dfsPath,fileNames.getDriverHttpEndpoint());
  String trackingUri=null;
  for (int i=0; i < 60; i++) {
    try {
      LOG.log(Level.INFO,"String_Node_Str" + i + "String_Node_Str"+ httpEndpointPath.toString());
      if (fs.exists(httpEndpointPath)) {
        FSDataInputStream input=fs.open(httpEndpointPath);
        BufferedReader reader=new BufferedReader(new InputStreamReader(input,StandardCharsets.UTF_8));
        trackingUri=reader.readLine();
        reader.close();
        break;
      }
    }
 catch (    Exception ex) {
    }
    try {
      Thread.sleep(1000);
    }
 catch (    InterruptedException ex2) {
      break;
    }
  }
  if (null == trackingUri) {
    trackingUri="String_Node_Str";
    LOG.log(Level.WARNING,"String_Node_Str" + httpEndpointPath.toString());
  }
  final File driverHttpEndpointFile=new File(driverFolder,fileNames.getDriverHttpEndpoint());
  BufferedWriter out=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(driverHttpEndpointFile),StandardCharsets.UTF_8));
  out.write(applicationId + "String_Node_Str");
  out.write(trackingUri + "String_Node_Str");
  String addr=yarnConfiguration.get("String_Node_Str");
  if (null == addr || addr.startsWith("String_Node_Str")) {
    String str2=yarnConfiguration.get("String_Node_Str");
    if (null != str2) {
      for (      String rm : str2.split("String_Node_Str")) {
        out.write(yarnConfiguration.get("String_Node_Str" + rm) + "String_Node_Str");
      }
    }
  }
 else {
    out.write(addr + "String_Node_Str");
  }
  out.close();
}