Program: 52555
Project: 52555
Buggy source:
/** 
 * Render an item in the default style
 */
private void renderDefault() throws IOException, java.sql.SQLException {
  JspWriter out=pageContext.getOut();
  List fields=new LinkedList();
  DCValue[] titleDC=item.getDC("String_Node_Str",null,Item.ANY);
  if (titleDC.length == 0) {
    fields.add(new String[]{"String_Node_Str","String_Node_Str"});
  }
 else {
    fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  }
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str",Item.ANY});
  fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  DCValue[] dateIssued=item.getDC("String_Node_Str","String_Node_Str",Item.ANY);
  DCDate dd=null;
  if (dateIssued.length > 0) {
    dd=new DCDate(dateIssued[0].value);
  }
  String displayDate=UIUtil.displayDate(dd,false,false);
  fields.add(new String[]{"String_Node_Str",displayDate});
  fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  DCValue[] abstrDC=item.getDC("String_Node_Str","String_Node_Str",Item.ANY);
  if (abstrDC.length > 0) {
    String abstr=abstrDC[0].value;
    if (abstr.length() > 1000) {
      abstr=abstr.substring(0,1000) + "String_Node_Str";
    }
    fields.add(new String[]{"String_Node_Str",abstr});
  }
  fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  out.println("String_Node_Str");
  Iterator fieldIterator=fields.iterator();
  while (fieldIterator.hasNext()) {
    String[] fieldData=(String[])fieldIterator.next();
    DCValue[] values;
    if (fieldData.length == 2) {
      DCValue v=new DCValue();
      v.value=fieldData[1];
      values=new DCValue[1];
      values[0]=v;
    }
 else {
      values=item.getDC(fieldData[1],fieldData[2],Item.ANY);
    }
    if (values.length > 0) {
      out.print("String_Node_Str");
      out.print(fieldData[0]);
      out.print("String_Node_Str");
      out.print(values[0].value);
      for (int j=1; j < values.length; j++) {
        out.print("String_Node_Str");
        out.print(values[j].value);
      }
      out.println("String_Node_Str");
    }
  }
  listCollections();
  out.println("String_Node_Str");
  listBitstreams();
}

Fixed version (ground truth):
/** 
 * Render an item in the default style
 */
private void renderDefault() throws IOException, java.sql.SQLException {
  JspWriter out=pageContext.getOut();
  List fields=new LinkedList();
  DCValue[] titleDC=item.getDC("String_Node_Str",null,Item.ANY);
  if (titleDC.length == 0) {
    fields.add(new String[]{"String_Node_Str","String_Node_Str"});
  }
 else {
    fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  }
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str",Item.ANY});
  fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  DCValue[] dateIssued=item.getDC("String_Node_Str","String_Node_Str",Item.ANY);
  DCDate dd=null;
  if (dateIssued.length > 0) {
    dd=new DCDate(dateIssued[0].value);
  }
  String displayDate=UIUtil.displayDate(dd,false,false);
  fields.add(new String[]{"String_Node_Str",displayDate});
  fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  DCValue[] abstrDC=item.getDC("String_Node_Str","String_Node_Str",Item.ANY);
  if (abstrDC.length > 0) {
    String abstr=abstrDC[0].value;
    if (abstr.length() > 1000) {
      abstr=abstr.substring(0,1000) + "String_Node_Str";
    }
    fields.add(new String[]{"String_Node_Str",abstr});
  }
  fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str","String_Node_Str"});
  fields.add(new String[]{"String_Node_Str","String_Node_Str",null});
  HttpServletRequest request=(HttpServletRequest)pageContext.getRequest();
  out.println("String_Node_Str");
  Iterator fieldIterator=fields.iterator();
  while (fieldIterator.hasNext()) {
    String[] fieldData=(String[])fieldIterator.next();
    DCValue[] values;
    if (fieldData.length == 2) {
      DCValue v=new DCValue();
      v.value=fieldData[1];
      values=new DCValue[1];
      values[0]=v;
    }
 else {
      values=item.getDC(fieldData[1],fieldData[2],Item.ANY);
    }
    if (values.length > 0) {
      out.print("String_Node_Str");
      out.print(fieldData[0]);
      out.print("String_Node_Str");
      out.print(Utils.addEntities(values[0].value));
      for (int j=1; j < values.length; j++) {
        out.print("String_Node_Str");
        out.print(Utils.addEntities(values[j].value));
      }
      out.println("String_Node_Str");
    }
  }
  listCollections();
  out.println("String_Node_Str");
  listBitstreams();
}