Program: 18384
Project: 18384
Buggy source:
public void merge(FSTTerminal node) throws ContentMergeException {
  String body=node.getBody() + "String_Node_Str";
  String[] tokens=body.split(FSTGenMerger.MERGE_SEPARATOR);
  try {
    tokens[0]=tokens[0].replace(FSTGenMerger.SEMANTIC_MERGE_MARKER,"String_Node_Str").trim();
    tokens[1]=tokens[1].trim();
    tokens[2]=tokens[2].trim();
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    System.err.println("String_Node_Str" + body + "String_Node_Str");
    e.printStackTrace();
  }
  if (!(node.getType().contains("String_Node_Str") || node.getMergingMechanism().equals("String_Node_Str"))) {
    if (tokens[0].length() == 0 && tokens[1].length() == 0 && tokens[2].length() == 0) {
      node.setBody("String_Node_Str");
    }
 else     if (tokens[0].equals(tokens[2])) {
      node.setBody(tokens[0]);
    }
 else     if (tokens[0].equals(tokens[1]) && tokens[2].length() > 0) {
      node.setBody(tokens[2]);
    }
 else     if (tokens[2].equals(tokens[1]) && tokens[0].length() > 0) {
      node.setBody(tokens[0]);
    }
 else     if (tokens[0].equals(tokens[1]) && tokens[2].length() == 0) {
      node.setBody("String_Node_Str");
    }
 else     if (tokens[2].equals(tokens[1]) && tokens[0].length() == 0) {
      node.setBody("String_Node_Str");
    }
    return;
  }
  try {
    File tmpDir=new File(System.getProperty("String_Node_Str") + File.separator + "String_Node_Str");
    tmpDir.mkdir();
    File fileVar1=File.createTempFile("String_Node_Str","String_Node_Str",tmpDir);
    File fileBase=File.createTempFile("String_Node_Str","String_Node_Str",tmpDir);
    File fileVar2=File.createTempFile("String_Node_Str","String_Node_Str",tmpDir);
    BufferedWriter writerVar1=new BufferedWriter(new FileWriter(fileVar1));
    if (node.getType().contains("String_Node_Str") || tokens[0].length() == 0)     writerVar1.write(tokens[0]);
 else     writerVar1.write(tokens[0] + "String_Node_Str");
    writerVar1.close();
    BufferedWriter writerBase=new BufferedWriter(new FileWriter(fileBase));
    if (node.getType().contains("String_Node_Str") || tokens[1].length() == 0)     writerBase.write(tokens[1]);
 else     writerBase.write(tokens[1] + "String_Node_Str");
    writerBase.close();
    BufferedWriter writerVar2=new BufferedWriter(new FileWriter(fileVar2));
    if (node.getType().contains("String_Node_Str") || tokens[2].length() == 0)     writerVar2.write(tokens[2]);
 else     writerVar2.write(tokens[2] + "String_Node_Str");
    writerVar2.close();
    String mergeCmd="String_Node_Str";
    if (System.getProperty("String_Node_Str").contains("String_Node_Str"))     mergeCmd="String_Node_Str" + "String_Node_Str" + fileVar1.getPath() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ fileBase.getPath()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ fileVar2.getPath()+ "String_Node_Str";
 else     mergeCmd="String_Node_Str" + fileVar1.getPath() + "String_Node_Str"+ fileBase.getPath()+ "String_Node_Str"+ fileVar2.getPath();
    Runtime run=Runtime.getRuntime();
    Process pr=run.exec(mergeCmd);
    BufferedReader buf=new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String line="String_Node_Str";
    String res="String_Node_Str";
    while ((line=buf.readLine()) != null) {
      res+=line + "String_Node_Str";
    }
    node.setBody(res);
    buf=new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    while ((line=buf.readLine()) != null) {
      System.err.println(line);
    }
    fileVar1.delete();
    fileBase.delete();
    fileVar2.delete();
    tmpDir.delete();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public void merge(FSTTerminal node) throws ContentMergeException {
  String body=node.getBody() + "String_Node_Str";
  String[] tokens=body.split(FSTGenMerger.MERGE_SEPARATOR);
  try {
    tokens[0]=tokens[0].replace(FSTGenMerger.SEMANTIC_MERGE_MARKER,"String_Node_Str").trim();
    tokens[1]=tokens[1].trim();
    tokens[2]=tokens[2].trim();
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    System.err.println("String_Node_Str" + body + "String_Node_Str");
    e.printStackTrace();
  }
  if (!(node.getType().contains("String_Node_Str") || node.getMergingMechanism().equals("String_Node_Str"))) {
    if (tokens[0].length() == 0 && tokens[1].length() == 0 && tokens[2].length() == 0) {
      node.setBody("String_Node_Str");
    }
 else     if (tokens[0].equals(tokens[2])) {
      node.setBody(tokens[0]);
    }
 else     if (tokens[0].equals(tokens[1]) && tokens[2].length() > 0) {
      node.setBody(tokens[2]);
    }
 else     if (tokens[2].equals(tokens[1]) && tokens[0].length() > 0) {
      node.setBody(tokens[0]);
    }
 else     if (tokens[0].equals(tokens[1]) && tokens[2].length() == 0) {
      node.setBody("String_Node_Str");
    }
 else     if (tokens[2].equals(tokens[1]) && tokens[0].length() == 0) {
      node.setBody("String_Node_Str");
    }
    return;
  }
  try {
    File tmpDir=new File(System.getProperty("String_Node_Str") + File.separator + "String_Node_Str");
    tmpDir.mkdir();
    File fileVar1=File.createTempFile("String_Node_Str","String_Node_Str",tmpDir);
    File fileBase=File.createTempFile("String_Node_Str","String_Node_Str",tmpDir);
    File fileVar2=File.createTempFile("String_Node_Str","String_Node_Str",tmpDir);
    BufferedWriter writerVar1=new BufferedWriter(new FileWriter(fileVar1));
    if (node.getType().contains("String_Node_Str") || tokens[0].length() == 0)     writerVar1.write(tokens[0]);
 else     writerVar1.write(tokens[0] + "String_Node_Str");
    writerVar1.close();
    BufferedWriter writerBase=new BufferedWriter(new FileWriter(fileBase));
    if (node.getType().contains("String_Node_Str") || tokens[1].length() == 0)     writerBase.write(tokens[1]);
 else     writerBase.write(tokens[1] + "String_Node_Str");
    writerBase.close();
    BufferedWriter writerVar2=new BufferedWriter(new FileWriter(fileVar2));
    if (node.getType().contains("String_Node_Str") || tokens[2].length() == 0)     writerVar2.write(tokens[2]);
 else     writerVar2.write(tokens[2] + "String_Node_Str");
    writerVar2.close();
    String mergeCmd="String_Node_Str";
    if (System.getProperty("String_Node_Str").contains("String_Node_Str"))     mergeCmd="String_Node_Str" + "String_Node_Str" + fileVar1.getPath() + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ fileBase.getPath()+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ fileVar2.getPath()+ "String_Node_Str";
 else     mergeCmd="String_Node_Str" + fileVar1.getPath() + "String_Node_Str"+ fileBase.getPath()+ "String_Node_Str"+ fileVar2.getPath();
    Runtime run=Runtime.getRuntime();
    Process pr=run.exec(mergeCmd);
    BufferedReader buf=new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String line="String_Node_Str";
    String res="String_Node_Str";
    while ((line=buf.readLine()) != null) {
      res+=line + "String_Node_Str";
    }
    pr.getInputStream().close();
    node.setBody(res);
    buf=new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    while ((line=buf.readLine()) != null) {
      System.err.println(line);
    }
    pr.getErrorStream().close();
    pr.getOutputStream().close();
    fileVar1.delete();
    fileBase.delete();
    fileVar2.delete();
    tmpDir.delete();
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}