nus-yam/ex-repair huggingface dataset:
Program: 3610
Project: 3610
Buggy source:
/** 
 * Delete an eperson
 */
public void delete() throws SQLException, AuthorizeException {
  if (!AuthorizeManager.isAdmin(myContext)) {
    throw new AuthorizeException("String_Node_Str");
  }
  HistoryManager.saveHistory(myContext,this,HistoryManager.REMOVE,myContext.getCurrentUser(),myContext.getExtraLogInfo());
  myContext.removeCached(this,getID());
  DatabaseManager.updateQuery(myContext,"String_Node_Str" + getID());
  DatabaseManager.delete(myContext,myRow);
  log.info(LogManager.getHeader(myContext,"String_Node_Str","String_Node_Str" + getID()));
}

Fixed version (ground truth):
/** 
 * Delete an eperson
 */
public void delete() throws SQLException, AuthorizeException, EPersonDeletionException {
  if (!AuthorizeManager.isAdmin(myContext)) {
    throw new AuthorizeException("String_Node_Str");
  }
  HistoryManager.saveHistory(myContext,this,HistoryManager.REMOVE,myContext.getCurrentUser(),myContext.getExtraLogInfo());
  Vector constraintList=getDeleteConstraints();
  if (constraintList.size() > 0)   throw new EPersonDeletionException(constraintList);
  myContext.removeCached(this,getID());
  DatabaseManager.updateQuery(myContext,"String_Node_Str" + getID());
  DatabaseManager.updateQuery(myContext,"String_Node_Str" + getID());
  DatabaseManager.delete(myContext,myRow);
  log.info(LogManager.getHeader(myContext,"String_Node_Str","String_Node_Str" + getID()));
}
Program: 3611
Project: 3611
Buggy source:
/** 
 * Delete the community, including the metadata and logo.  Collections and subcommunities that are then orphans are deleted.
 */
public void delete() throws SQLException, AuthorizeException, IOException {
  AuthorizeManager.authorizeAction(ourContext,this,Constants.DELETE);
  log.info(LogManager.getHeader(ourContext,"String_Node_Str","String_Node_Str" + getID()));
  DSIndexer.unIndexContent(ourContext,this);
  HistoryManager.saveHistory(ourContext,this,HistoryManager.REMOVE,ourContext.getCurrentUser(),ourContext.getExtraLogInfo());
  ourContext.removeCached(this,getID());
  Collection[] cols=getCollections();
  for (int i=0; i < cols.length; i++) {
    removeCollection(cols[i]);
  }
  Community[] comms=getSubcommunities();
  for (int j=0; j < comms.length; j++) {
    removeSubcommunity(comms[j]);
  }
  setLogo(null);
  AuthorizeManager.removeAllPolicies(ourContext,this);
  DatabaseManager.delete(ourContext,communityRow);
}

Fixed version (ground truth):
/** 
 * Delete the community, including the metadata and logo.  Collections and subcommunities that are then orphans are deleted.
 */
public void delete() throws SQLException, AuthorizeException, IOException {
  AuthorizeManager.authorizeAction(ourContext,this,Constants.DELETE);
  Community parent=getParentCommunity();
  if (parent != null) {
    parent.removeSubcommunity(this);
    return;
  }
  log.info(LogManager.getHeader(ourContext,"String_Node_Str","String_Node_Str" + getID()));
  DSIndexer.unIndexContent(ourContext,this);
  HistoryManager.saveHistory(ourContext,this,HistoryManager.REMOVE,ourContext.getCurrentUser(),ourContext.getExtraLogInfo());
  ourContext.removeCached(this,getID());
  Collection[] cols=getCollections();
  for (int i=0; i < cols.length; i++) {
    removeCollection(cols[i]);
  }
  Community[] comms=getSubcommunities();
  for (int j=0; j < comms.length; j++) {
    removeSubcommunity(comms[j]);
  }
  setLogo(null);
  AuthorizeManager.removeAllPolicies(ourContext,this);
  DatabaseManager.delete(ourContext,communityRow);
}
Program: 3612
Project: 3612
Buggy source:
/** 
 * Process the input from the upload bitstream page
 * @param context   current DSpace context
 * @param request   current servlet request object
 * @param response  current servlet response object
 */
private void processUploadBitstream(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  FileUploadRequest wrapper=new FileUploadRequest(request);
  Bitstream b=null;
  Item item=Item.find(context,UIUtil.getIntParameter(wrapper,"String_Node_Str"));
  File temp=wrapper.getFile("String_Node_Str");
  InputStream is=new BufferedInputStream(new FileInputStream(temp));
  checkEditAuthorization(context,item);
  Bundle[] bundles=item.getBundles();
  if (bundles.length < 1) {
    b=item.createSingleBitstream(is,"String_Node_Str");
  }
 else {
    b=bundles[0].createBitstream(is);
  }
  String noPath=wrapper.getFilesystemName("String_Node_Str");
  while (noPath.indexOf('/') > -1) {
    noPath=noPath.substring(noPath.indexOf('/') + 1);
  }
  while (noPath.indexOf('\\') > -1) {
    noPath=noPath.substring(noPath.indexOf('\\') + 1);
  }
  b.setName(noPath);
  b.setSource(wrapper.getFilesystemName("String_Node_Str"));
  BitstreamFormat bf=FormatIdentifier.guessFormat(context,b);
  b.setFormat(bf);
  b.update();
  item.update();
  showEditForm(context,request,response,item);
  temp.delete();
  context.complete();
}

Fixed version (ground truth):
/** 
 * Process the input from the upload bitstream page
 * @param context   current DSpace context
 * @param request   current servlet request object
 * @param response  current servlet response object
 */
private void processUploadBitstream(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  FileUploadRequest wrapper=new FileUploadRequest(request);
  Bitstream b=null;
  Item item=Item.find(context,UIUtil.getIntParameter(wrapper,"String_Node_Str"));
  File temp=wrapper.getFile("String_Node_Str");
  InputStream is=new BufferedInputStream(new FileInputStream(temp));
  checkEditAuthorization(context,item);
  Bundle[] bundles=item.getBundles("String_Node_Str");
  if (bundles.length < 1) {
    b=item.createSingleBitstream(is,"String_Node_Str");
  }
 else {
    b=bundles[0].createBitstream(is);
  }
  String noPath=wrapper.getFilesystemName("String_Node_Str");
  while (noPath.indexOf('/') > -1) {
    noPath=noPath.substring(noPath.indexOf('/') + 1);
  }
  while (noPath.indexOf('\\') > -1) {
    noPath=noPath.substring(noPath.indexOf('\\') + 1);
  }
  b.setName(noPath);
  b.setSource(wrapper.getFilesystemName("String_Node_Str"));
  BitstreamFormat bf=FormatIdentifier.guessFormat(context,b);
  b.setFormat(bf);
  b.update();
  item.update();
  showEditForm(context,request,response,item);
  temp.delete();
  context.complete();
}
Program: 3613
Project: 3613
Buggy source:
/** 
 * Create a workflow group for the given step if one does not already exist. Returns either the newly created group or the previously existing one. Note that while the new group is created in the database, the association between the group and the collection is not written until <code>update</code> is called.
 * @param step  the step (1-3) of the workflow to create or get the groupfor
 * @return  the workflow group associated with this collection
 */
public Group createWorkflowGroup(int step) throws SQLException, AuthorizeException {
  AuthorizeManager.authorizeAction(ourContext,this,Constants.WRITE);
  if (workflowGroup[step - 1] == null) {
    workflowGroup[step - 1]=Group.create(ourContext);
    workflowGroup[step - 1].setName("String_Node_Str" + getID() + "String_Node_Str"+ step);
    workflowGroup[step - 1].update();
  }
  return workflowGroup[step - 1];
}

Fixed version (ground truth):
/** 
 * Create a workflow group for the given step if one does not already exist. Returns either the newly created group or the previously existing one. Note that while the new group is created in the database, the association between the group and the collection is not written until <code>update</code> is called.
 * @param step  the step (1-3) of the workflow to create or get the groupfor
 * @return  the workflow group associated with this collection
 */
public Group createWorkflowGroup(int step) throws SQLException, AuthorizeException {
  AuthorizeManager.authorizeAction(ourContext,this,Constants.WRITE);
  if (workflowGroup[step - 1] == null) {
    Group g=Group.create(ourContext);
    g.setName("String_Node_Str" + getID() + "String_Node_Str"+ step);
    g.update();
    setWorkflowGroup(step,g);
  }
  return workflowGroup[step - 1];
}
Program: 3615
Project: 3615
Buggy source:
protected void doDSGet(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  int sortBy=EPerson.LASTNAME;
  String sbParam=request.getParameter("String_Node_Str");
  if (sbParam != null && sbParam.equals("String_Node_Str")) {
    sortBy=EPerson.LASTNAME;
  }
 else   if (sbParam != null && sbParam.equals("String_Node_Str")) {
    sortBy=EPerson.EMAIL;
  }
  int first=UIUtil.getIntParameter(request,"String_Node_Str");
  if (first == -1)   first=0;
  EPerson[] epeople=EPerson.findAll(context,sortBy);
  request.setAttribute("String_Node_Str",new Integer(sortBy));
  request.setAttribute("String_Node_Str",new Integer(first));
  request.setAttribute("String_Node_Str",epeople);
  JSPManager.showJSP(request,response,"String_Node_Str");
}

Fixed version (ground truth):
protected void doDSGet(Context context,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException, SQLException, AuthorizeException {
  int sortBy=EPerson.LASTNAME;
  String sbParam=request.getParameter("String_Node_Str");
  if (sbParam != null && sbParam.equals("String_Node_Str")) {
    sortBy=EPerson.LASTNAME;
  }
 else   if (sbParam != null && sbParam.equals("String_Node_Str")) {
    sortBy=EPerson.EMAIL;
  }
 else   if (sbParam != null && sbParam.equals("String_Node_Str")) {
    sortBy=EPerson.ID;
  }
  int first=UIUtil.getIntParameter(request,"String_Node_Str");
  if (first == -1)   first=0;
  EPerson[] epeople=EPerson.findAll(context,sortBy);
  request.setAttribute("String_Node_Str",new Integer(sortBy));
  request.setAttribute("String_Node_Str",new Integer(first));
  request.setAttribute("String_Node_Str",epeople);
  JSPManager.showJSP(request,response,"String_Node_Str");
}
Program: 3618
Project: 3618
Buggy source:
/** 
 * Render full item record
 */
private void renderFull() throws IOException, java.sql.SQLException {
  JspWriter out=pageContext.getOut();
  DCValue[] values=item.getDC(Item.ANY,Item.ANY,Item.ANY);
  out.println("String_Node_Str");
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  for (int i=0; i < values.length; i++) {
    boolean hidden=false;
    if (values[i].element.equals("String_Node_Str") && (values[i].qualifier != null && values[i].qualifier.equals("String_Node_Str"))) {
      hidden=true;
    }
    if (!hidden) {
      out.print("String_Node_Str");
      out.print(values[i].element);
      if (values[i].qualifier != null) {
        out.print("String_Node_Str" + values[i].qualifier);
      }
      out.print("String_Node_Str");
      out.print(values[i].value);
      out.print("String_Node_Str");
      if (values[i].language == null) {
        out.print("String_Node_Str");
      }
 else {
        out.print(values[i].language);
      }
      out.println("String_Node_Str");
    }
  }
  listCollections();
  out.println("String_Node_Str");
  listBitstreams();
}

Fixed version (ground truth):
/** 
 * Render full item record
 */
private void renderFull() throws IOException, java.sql.SQLException {
  JspWriter out=pageContext.getOut();
  DCValue[] values=item.getDC(Item.ANY,Item.ANY,Item.ANY);
  out.println("String_Node_Str");
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  out.println("String_Node_Str");
  out.println("String_Node_Str");
  for (int i=0; i < values.length; i++) {
    boolean hidden=false;
    if (values[i].element.equals("String_Node_Str") && (values[i].qualifier != null && values[i].qualifier.equals("String_Node_Str"))) {
      hidden=true;
    }
    if (!hidden) {
      out.print("String_Node_Str");
      out.print(values[i].element);
      if (values[i].qualifier != null) {
        out.print("String_Node_Str" + values[i].qualifier);
      }
      out.print("String_Node_Str");
      out.print(Utils.addEntities(values[i].value));
      out.print("String_Node_Str");
      if (values[i].language == null) {
        out.print("String_Node_Str");
      }
 else {
        out.print(values[i].language);
      }
      out.println("String_Node_Str");
    }
  }
  listCollections();
  out.println("String_Node_Str");
  listBitstreams();
}
Program: 3620
Project: 3620
Buggy source:
/** 
 * Do a query, restricted to a community
 * @param querystring
 * @param community
 * @return HashMap results, same as full doQuery, only hits in a Community
 */
public static QueryResults doQuery(Context c,QueryArgs args,Community comm) throws IOException, ParseException {
  String querystring=args.getQuery();
  querystring=checkEmptyQuery(querystring);
  String location="String_Node_Str" + (comm.getID());
  String newquery=new String("String_Node_Str" + querystring + "String_Node_Str"+ location+ "String_Node_Str");
  args.setQuery(newquery);
  return doQuery(c,args);
}

Fixed version (ground truth):
/** 
 * Do a query, restricted to a community
 * @param querystring
 * @param community
 * @return HashMap results, same as full doQuery, only hits in a Community
 */
public static QueryResults doQuery(Context c,QueryArgs args,Community comm) throws IOException {
  String querystring=args.getQuery();
  querystring=checkEmptyQuery(querystring);
  String location="String_Node_Str" + (comm.getID());
  String newquery=new String("String_Node_Str" + querystring + "String_Node_Str"+ location+ "String_Node_Str");
  args.setQuery(newquery);
  return doQuery(c,args);
}
Program: 3623
Project: 3623
Buggy source:
/** 
 * Format SQL according to the browse type.
 */
private static String formatSql(BrowseScope scope,String sql,String subqueryValue,boolean after){
  boolean before=!after;
  int browseType=scope.getBrowseType();
  boolean ascending=scope.getAscending();
  int numberDesired=before ? scope.getNumberBefore() : scope.getTotal();
  String beforeOperator="String_Node_Str";
  String afterOperator="String_Node_Str";
  if (browseType == ITEMS_BY_AUTHOR_BROWSE)   afterOperator="String_Node_Str";
  if (subqueryValue != null) {
    beforeOperator="String_Node_Str";
    afterOperator="String_Node_Str";
  }
  if (!ascending) {
    beforeOperator="String_Node_Str";
    afterOperator="String_Node_Str";
  }
  String beforeSubqueryOperator="String_Node_Str";
  String afterSubqueryOperator="String_Node_Str";
  if (browseType == ITEMS_BY_AUTHOR_BROWSE)   afterSubqueryOperator="String_Node_Str";
  if (!ascending) {
    beforeSubqueryOperator="String_Node_Str";
    afterSubqueryOperator="String_Node_Str";
  }
  String order=before ? "String_Node_Str" : "String_Node_Str";
  if (!ascending)   order=before ? "String_Node_Str" : "String_Node_Str";
  List args=new ArrayList();
  args.add(before ? beforeSubqueryOperator : afterSubqueryOperator);
  args.add(before ? beforeOperator : afterOperator);
  args.add(order);
  args.add(new Integer(numberDesired));
  return MessageFormat.format(sql,args.toArray());
}

Fixed version (ground truth):
/** 
 * Format SQL according to the browse type.
 */
private static String formatSql(BrowseScope scope,String sql,String subqueryValue,boolean after){
  boolean before=!after;
  int browseType=scope.getBrowseType();
  boolean ascending=scope.getAscending();
  int numberDesired=before ? scope.getNumberBefore() : scope.getTotal();
  String beforeOperator="String_Node_Str";
  String afterOperator="String_Node_Str";
  if (browseType == ITEMS_BY_AUTHOR_BROWSE)   afterOperator="String_Node_Str";
  if (subqueryValue != null) {
    beforeOperator="String_Node_Str";
    afterOperator="String_Node_Str";
  }
  if (!ascending) {
    beforeOperator="String_Node_Str";
    afterOperator="String_Node_Str";
  }
  if (browseType == ITEMS_BY_DATE_BROWSE) {
    if (!ascending) {
      beforeOperator="String_Node_Str";
      afterOperator="String_Node_Str";
    }
 else {
      beforeOperator="String_Node_Str";
      afterOperator="String_Node_Str";
    }
  }
  String beforeSubqueryOperator="String_Node_Str";
  String afterSubqueryOperator="String_Node_Str";
  if (browseType == ITEMS_BY_AUTHOR_BROWSE)   afterSubqueryOperator="String_Node_Str";
  if (!ascending) {
    beforeSubqueryOperator="String_Node_Str";
    afterSubqueryOperator="String_Node_Str";
  }
  String order=before ? "String_Node_Str" : "String_Node_Str";
  if (!ascending)   order=before ? "String_Node_Str" : "String_Node_Str";
  List args=new ArrayList();
  args.add(before ? beforeSubqueryOperator : afterSubqueryOperator);
  args.add(before ? beforeOperator : afterOperator);
  args.add(order);
  args.add(new Integer(numberDesired));
  return MessageFormat.format(sql,args.toArray());
}
Program: 3625
Project: 3625
Buggy source:
/** 
 * Command line interface to setPolicies - run to see arguments
 */
public static void main(String[] argv) throws Exception {
  Context c=new Context();
  c.setIgnoreAuthorization(true);
  Collection[] collections=Collection.findAll(c);
  for (int i=0; i < collections.length; i++) {
    Collection t=collections[i];
    System.out.println("String_Node_Str" + t + "String_Node_Str"+ t.getMetadata("String_Node_Str"));
    if (checkForPolicy(c,t,Constants.READ)) {
      System.out.println("String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str");
      addAnonymousPolicy(c,t,Constants.READ);
    }
    if (checkForPolicy(c,t,Constants.DEFAULT_ITEM_READ)) {
      System.out.println("String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str");
      addAnonymousPolicy(c,t,Constants.DEFAULT_ITEM_READ);
    }
    if (checkForPolicy(c,t,Constants.DEFAULT_BITSTREAM_READ)) {
      System.out.println("String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str");
      addAnonymousPolicy(c,t,Constants.DEFAULT_BITSTREAM_READ);
    }
  }
  Community[] communities=Community.findAll(c);
  for (int i=0; i < collections.length; i++) {
    Community t=communities[i];
    System.out.println("String_Node_Str" + t + "String_Node_Str"+ t.getMetadata("String_Node_Str"));
    if (checkForPolicy(c,t,Constants.READ)) {
      System.out.println("String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str");
      addAnonymousPolicy(c,t,Constants.READ);
    }
  }
  c.complete();
}

Fixed version (ground truth):
/** 
 * Command line interface to setPolicies - run to see arguments
 */
public static void main(String[] argv) throws Exception {
  Context c=new Context();
  c.setIgnoreAuthorization(true);
  Collection[] collections=Collection.findAll(c);
  for (int i=0; i < collections.length; i++) {
    Collection t=collections[i];
    System.out.println("String_Node_Str" + t + "String_Node_Str"+ t.getMetadata("String_Node_Str"));
    if (checkForPolicy(c,t,Constants.READ)) {
      System.out.println("String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str");
      addAnonymousPolicy(c,t,Constants.READ);
    }
    if (checkForPolicy(c,t,Constants.DEFAULT_ITEM_READ)) {
      System.out.println("String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str");
      addAnonymousPolicy(c,t,Constants.DEFAULT_ITEM_READ);
    }
    if (checkForPolicy(c,t,Constants.DEFAULT_BITSTREAM_READ)) {
      System.out.println("String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str");
      addAnonymousPolicy(c,t,Constants.DEFAULT_BITSTREAM_READ);
    }
  }
  Community[] communities=Community.findAll(c);
  for (int i=0; i < communities.length; i++) {
    Community t=communities[i];
    System.out.println("String_Node_Str" + t + "String_Node_Str"+ t.getMetadata("String_Node_Str"));
    if (checkForPolicy(c,t,Constants.READ)) {
      System.out.println("String_Node_Str");
    }
 else {
      System.out.println("String_Node_Str");
      addAnonymousPolicy(c,t,Constants.READ);
    }
  }
  c.complete();
}
Program: 3626
Project: 3626
Buggy source:
/** 
 * Reinstate a withdrawn item
 */
public void reinstate() throws SQLException, AuthorizeException, IOException {
  String timestamp=DCDate.getCurrent().toString();
  String collectionProv="String_Node_Str";
  Collection[] colls=getCollections();
  for (int i=0; i < colls.length; i++) {
    collectionProv=collectionProv + colls[i].getMetadata("String_Node_Str") + "String_Node_Str"+ colls[i].getID()+ "String_Node_Str";
    AuthorizeManager.authorizeAction(ourContext,colls[i],Constants.ADD);
  }
  itemRow.setColumn("String_Node_Str",false);
  itemRow.setColumn("String_Node_Str",true);
  EPerson e=ourContext.getCurrentUser();
  String prov="String_Node_Str" + e.getFullName() + "String_Node_Str"+ e.getEmail()+ "String_Node_Str"+ timestamp+ "String_Node_Str"+ "String_Node_Str"+ collectionProv+ InstallItem.getBitstreamProvenanceMessage(this);
  addDC("String_Node_Str","String_Node_Str","String_Node_Str",prov);
  update();
  HistoryManager.saveHistory(ourContext,this,HistoryManager.MODIFY,e,ourContext.getExtraLogInfo());
  Browse.itemAdded(ourContext,this);
  DSIndexer.indexContent(ourContext,this);
  if (colls.length > 0) {
    inheritCollectionDefaultPolicies(colls[0]);
  }
  log.info(LogManager.getHeader(ourContext,"String_Node_Str","String_Node_Str" + e.getEmail() + "String_Node_Str"+ getID()));
}

Fixed version (ground truth):
/** 
 * Reinstate a withdrawn item
 */
public void reinstate() throws SQLException, AuthorizeException, IOException {
  String timestamp=DCDate.getCurrent().toString();
  String collectionProv="String_Node_Str";
  Collection[] colls=getCollections();
  for (int i=0; i < colls.length; i++) {
    collectionProv=collectionProv + colls[i].getMetadata("String_Node_Str") + "String_Node_Str"+ colls[i].getID()+ "String_Node_Str";
    AuthorizeManager.authorizeAction(ourContext,colls[i],Constants.ADD);
  }
  itemRow.setColumn("String_Node_Str",false);
  itemRow.setColumn("String_Node_Str",true);
  EPerson e=ourContext.getCurrentUser();
  String prov="String_Node_Str" + e.getFullName() + "String_Node_Str"+ e.getEmail()+ "String_Node_Str"+ timestamp+ "String_Node_Str"+ "String_Node_Str"+ collectionProv+ InstallItem.getBitstreamProvenanceMessage(this);
  addDC("String_Node_Str","String_Node_Str","String_Node_Str",prov);
  update();
  HistoryManager.saveHistory(ourContext,this,HistoryManager.MODIFY,e,ourContext.getExtraLogInfo());
  DSIndexer.indexContent(ourContext,this);
  if (colls.length > 0) {
    inheritCollectionDefaultPolicies(colls[0]);
  }
  log.info(LogManager.getHeader(ourContext,"String_Node_Str","String_Node_Str" + e.getEmail() + "String_Node_Str"+ getID()));
}
Program: 3627
Project: 3627
Buggy source:
static String stripAsterisk(String myquery){
  Perl5Util util=new Perl5Util();
  myquery=util.substitute("String_Node_Str",myquery);
  myquery=util.substitute("String_Node_Str",myquery);
  return myquery;
}

Fixed version (ground truth):
static String stripAsterisk(String myquery){
  Perl5Util util=new Perl5Util();
  myquery=util.substitute("String_Node_Str",myquery);
  myquery=util.substitute("String_Node_Str",myquery);
  myquery=util.substitute("String_Node_Str",myquery);
  myquery=util.substitute("String_Node_Str",myquery);
  return myquery;
}
Program: 3630
Project: 3630
Buggy source:
/** 
 * Create a new item, with a new internal ID.  This method is not public, since items need to be created as workspace items.  Authorisation is the responsibility of the caller.
 * @param context  DSpace context object
 * @return  the newly created item
 */
static Item create(Context context) throws SQLException {
  TableRow row=DatabaseManager.create(context,"String_Node_Str");
  Item i=new Item(context,row);
  HistoryManager.saveHistory(context,i,HistoryManager.CREATE,context.getCurrentUser(),context.getExtraLogInfo());
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + row.getIntColumn("String_Node_Str")));
  return i;
}

Fixed version (ground truth):
/** 
 * Create a new item, with a new internal ID.  This method is not public, since items need to be created as workspace items.  Authorisation is the responsibility of the caller.
 * @param context  DSpace context object
 * @return  the newly created item
 */
static Item create(Context context) throws SQLException, AuthorizeException {
  TableRow row=DatabaseManager.create(context,"String_Node_Str");
  Item i=new Item(context,row);
  i.update();
  HistoryManager.saveHistory(context,i,HistoryManager.CREATE,context.getCurrentUser(),context.getExtraLogInfo());
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + row.getIntColumn("String_Node_Str")));
  return i;
}
Program: 3631
Project: 3631
Buggy source:
private void replaceItems(Context c,Collection mycollection,String sourceDir,String mapFile) throws Exception {
  HashMap myhash=readMapFile(mapFile);
  Iterator i=myhash.keySet().iterator();
  ArrayList itemsToDelete=new ArrayList();
  while (i.hasNext()) {
    String newItemName=(String)i.next();
    String oldHandle=(String)myhash.get(newItemName);
    System.out.println("String_Node_Str" + oldHandle);
    Item oldItem=(Item)HandleManager.resolveToObject(c,oldHandle);
    Item newItem=addItem(c,mycollection,sourceDir,newItemName,null);
    String newHandle=HandleManager.findHandle(c,newItem);
    String myquery="String_Node_Str" + Constants.ITEM + "String_Node_Str"+ newItem.getID();
    DatabaseManager.updateQuery(c,myquery);
    myquery="String_Node_Str" + newItem.getID() + "String_Node_Str"+ oldHandle+ "String_Node_Str";
    DatabaseManager.updateQuery(c,myquery);
    itemsToDelete.add(oldItem);
  }
  i=itemsToDelete.iterator();
  while (i.hasNext()) {
    removeItem(c,(Item)i.next());
  }
}

Fixed version (ground truth):
private void replaceItems(Context c,Collection mycollection,String sourceDir,String mapFile) throws Exception {
  HashMap myhash=readMapFile(mapFile);
  Iterator i=myhash.keySet().iterator();
  ArrayList itemsToDelete=new ArrayList();
  while (i.hasNext()) {
    String newItemName=(String)i.next();
    String oldHandle=(String)myhash.get(newItemName);
    System.out.println("String_Node_Str" + oldHandle);
    Item oldItem=(Item)HandleManager.resolveToObject(c,oldHandle);
    Item newItem=addItem(c,mycollection,sourceDir,newItemName,oldHandle,null);
    itemsToDelete.add(oldItem);
  }
  i=itemsToDelete.iterator();
  while (i.hasNext()) {
    removeItem(c,(Item)i.next());
  }
}
Program: 3632
Project: 3632
Buggy source:
private Item addItem(Context c,Collection mycollection,String path,String itemname,PrintWriter mapOut) throws Exception {
  Item myitem=null;
  System.out.println("String_Node_Str" + itemname);
  WorkspaceItem wi=WorkspaceItem.create(c,mycollection,false);
  myitem=wi.getItem();
  loadDublinCore(c,myitem,path + "String_Node_Str" + itemname+ "String_Node_Str"+ "String_Node_Str");
  processContentsFile(c,myitem,path + "String_Node_Str" + itemname,"String_Node_Str");
  String myhandle=processHandleFile(c,myitem,path + "String_Node_Str" + itemname,"String_Node_Str");
  InstallItem.installItem(c,wi,myhandle);
  myhandle=HandleManager.findHandle(c,myitem);
  if (mapOut != null) {
    mapOut.println(itemname + "String_Node_Str" + myhandle);
  }
  return myitem;
}

Fixed version (ground truth):
/** 
 * item?  try and add it to the archive c mycollection path itemname  handle - non-null means we have a pre-defined handle already mapOut - mapfile we're writing
 */
private Item addItem(Context c,Collection mycollection,String path,String itemname,String handle,PrintWriter mapOut) throws Exception {
  Item myitem=null;
  System.out.println("String_Node_Str" + itemname);
  WorkspaceItem wi=WorkspaceItem.create(c,mycollection,false);
  myitem=wi.getItem();
  loadDublinCore(c,myitem,path + "String_Node_Str" + itemname+ "String_Node_Str"+ "String_Node_Str");
  processContentsFile(c,myitem,path + "String_Node_Str" + itemname,"String_Node_Str");
  String myhandle=processHandleFile(c,myitem,path + "String_Node_Str" + itemname,"String_Node_Str");
  InstallItem.installItem(c,wi,myhandle);
  myhandle=HandleManager.findHandle(c,myitem);
  if (mapOut != null) {
    mapOut.println(itemname + "String_Node_Str" + myhandle);
  }
  return myitem;
}
Program: 3633
Project: 3633
Buggy source:
private void addDCValue(Item i,Node n) throws TransformerException {
  String value=getStringValue(n);
  String element=getAttributeValue(n,"String_Node_Str");
  String qualifier=getAttributeValue(n,"String_Node_Str");
  System.out.println("String_Node_Str" + element + "String_Node_Str"+ qualifier+ "String_Node_Str"+ value);
  if (qualifier.equals("String_Node_Str"))   qualifier=null;
  i.addDC(element,qualifier,"String_Node_Str",value);
}

Fixed version (ground truth):
private void addDCValue(Item i,Node n) throws TransformerException {
  String value=getStringValue(n);
  String element=getAttributeValue(n,"String_Node_Str");
  String qualifier=getAttributeValue(n,"String_Node_Str");
  String language=getAttributeValue(n,"String_Node_Str");
  System.out.println("String_Node_Str" + element + "String_Node_Str"+ qualifier+ "String_Node_Str"+ value);
  if (qualifier.equals("String_Node_Str"))   qualifier=null;
  if (language.equals("String_Node_Str")) {
    language=ConfigurationManager.getProperty("String_Node_Str");
  }
  if (language == null) {
    language="String_Node_Str";
  }
  i.addDC(element,qualifier,language,value);
}
Program: 3634
Project: 3634
Buggy source:
private void addItems(Context c,Collection mycollection,String sourceDir,String mapFile) throws Exception {
  System.out.println("String_Node_Str" + sourceDir);
  System.out.println("String_Node_Str" + mapFile);
  File outFile=new File(mapFile);
  PrintWriter mapOut=new PrintWriter(new FileWriter(outFile));
  String[] dircontents=new java.io.File(sourceDir).list();
  for (int i=0; i < dircontents.length; i++) {
    addItem(c,mycollection,sourceDir,dircontents[i],mapOut);
    System.out.println(i + "String_Node_Str" + dircontents[i]);
  }
  mapOut.close();
}

Fixed version (ground truth):
private void addItems(Context c,Collection mycollection,String sourceDir,String mapFile) throws Exception {
  System.out.println("String_Node_Str" + sourceDir);
  System.out.println("String_Node_Str" + mapFile);
  File outFile=new File(mapFile);
  PrintWriter mapOut=new PrintWriter(new FileWriter(outFile));
  String[] dircontents=new java.io.File(sourceDir).list();
  for (int i=0; i < dircontents.length; i++) {
    addItem(c,mycollection,sourceDir,dircontents[i],null,mapOut);
    System.out.println(i + "String_Node_Str" + dircontents[i]);
  }
  mapOut.close();
}
Program: 3636
Project: 3636
Buggy source:
private static void recordApproval(Context c,WorkflowItem wi,EPerson e) throws SQLException, AuthorizeException {
  Item item=wi.getItem();
  String usersName=getEPersonName(e);
  String now=DCDate.getCurrent().toString();
  String provDescription="String_Node_Str" + usersName + "String_Node_Str"+ now+ "String_Node_Str";
  provDescription+=InstallItem.getBitstreamProvenanceMessage(item);
  item.addDC("String_Node_Str","String_Node_Str",null,provDescription);
  item.update();
}

Fixed version (ground truth):
private static void recordApproval(Context c,WorkflowItem wi,EPerson e) throws SQLException, AuthorizeException {
  Item item=wi.getItem();
  String usersName=getEPersonName(e);
  String now=DCDate.getCurrent().toString();
  String provDescription="String_Node_Str" + usersName + "String_Node_Str"+ now+ "String_Node_Str";
  provDescription+=InstallItem.getBitstreamProvenanceMessage(item);
  item.addDC("String_Node_Str","String_Node_Str","String_Node_Str",provDescription);
  item.update();
}
Program: 3637
Project: 3637
Buggy source:
/** 
 * rejects an item - rejection means undoing a submit - WorkspaceItem is created, and the WorkflowItem is removed, user is emailed rejection_message.
 * @param c  Context
 * @param wi WorkflowItem to operate on
 * @param e  EPerson doing the operation
 * @param rejection_message message to email to user
 */
public static WorkspaceItem reject(Context c,WorkflowItem wi,EPerson e,String rejection_message) throws SQLException, AuthorizeException, IOException {
  deleteTasks(c,wi);
  Item myitem=wi.getItem();
  String now=DCDate.getCurrent().toString();
  String usersName=getEPersonName(e);
  String provDescription="String_Node_Str" + usersName + "String_Node_Str"+ rejection_message+ "String_Node_Str"+ now+ "String_Node_Str";
  myitem.addDC("String_Node_Str","String_Node_Str",null,provDescription);
  myitem.update();
  WorkspaceItem wsi=returnToWorkspace(c,wi);
  notifyOfReject(c,wi,e,rejection_message);
  log.info(LogManager.getHeader(c,"String_Node_Str","String_Node_Str" + wi.getID() + "String_Node_Str"+ wi.getItem().getID()+ "String_Node_Str"+ wi.getCollection().getID()+ "String_Node_Str"+ e.getID()));
  return wsi;
}

Fixed version (ground truth):
/** 
 * rejects an item - rejection means undoing a submit - WorkspaceItem is created, and the WorkflowItem is removed, user is emailed rejection_message.
 * @param c  Context
 * @param wi WorkflowItem to operate on
 * @param e  EPerson doing the operation
 * @param rejection_message message to email to user
 */
public static WorkspaceItem reject(Context c,WorkflowItem wi,EPerson e,String rejection_message) throws SQLException, AuthorizeException, IOException {
  deleteTasks(c,wi);
  Item myitem=wi.getItem();
  String now=DCDate.getCurrent().toString();
  String usersName=getEPersonName(e);
  String provDescription="String_Node_Str" + usersName + "String_Node_Str"+ rejection_message+ "String_Node_Str"+ now+ "String_Node_Str";
  myitem.addDC("String_Node_Str","String_Node_Str","String_Node_Str",provDescription);
  myitem.update();
  WorkspaceItem wsi=returnToWorkspace(c,wi);
  notifyOfReject(c,wi,e,rejection_message);
  log.info(LogManager.getHeader(c,"String_Node_Str","String_Node_Str" + wi.getID() + "String_Node_Str"+ wi.getItem().getID()+ "String_Node_Str"+ wi.getCollection().getID()+ "String_Node_Str"+ e.getID()));
  return wsi;
}
Program: 3638
Project: 3638
Buggy source:
public String buildQuery(HttpServletRequest request){
  String newquery="String_Node_Str";
  String query1=request.getParameter("String_Node_Str");
  String query2=request.getParameter("String_Node_Str");
  String query3=request.getParameter("String_Node_Str");
  String field1=request.getParameter("String_Node_Str");
  String field2=request.getParameter("String_Node_Str");
  String field3=request.getParameter("String_Node_Str");
  String conjunction1=request.getParameter("String_Node_Str");
  String conjunction2=request.getParameter("String_Node_Str");
  if (query1.length() > 0) {
    if (!field1.equals("String_Node_Str")) {
      newquery=newquery + field1 + "String_Node_Str";
    }
    newquery=newquery + '"' + query1+ '"';
  }
  if (query2.length() > 0) {
    newquery=newquery + "String_Node_Str" + conjunction1+ "String_Node_Str";
    if (!field2.equals("String_Node_Str")) {
      newquery=newquery + field2 + "String_Node_Str";
    }
    newquery=newquery + '"' + query2+ '"';
  }
  newquery=newquery + "String_Node_Str";
  if (query3.length() > 0) {
    newquery=newquery + "String_Node_Str" + conjunction2+ "String_Node_Str";
    if (!field3.equals("String_Node_Str")) {
      newquery=newquery + field3 + "String_Node_Str";
    }
    newquery=newquery + "String_Node_Str" + query3+ "String_Node_Str";
  }
  return (newquery);
}

Fixed version (ground truth):
public String buildQuery(HttpServletRequest request){
  String newquery="String_Node_Str";
  String query1=request.getParameter("String_Node_Str");
  String query2=request.getParameter("String_Node_Str");
  String query3=request.getParameter("String_Node_Str");
  String field1=request.getParameter("String_Node_Str");
  String field2=request.getParameter("String_Node_Str");
  String field3=request.getParameter("String_Node_Str");
  String conjunction1=request.getParameter("String_Node_Str");
  String conjunction2=request.getParameter("String_Node_Str");
  if (query1.length() > 0) {
    newquery=newquery + buildQueryPart(query1,field1);
  }
  if (query2.length() > 0) {
    newquery=newquery + "String_Node_Str" + conjunction1+ "String_Node_Str";
    newquery=newquery + buildQueryPart(query2,field2);
  }
  newquery=newquery + "String_Node_Str";
  if (query3.length() > 0) {
    newquery=newquery + "String_Node_Str" + conjunction2+ "String_Node_Str";
    newquery=newquery + buildQueryPart(query3,field3);
  }
  return (newquery);
}
Program: 3639
Project: 3639
Buggy source:
/** 
 * Delete the collection, including the metadata and logo.  Items that are then orphans are deleted. Groups associated with this collection (workflow participants and submitters) are NOT deleted.
 */
void delete() throws SQLException, AuthorizeException, IOException {
  log.info(LogManager.getHeader(ourContext,"String_Node_Str","String_Node_Str" + getID()));
  DSIndexer.unIndexContent(ourContext,this);
  ourContext.removeCached(this,getID());
  HistoryManager.saveHistory(ourContext,this,HistoryManager.REMOVE,ourContext.getCurrentUser(),ourContext.getExtraLogInfo());
  ItemIterator items=getItems();
  while (items.hasNext()) {
    removeItem(items.next());
  }
  setLogo(null);
  DatabaseManager.delete(ourContext,collectionRow);
  AuthorizeManager.removeAllPolicies(ourContext,this);
  Group g=null;
  g=getWorkflowGroup(1);
  if (g != null) {
    g.delete();
  }
  g=getWorkflowGroup(2);
  if (g != null) {
    g.delete();
  }
  g=getWorkflowGroup(3);
  if (g != null) {
    g.delete();
  }
}

Fixed version (ground truth):
/** 
 * Delete the collection, including the metadata and logo.  Items that are then orphans are deleted. Groups associated with this collection (workflow participants and submitters) are NOT deleted.
 */
void delete() throws SQLException, AuthorizeException, IOException {
  log.info(LogManager.getHeader(ourContext,"String_Node_Str","String_Node_Str" + getID()));
  DSIndexer.unIndexContent(ourContext,this);
  ourContext.removeCached(this,getID());
  HistoryManager.saveHistory(ourContext,this,HistoryManager.REMOVE,ourContext.getCurrentUser(),ourContext.getExtraLogInfo());
  ItemIterator items=getItems();
  while (items.hasNext()) {
    removeItem(items.next());
  }
  setLogo(null);
  AuthorizeManager.removeAllPolicies(ourContext,this);
  WorkflowItem[] wfarray=WorkflowItem.findByCollection(ourContext,this);
  for (int x=0; x < wfarray.length; x++) {
    Item myItem=wfarray[x].getItem();
    wfarray[x].deleteWrapper();
    myItem.delete();
  }
  WorkspaceItem[] wsarray=WorkspaceItem.findByCollection(ourContext,this);
  for (int x=0; x < wsarray.length; x++) {
    wsarray[x].deleteAll();
  }
  DatabaseManager.delete(ourContext,collectionRow);
  Group g=null;
  g=getWorkflowGroup(1);
  if (g != null) {
    g.delete();
  }
  g=getWorkflowGroup(2);
  if (g != null) {
    g.delete();
  }
  g=getWorkflowGroup(3);
  if (g != null) {
    g.delete();
  }
}
Program: 3640
Project: 3640
Buggy source:
/** 
 * delete the WorkflowItem, retaining the Item
 */
public void deleteWrapper() throws SQLException, IOException, AuthorizeException {
  ourContext.removeCached(this,getID());
  HistoryManager.saveHistory(ourContext,this,HistoryManager.REMOVE,ourContext.getCurrentUser(),ourContext.getExtraLogInfo());
  DatabaseManager.delete(ourContext,wfRow);
}

Fixed version (ground truth):
/** 
 * delete the WorkflowItem, retaining the Item
 */
public void deleteWrapper() throws SQLException, IOException, AuthorizeException {
  ourContext.removeCached(this,getID());
  HistoryManager.saveHistory(ourContext,this,HistoryManager.REMOVE,ourContext.getCurrentUser(),ourContext.getExtraLogInfo());
  WorkflowManager.deleteTasks(ourContext,this);
  DatabaseManager.delete(ourContext,wfRow);
}
Program: 3641
Project: 3641
Buggy source:
private static void deleteTasks(Context c,WorkflowItem wi) throws SQLException {
  String myrequest="String_Node_Str" + wi.getID();
  DatabaseManager.updateQuery(c,myrequest);
}

Fixed version (ground truth):
static void deleteTasks(Context c,WorkflowItem wi) throws SQLException {
  String myrequest="String_Node_Str" + wi.getID();
  DatabaseManager.updateQuery(c,myrequest);
}
Program: 3643
Project: 3643
Buggy source:
/** 
 * Create an empty template item for this collection.  If one already exists, no action is taken.  Caution:  Make sure you call <code>update</code> on the collection after doing this, or the item will have been created but the collection record will not refer to it.
 */
public void createTemplateItem() throws SQLException, AuthorizeException {
  AuthorizeManager.authorizeAction(ourContext,this,Constants.WRITE);
  if (template == null) {
    template=Item.create(ourContext);
    log.info(LogManager.getHeader(ourContext,"String_Node_Str","String_Node_Str" + getID() + "String_Node_Str"+ template.getID()));
  }
}

Fixed version (ground truth):
/** 
 * Create an empty template item for this collection.  If one already exists, no action is taken.  Caution:  Make sure you call <code>update</code> on the collection after doing this, or the item will have been created but the collection record will not refer to it.
 */
public void createTemplateItem() throws SQLException, AuthorizeException {
  AuthorizeManager.authorizeAction(ourContext,this,Constants.WRITE);
  if (template == null) {
    template=Item.create(ourContext);
    collectionRow.setColumn("String_Node_Str",template.getID());
    log.info(LogManager.getHeader(ourContext,"String_Node_Str","String_Node_Str" + getID() + "String_Node_Str"+ template.getID()));
  }
}
Program: 3645
Project: 3645
Buggy source:
/** 
 * Return the file corresponding to ID, or null.
 * @param bitstream  the table row for the bitstream
 * @return The file corresponding to ID, or null
 * @exception IOException If a problem occurs while determining the file
 */
private static File getFile(TableRow bitstream) throws IOException {
  int storeNumber=bitstream.getIntColumn("String_Node_Str");
  if (storeNumber == -1) {
    storeNumber=0;
  }
  File store=assetStores[storeNumber];
  String id=bitstream.getStringColumn("String_Node_Str");
  BigInteger bigint=new BigInteger(id);
  StringBuffer result=new StringBuffer().append(store.getCanonicalPath());
  for (int i=0; i < directoryLevels; i++) {
    int digits=i * digitsPerLevel;
    result.append(File.separator).append(id.substring(digits,digits + digitsPerLevel));
  }
  String theName=result.append(File.separator).append(id).toString();
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + id + "String_Node_Str"+ theName);
  return new File(theName);
}

Fixed version (ground truth):
/** 
 * Return the file corresponding to a bitstream.  It's safe to pass in <code>null</code>.
 * @param bitstream  the database table row for the bitstream.Can be <code>null</code>
 * @return  The corresponding file in the file system, or <code>null</code>
 * @exception IOException If a problem occurs while determining the file
 */
private static File getFile(TableRow bitstream) throws IOException {
  if (bitstream == null) {
    return null;
  }
  int storeNumber=bitstream.getIntColumn("String_Node_Str");
  if (storeNumber == -1) {
    storeNumber=0;
  }
  File store=assetStores[storeNumber];
  String id=bitstream.getStringColumn("String_Node_Str");
  BigInteger bigint=new BigInteger(id);
  StringBuffer result=new StringBuffer().append(store.getCanonicalPath());
  for (int i=0; i < directoryLevels; i++) {
    int digits=i * digitsPerLevel;
    result.append(File.separator).append(id.substring(digits,digits + digitsPerLevel));
  }
  String theName=result.append(File.separator).append(id).toString();
  if (log.isDebugEnabled())   log.debug("String_Node_Str" + id + "String_Node_Str"+ theName);
  return new File(theName);
}
Program: 3646
Project: 3646
Buggy source:
/** 
 * Return the index of the first non-whitespace character in the character array, starting at position STARTAT.
 */
private static int firstWhitespace(char[] title,int startAt){
  int first=0;
  for (int j=startAt; j < title.length; j++) {
    if (Character.isWhitespace(title[j])) {
      first=j + 1;
      continue;
    }
    break;
  }
  return first;
}

Fixed version (ground truth):
/** 
 * Return the index of the first letter or number in the character array, starting at position STARTAT.
 */
private static int firstWhitespace(char[] title,int startAt){
  int first=0;
  for (int j=startAt; j < title.length; j++) {
    if (!Character.isLetterOrDigit(title[j])) {
      first=j + 1;
      continue;
    }
    break;
  }
  return first;
}
Program: 3648
Project: 3648
Buggy source:
/** 
 * List bitstreams in the item
 */
private void listBitstreams() throws IOException {
  JspWriter out=pageContext.getOut();
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  out.print("String_Node_Str");
  out.println("String_Node_Str");
  Bundle[] bundles=item.getBundles();
  if (bundles.length == 0) {
    out.println("String_Node_Str");
  }
 else {
    out.println("String_Node_Str");
    for (int i=0; i < bundles.length; i++) {
      Bitstream[] bitstreams=bundles[i].getBitstreams();
      for (int k=0; k < bitstreams.length; k++) {
        if (!bitstreams[k].getFormat().isInternal()) {
          out.print("String_Node_Str");
          out.print(bitstreams[k].getName());
          out.print("String_Node_Str");
          out.print(bitstreams[k].getSize() / 1024);
          out.print("String_Node_Str");
          out.print(bitstreams[k].getFormatDescription());
          out.print("String_Node_Str");
          out.print(request.getContextPath());
          out.print("String_Node_Str");
          out.print(bitstreams[k].getID() + "String_Node_Str");
          out.print(URLEncoder.encode(bitstreams[k].getName()));
          out.print("String_Node_Str");
        }
      }
    }
    out.println("String_Node_Str");
  }
  out.println("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * List bitstreams in the item
 */
private void listBitstreams() throws IOException {
  JspWriter out=pageContext.getOut();
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  out.print("String_Node_Str");
  out.println("String_Node_Str");
  Bundle[] bundles=item.getBundles();
  if (bundles.length == 0) {
    out.println("String_Node_Str");
  }
 else {
    boolean multiFile=(bundles.length > 2);
    out.println("String_Node_Str");
    if (multiFile) {
      out.println("String_Node_Str");
    }
    out.println("String_Node_Str");
    for (int i=0; i < bundles.length; i++) {
      Bitstream[] bitstreams=bundles[i].getBitstreams();
      for (int k=0; k < bitstreams.length; k++) {
        if (!bitstreams[k].getFormat().isInternal()) {
          out.print("String_Node_Str");
          out.print(bitstreams[k].getName());
          if (multiFile) {
            out.print("String_Node_Str");
            String desc=bitstreams[k].getDescription();
            out.print(desc != null ? desc : "String_Node_Str");
          }
          out.print("String_Node_Str");
          out.print(bitstreams[k].getSize() / 1024);
          out.print("String_Node_Str");
          out.print(bitstreams[k].getFormatDescription());
          out.print("String_Node_Str");
          out.print(request.getContextPath());
          out.print("String_Node_Str");
          out.print(bitstreams[k].getID() + "String_Node_Str");
          out.print(URLEncoder.encode(bitstreams[k].getName()));
          out.print("String_Node_Str");
        }
      }
    }
    out.println("String_Node_Str");
  }
  out.println("String_Node_Str");
}
Program: 3654
Project: 3654
Buggy source:
/** 
 * Get the e-person's full name, combining first and last name in a displayable string.
 * @return  their full name
 */
public String getFullName(){
  String t=myRow.getStringColumn("String_Node_Str") + "String_Node_Str" + myRow.getStringColumn("String_Node_Str");
  return t;
}

Fixed version (ground truth):
/** 
 * Get the e-person's full name, combining first and last name in a displayable string.
 * @return  their full name
 */
public String getFullName(){
  String f=myRow.getStringColumn("String_Node_Str");
  String l=myRow.getStringColumn("String_Node_Str");
  if (l == null && f == null) {
    return getEmail();
  }
 else   if (f == null) {
    return l;
  }
 else {
    return (f + "String_Node_Str" + l);
  }
}