Program: 52245
Project: 52245
Buggy source:
/** 
 * Take an InProgressSubmission and turn it into a fully-archived Item.
 * @param c  current context
 * @param is submission to install
 * @param suppliedHandle the existing Handle to give the installed item
 * @return the fully archived Item
 */
public static Item installItem(Context c,InProgressSubmission is,String suppliedHandle) throws SQLException, IOException, AuthorizeException {
  Item item=is.getItem();
  String handle;
  DCDate now=DCDate.getCurrent();
  item.addDC("String_Node_Str","String_Node_Str",null,now.toString());
  item.addDC("String_Node_Str","String_Node_Str",null,now.toString());
  DCValue[] currentDateIssued=item.getDC("String_Node_Str","String_Node_Str",Item.ANY);
  if (currentDateIssued.length == 0) {
    item.addDC("String_Node_Str","String_Node_Str",null,now.toString());
  }
  if (suppliedHandle == null) {
    handle=HandleManager.createHandle(c,item);
  }
 else {
    handle=HandleManager.createHandle(c,item,suppliedHandle);
  }
  String handleref=HandleManager.getCanonicalForm(handle);
  item.addDC("String_Node_Str","String_Node_Str",null,handleref);
  String provDescription="String_Node_Str" + now + "String_Node_Str"+ getBitstreamProvenanceMessage(item);
  if (currentDateIssued.length != 0) {
    DCDate d=new DCDate(currentDateIssued[0].value);
    provDescription=provDescription + "String_Node_Str" + d.toString();
  }
  item.addDC("String_Node_Str","String_Node_Str","String_Node_Str",provDescription);
  is.getCollection().addItem(item);
  item.setOwningCollection(is.getCollection());
  item.setArchived(true);
  item.update();
  is.deleteWrapper();
  item.inheritCollectionDefaultPolicies(is.getCollection());
  return item;
}

Fixed version (ground truth):
/** 
 * Take an InProgressSubmission and turn it into a fully-archived Item.
 * @param c  current context
 * @param is submission to install
 * @param suppliedHandle the existing Handle to give the installed item
 * @return the fully archived Item
 */
public static Item installItem(Context c,InProgressSubmission is,String suppliedHandle) throws SQLException, IOException, AuthorizeException {
  Item item=is.getItem();
  String handle;
  DCDate now=DCDate.getCurrent();
  item.addDC("String_Node_Str","String_Node_Str",null,now.toString());
  item.addDC("String_Node_Str","String_Node_Str",null,now.toString());
  DCValue[] currentDateIssued=item.getDC("String_Node_Str","String_Node_Str",Item.ANY);
  if (currentDateIssued.length == 0) {
    item.addDC("String_Node_Str","String_Node_Str",null,now.toString());
  }
  if (suppliedHandle == null) {
    handle=HandleManager.createHandle(c,item);
  }
 else {
    handle=HandleManager.createHandle(c,item,suppliedHandle);
  }
  String handleref=HandleManager.getCanonicalForm(handle);
  boolean identifierExists=false;
  DCValue[] identifiers=item.getDC("String_Node_Str","String_Node_Str",Item.ANY);
  for (  DCValue identifier : identifiers)   if (handleref.equals(identifier.value))   identifierExists=true;
  if (!identifierExists)   item.addDC("String_Node_Str","String_Node_Str",null,handleref);
  String provDescription="String_Node_Str" + now + "String_Node_Str"+ getBitstreamProvenanceMessage(item);
  if (currentDateIssued.length != 0) {
    DCDate d=new DCDate(currentDateIssued[0].value);
    provDescription=provDescription + "String_Node_Str" + d.toString();
  }
  item.addDC("String_Node_Str","String_Node_Str","String_Node_Str",provDescription);
  is.getCollection().addItem(item);
  item.setOwningCollection(is.getCollection());
  item.setArchived(true);
  item.update();
  is.deleteWrapper();
  item.inheritCollectionDefaultPolicies(is.getCollection());
  return item;
}