Program: 49363
Project: 49363
Buggy source:
/** 
 * Migrates subscription data. Must be called per-org.
 * @param orgid The id of the owner/organization for which to migrate subscription data
 */
private void migrateSubscriptionData(String orgid) throws DatabaseException, SQLException {
  this.logger.info("String_Node_Str" + orgid);
  ResultSet subscriptionids=this.executeQuery("String_Node_Str",orgid);
  while (subscriptionids.next()) {
    String subid=subscriptionids.getString(1);
    String subuuid=this.generateUUID();
    this.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",subuuid,orgid,orgid,orgid,subid);
    ResultSet sourcesub=this.executeQuery("String_Node_Str" + "String_Node_Str",subid);
    while (sourcesub.next()) {
      this.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str",this.generateUUID(),subuuid,sourcesub.getString(3),sourcesub.getString(4),sourcesub.getDate(5),sourcesub.getDate(6));
    }
    sourcesub.close();
    ResultSet branding=this.executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",orgid,subid);
    while (branding.next()) {
      String brandingid=branding.getString(1);
      String brandinguuid=this.generateUUID();
      this.executeUpdate("String_Node_Str" + "String_Node_Str",brandinguuid,branding.getDate(2),branding.getDate(3),branding.getString(4),branding.getString(5),branding.getString(6));
      this.executeUpdate("String_Node_Str" + "String_Node_Str",subuuid,brandinguuid);
    }
    branding.close();
    this.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",subuuid,orgid,subid);
    this.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",subuuid,orgid,subid);
  }
  subscriptionids.close();
}

Fixed version (ground truth):
/** 
 * Migrates subscription data. Must be called per-org.
 * @param orgid The id of the owner/organization for which to migrate subscription data
 */
private void migrateSubscriptionData(String orgid) throws DatabaseException, SQLException {
  this.logger.info("String_Node_Str" + orgid);
  ResultSet subscriptionids=this.executeQuery("String_Node_Str",orgid);
  while (subscriptionids.next()) {
    String subid=subscriptionids.getString(1);
    String subuuid=Util.generateDbUUID();
    this.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",subuuid,orgid,orgid,orgid,subid);
    ResultSet sourcesub=this.executeQuery("String_Node_Str" + "String_Node_Str",subid);
    while (sourcesub.next()) {
      this.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str",Util.generateDbUUID(),subuuid,sourcesub.getString(3),sourcesub.getString(4),sourcesub.getDate(5),sourcesub.getDate(6));
    }
    sourcesub.close();
    ResultSet branding=this.executeQuery("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str",orgid,subid);
    while (branding.next()) {
      String brandingid=branding.getString(1);
      String brandinguuid=Util.generateDbUUID();
      this.executeUpdate("String_Node_Str" + "String_Node_Str",brandinguuid,branding.getDate(2),branding.getDate(3),branding.getString(4),branding.getString(5),branding.getString(6));
      this.executeUpdate("String_Node_Str" + "String_Node_Str",subuuid,brandinguuid);
    }
    branding.close();
    this.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",subuuid,orgid,subid);
    this.executeUpdate("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",subuuid,orgid,subid);
  }
  subscriptionids.close();
}