Program: 83057
Project: 83057
Buggy source:
private String writeSerializationPolicyFile(TreeLogger logger,GeneratorContext ctx,SerializableTypeOracle sto) throws UnableToCompleteException {
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    OutputStreamWriter osw=new OutputStreamWriter(baos,SerializationPolicyLoader.SERIALIZATION_POLICY_FILE_ENCODING);
    PrintWriter pw=new PrintWriter(osw);
    JType[] serializableTypes=sto.getSerializableTypes();
    for (int i=0; i < serializableTypes.length; ++i) {
      JType serializableType=serializableTypes[i];
      String binaryTypeName=sto.getSerializedTypeName(serializableType);
      boolean maybeInstantiated=sto.maybeInstantiated(serializableType);
      pw.println(binaryTypeName + "String_Node_Str" + Boolean.toString(maybeInstantiated));
    }
    pw.close();
    byte[] serializationPolicyFileContents=baos.toByteArray();
    MessageDigest md5=MessageDigest.getInstance("String_Node_Str");
    md5.update(serializationPolicyFileContents);
    String serializationPolicyName=Util.toHexString(md5.digest());
    String serializationPolicyFileName=SerializationPolicyLoader.getSerializationPolicyFileName(serializationPolicyName);
    OutputStream os=ctx.tryCreateResource(logger,serializationPolicyFileName);
    if (os != null) {
      os.write(serializationPolicyFileContents);
      ctx.commitResource(logger,os);
    }
 else {
      logger.log(TreeLogger.TRACE,"String_Node_Str" + serviceIntf.getQualifiedSourceName() + "String_Node_Str",null);
    }
    return serializationPolicyName;
  }
 catch (  NoSuchAlgorithmException e) {
    logger.log(TreeLogger.ERROR,"String_Node_Str",e);
    throw new UnableToCompleteException();
  }
catch (  UnsupportedEncodingException e) {
    logger.log(TreeLogger.ERROR,SerializationPolicyLoader.SERIALIZATION_POLICY_FILE_ENCODING + "String_Node_Str",e);
    throw new UnableToCompleteException();
  }
catch (  IOException e) {
    logger.log(TreeLogger.ERROR,null,e);
    throw new UnableToCompleteException();
  }
}

Fixed version (ground truth):
private String writeSerializationPolicyFile(TreeLogger logger,GeneratorContext ctx,SerializableTypeOracle sto) throws UnableToCompleteException {
  try {
    ByteArrayOutputStream baos=new ByteArrayOutputStream();
    OutputStreamWriter osw=new OutputStreamWriter(baos,SerializationPolicyLoader.SERIALIZATION_POLICY_FILE_ENCODING);
    PrintWriter pw=new PrintWriter(osw);
    JType[] serializableTypes=sto.getSerializableTypes();
    for (int i=0; i < serializableTypes.length; ++i) {
      JType serializableType=serializableTypes[i];
      String binaryTypeName=sto.getSerializedTypeName(serializableType);
      boolean maybeInstantiated=sto.maybeInstantiated(serializableType);
      pw.println(binaryTypeName + "String_Node_Str" + Boolean.toString(maybeInstantiated));
    }
    pw.close();
    byte[] serializationPolicyFileContents=baos.toByteArray();
    String serializationPolicyName=Util.computeStrongName(serializationPolicyFileContents);
    String serializationPolicyFileName=SerializationPolicyLoader.getSerializationPolicyFileName(serializationPolicyName);
    OutputStream os=ctx.tryCreateResource(logger,serializationPolicyFileName);
    if (os != null) {
      os.write(serializationPolicyFileContents);
      ctx.commitResource(logger,os);
    }
 else {
      logger.log(TreeLogger.TRACE,"String_Node_Str" + serviceIntf.getQualifiedSourceName() + "String_Node_Str",null);
    }
    return serializationPolicyName;
  }
 catch (  UnsupportedEncodingException e) {
    logger.log(TreeLogger.ERROR,SerializationPolicyLoader.SERIALIZATION_POLICY_FILE_ENCODING + "String_Node_Str",e);
    throw new UnableToCompleteException();
  }
catch (  IOException e) {
    logger.log(TreeLogger.ERROR,null,e);
    throw new UnableToCompleteException();
  }
}