Program: 169164
Project: 169164
Buggy source:
@Override protected void writeScript(Writer wr,String exitcodefile,String stdout,String stderr) throws IOException {
  Task task=getTask();
  JobSpecification spec=getSpec();
  Properties properties=Properties.getProperties();
  getSpec().unpackProviderAttributes();
  validate(task);
  writeHeader(wr);
  String sJobType=(String)spec.getAttribute("String_Node_Str");
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + sJobType);
  }
  RunMode runMode=getRunMode(sJobType);
  if (spec.getAttribute("String_Node_Str") != null) {
    runMode=RunMode.APRUN;
  }
  wr.write("String_Node_Str");
  wr.write("String_Node_Str" + task.getName() + '\n');
  wr.write("String_Node_Str");
  writeNonEmptyAttr("String_Node_Str","String_Node_Str",wr);
  writeCountAndPPN(spec,wr);
  writeWallTime(wr);
  writeNonEmptyAttr("String_Node_Str","String_Node_Str",wr);
  wr.write("String_Node_Str" + quote(stdout) + '\n');
  wr.write("String_Node_Str" + quote(stderr) + '\n');
  for (  String name : spec.getEnvironmentVariableNames()) {
    wr.write("String_Node_Str");
    wr.write(name);
    wr.write('=');
    wr.write(quote(spec.getEnvironmentVariable(name)));
    wr.write('\n');
  }
  if (spec.getEnvironmentVariableNames().size() > 0) {
    wr.write("String_Node_Str" + join(spec.getEnvironmentVariableNames(),"String_Node_Str") + '\n');
  }
  String resources=(String)spec.getAttribute("String_Node_Str");
  if (resources != null && resources.length() > 0) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + resources);
    wr.write("String_Node_Str" + resources + '\n');
  }
  if (sJobType != null) {
    writeWrapper(wr,sJobType);
  }
  writePreamble(wr,runMode,"String_Node_Str",exitcodefile);
  writeCommand(wr,runMode);
  writePostamble(wr,runMode,exitcodefile,stdout,stderr);
  wr.close();
}

Fixed version (ground truth):
@Override protected void writeScript(Writer wr,String exitcodefile,String stdout,String stderr) throws IOException {
  Task task=getTask();
  JobSpecification spec=getSpec();
  Properties properties=Properties.getProperties();
  getSpec().unpackProviderAttributes();
  validate(task);
  writeHeader(wr);
  String sJobType=(String)spec.getAttribute("String_Node_Str");
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str" + sJobType);
  }
  RunMode runMode=getRunMode(sJobType);
  if (spec.getAttribute("String_Node_Str") != null) {
    runMode=RunMode.APRUN;
  }
  wr.write("String_Node_Str");
  wr.write("String_Node_Str" + task.getName() + '\n');
  wr.write("String_Node_Str");
  writeNonEmptyAttr("String_Node_Str","String_Node_Str",wr);
  writeCountAndPPN(spec,wr);
  writeWallTime(wr);
  writeNonEmptyAttr("String_Node_Str","String_Node_Str",wr);
  wr.write("String_Node_Str" + quote(stdout) + '\n');
  wr.write("String_Node_Str" + quote(stderr) + '\n');
  if (spec.getEnvironmentVariableNames().size() > 0) {
    wr.write("String_Node_Str" + join(spec.getEnvironmentVariableNames(),"String_Node_Str") + '\n');
  }
  for (  String name : spec.getEnvironmentVariableNames()) {
    wr.write("String_Node_Str");
    wr.write(name);
    wr.write('=');
    wr.write(quote(spec.getEnvironmentVariable(name)));
    wr.write('\n');
  }
  String resources=(String)spec.getAttribute("String_Node_Str");
  if (resources != null && resources.length() > 0) {
    if (logger.isDebugEnabled())     logger.debug("String_Node_Str" + resources);
    wr.write("String_Node_Str" + resources + '\n');
  }
  if (sJobType != null) {
    writeWrapper(wr,sJobType);
  }
  writePreamble(wr,runMode,"String_Node_Str",exitcodefile);
  writeCommand(wr,runMode);
  writePostamble(wr,runMode,exitcodefile,stdout,stderr);
  wr.close();
}