Program: 105298
Project: 105298
Buggy source:
public static byte[] changeVmdkContentBaseInfo(byte[] vmdkContent,String baseFileName,String parentFileName) throws IOException {
  assert(vmdkContent != null);
  BufferedReader in=null;
  BufferedWriter out=null;
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  try {
    in=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkContent)));
    out=new BufferedWriter(new OutputStreamWriter(bos));
    String line;
    while ((line=in.readLine()) != null) {
      line=line.trim();
      if (line.isEmpty()) {
        out.newLine();
        continue;
      }
      if (line.charAt(0) == '#') {
        out.write(line);
        out.newLine();
        continue;
      }
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length == 2) {
        String name=tokens[0].trim();
        String value=tokens[1].trim();
        if (value.charAt(0) == '\"')         value=value.substring(1,value.length() - 1);
        if (parentFileName != null && name.equals("String_Node_Str")) {
          out.write(name + "String_Node_Str" + parentFileName+ "String_Node_Str");
          out.newLine();
        }
 else {
          out.write(line);
          out.newLine();
        }
      }
 else {
        if (line.startsWith("String_Node_Str")) {
          if (baseFileName != null) {
            int startPos=line.indexOf('\"');
            int endPos=line.lastIndexOf('\"');
            assert(startPos > 0);
            assert(endPos > 0);
            out.write(line.substring(0,startPos + 1));
            out.write(baseFileName);
            out.write(line.substring(endPos));
            out.newLine();
          }
 else {
            out.write(line);
            out.newLine();
          }
        }
 else {
          s_logger.warn("String_Node_Str" + line);
        }
      }
    }
  }
  finally {
    if (in != null)     in.close();
    if (out != null)     out.close();
  }
  return bos.toByteArray();
}

Fixed version (ground truth):
public static byte[] changeVmdkContentBaseInfo(byte[] vmdkContent,String baseFileName,String parentFileName) throws IOException {
  assert(vmdkContent != null);
  BufferedReader in=null;
  BufferedWriter out=null;
  ByteArrayOutputStream bos=new ByteArrayOutputStream();
  try {
    in=new BufferedReader(new InputStreamReader(new ByteArrayInputStream(vmdkContent),"String_Node_Str"));
    out=new BufferedWriter(new OutputStreamWriter(bos,"String_Node_Str"));
    String line;
    while ((line=in.readLine()) != null) {
      line=line.trim();
      if (line.isEmpty()) {
        out.newLine();
        continue;
      }
      if (line.charAt(0) == '#') {
        out.write(line);
        out.newLine();
        continue;
      }
      String[] tokens=line.split("String_Node_Str");
      if (tokens.length == 2) {
        String name=tokens[0].trim();
        String value=tokens[1].trim();
        if (value.charAt(0) == '\"')         value=value.substring(1,value.length() - 1);
        if (parentFileName != null && name.equals("String_Node_Str")) {
          out.write(name + "String_Node_Str" + parentFileName+ "String_Node_Str");
          out.newLine();
        }
 else {
          out.write(line);
          out.newLine();
        }
      }
 else {
        if (line.startsWith("String_Node_Str")) {
          if (baseFileName != null) {
            int startPos=line.indexOf('\"');
            int endPos=line.lastIndexOf('\"');
            assert(startPos > 0);
            assert(endPos > 0);
            out.write(line.substring(0,startPos + 1));
            out.write(baseFileName);
            out.write(line.substring(endPos));
            out.newLine();
          }
 else {
            out.write(line);
            out.newLine();
          }
        }
 else {
          s_logger.warn("String_Node_Str" + line);
        }
      }
    }
  }
  finally {
    if (in != null)     in.close();
    if (out != null)     out.close();
  }
  return bos.toByteArray();
}