Program: 51953
Project: 51953
Buggy source:
public void addBody(Body body) throws WingException, SQLException {
  String baseURL=contextPath + "String_Node_Str" + knot.getId();
  String query=decodeFromURL(parameters.getParameter("String_Node_Str","String_Node_Str"));
  int page=parameters.getParameterAsInteger("String_Node_Str",0);
  int highlightID=parameters.getParameterAsInteger("String_Node_Str",-1);
  int resultCount=groupService.searchResultCount(context,query);
  java.util.List<Group> groups=groupService.search(context,query,page * PAGE_SIZE,PAGE_SIZE);
  Division main=body.addInteractiveDivision("String_Node_Str",contextPath + "String_Node_Str",Division.METHOD_POST,"String_Node_Str");
  main.setHead(T_main_head);
  Division actions=main.addDivision("String_Node_Str");
  actions.setHead(T_actions_head);
  List actionsList=actions.addList("String_Node_Str");
  actionsList.addLabel(T_actions_create);
  actionsList.addItemXref(baseURL + "String_Node_Str",T_actions_create_link);
  actionsList.addLabel(T_actions_browse);
  actionsList.addItemXref(baseURL + "String_Node_Str",T_actions_browse_link);
  actionsList.addLabel(T_actions_search);
  org.dspace.app.xmlui.wing.element.Item actionItem=actionsList.addItem();
  Text queryField=actionItem.addText("String_Node_Str");
  queryField.setAutofocus("String_Node_Str");
  if (query != null) {
    queryField.setValue(query);
  }
  queryField.setHelp(T_search_help);
  actionItem.addButton("String_Node_Str").setValue(T_go);
  Division search=main.addDivision("String_Node_Str");
  search.setHead(T_search_head);
  if (resultCount > PAGE_SIZE) {
    int firstIndex=page * PAGE_SIZE + 1;
    int lastIndex=page * PAGE_SIZE + groups.size();
    String nextURL=null, prevURL=null;
    if (page < (resultCount / PAGE_SIZE)) {
      nextURL=baseURL + "String_Node_Str" + (page + 1);
    }
    if (page > 0) {
      prevURL=baseURL + "String_Node_Str" + (page - 1);
    }
    search.setSimplePagination(resultCount,firstIndex,lastIndex,prevURL,nextURL);
  }
  Table table=search.addTable("String_Node_Str",groups.size() + 1,1);
  Row header=table.addRow(Row.ROLE_HEADER);
  header.addCell().addContent(T_search_column1);
  header.addCell().addContent(T_search_column2);
  header.addCell().addContent(T_search_column3);
  header.addCell().addContent(T_search_column4);
  header.addCell().addContent(T_search_column5);
  for (  Group group : groups) {
    Row row;
    if (group.getID().toString().equals(highlightID)) {
      row=table.addRow(null,null,"String_Node_Str");
    }
 else {
      row=table.addRow();
    }
    if (group.getID() != null) {
      CheckBox select=row.addCell().addCheckBox("String_Node_Str");
      select.setLabel(group.getID().toString());
      select.addOption(group.getID().toString());
    }
 else {
      row.addCell();
    }
    row.addCell().addContent(group.getID().toString());
    row.addCell().addXref(baseURL + "String_Node_Str" + group.getID(),group.getName());
    int memberCount=group.getMembers().size() + group.getMemberGroups().size();
    row.addCell().addContent(memberCount == 0 ? "String_Node_Str" : String.valueOf(memberCount));
    Cell cell=row.addCell();
    String groupName=group.getName();
    DSpaceObject collectionOrCommunity=null;
    String collectionOrCommunityName=null;
    UUID id;
    id=FlowGroupUtils.getCollectionId(context,groupName);
    if (id != null) {
      Collection collection=collectionService.find(context,id);
      if (collection != null) {
        collectionOrCommunityName=collection.getName();
        collectionOrCommunity=collection;
      }
    }
 else {
      id=FlowGroupUtils.getCommunityId(context,groupName);
      if (id != null) {
        Community community=communityService.find(context,id);
        if (community != null) {
          collectionOrCommunityName=community.getName();
          collectionOrCommunity=community;
        }
      }
    }
    if (collectionOrCommunity != null) {
      if (collectionOrCommunityName == null) {
        collectionOrCommunityName="String_Node_Str";
      }
 else       if (collectionOrCommunityName.length() > MAX_COLLECTION_OR_COMMUNITY_NAME) {
        collectionOrCommunityName=collectionOrCommunityName.substring(0,MAX_COLLECTION_OR_COMMUNITY_NAME - 3) + "String_Node_Str";
      }
      cell.addContent(collectionOrCommunityName + "String_Node_Str");
      Highlight highlight=cell.addHighlight("String_Node_Str");
      highlight.addContent("String_Node_Str");
      highlight.addXref(contextPath + "String_Node_Str" + collectionOrCommunity.getHandle(),T_collection_link);
      highlight.addContent("String_Node_Str");
    }
  }
  if (groups.size() <= 0) {
    Cell cell=table.addRow().addCell(1,5);
    cell.addHighlight("String_Node_Str").addContent(T_no_results);
  }
 else {
    search.addPara().addButton("String_Node_Str").setValue(T_submit_delete);
  }
  search.addHidden("String_Node_Str").setValue(knot.getId());
}

Fixed version (ground truth):
public void addBody(Body body) throws WingException, SQLException {
  String baseURL=contextPath + "String_Node_Str" + knot.getId();
  String query=decodeFromURL(parameters.getParameter("String_Node_Str","String_Node_Str"));
  int page=parameters.getParameterAsInteger("String_Node_Str",0);
  String highlightID=parameters.getParameter("String_Node_Str",null);
  int resultCount=groupService.searchResultCount(context,query);
  java.util.List<Group> groups=groupService.search(context,query,page * PAGE_SIZE,PAGE_SIZE);
  Division main=body.addInteractiveDivision("String_Node_Str",contextPath + "String_Node_Str",Division.METHOD_POST,"String_Node_Str");
  main.setHead(T_main_head);
  Division actions=main.addDivision("String_Node_Str");
  actions.setHead(T_actions_head);
  List actionsList=actions.addList("String_Node_Str");
  actionsList.addLabel(T_actions_create);
  actionsList.addItemXref(baseURL + "String_Node_Str",T_actions_create_link);
  actionsList.addLabel(T_actions_browse);
  actionsList.addItemXref(baseURL + "String_Node_Str",T_actions_browse_link);
  actionsList.addLabel(T_actions_search);
  org.dspace.app.xmlui.wing.element.Item actionItem=actionsList.addItem();
  Text queryField=actionItem.addText("String_Node_Str");
  queryField.setAutofocus("String_Node_Str");
  if (query != null) {
    queryField.setValue(query);
  }
  queryField.setHelp(T_search_help);
  actionItem.addButton("String_Node_Str").setValue(T_go);
  Division search=main.addDivision("String_Node_Str");
  search.setHead(T_search_head);
  if (resultCount > PAGE_SIZE) {
    int firstIndex=page * PAGE_SIZE + 1;
    int lastIndex=page * PAGE_SIZE + groups.size();
    String nextURL=null, prevURL=null;
    if (page < (resultCount / PAGE_SIZE)) {
      nextURL=baseURL + "String_Node_Str" + (page + 1);
    }
    if (page > 0) {
      prevURL=baseURL + "String_Node_Str" + (page - 1);
    }
    search.setSimplePagination(resultCount,firstIndex,lastIndex,prevURL,nextURL);
  }
  Table table=search.addTable("String_Node_Str",groups.size() + 1,1);
  Row header=table.addRow(Row.ROLE_HEADER);
  header.addCell().addContent(T_search_column1);
  header.addCell().addContent(T_search_column2);
  header.addCell().addContent(T_search_column3);
  header.addCell().addContent(T_search_column4);
  header.addCell().addContent(T_search_column5);
  for (  Group group : groups) {
    Row row;
    if (group.getID().toString().equals(highlightID)) {
      row=table.addRow(null,null,"String_Node_Str");
    }
 else {
      row=table.addRow();
    }
    if (group.getID() != null) {
      CheckBox select=row.addCell().addCheckBox("String_Node_Str");
      select.setLabel(group.getID().toString());
      select.addOption(group.getID().toString());
    }
 else {
      row.addCell();
    }
    row.addCell().addContent(group.getID().toString());
    row.addCell().addXref(baseURL + "String_Node_Str" + group.getID(),group.getName());
    int memberCount=group.getMembers().size() + group.getMemberGroups().size();
    row.addCell().addContent(memberCount == 0 ? "String_Node_Str" : String.valueOf(memberCount));
    Cell cell=row.addCell();
    String groupName=group.getName();
    DSpaceObject collectionOrCommunity=null;
    String collectionOrCommunityName=null;
    UUID id;
    id=FlowGroupUtils.getCollectionId(context,groupName);
    if (id != null) {
      Collection collection=collectionService.find(context,id);
      if (collection != null) {
        collectionOrCommunityName=collection.getName();
        collectionOrCommunity=collection;
      }
    }
 else {
      id=FlowGroupUtils.getCommunityId(context,groupName);
      if (id != null) {
        Community community=communityService.find(context,id);
        if (community != null) {
          collectionOrCommunityName=community.getName();
          collectionOrCommunity=community;
        }
      }
    }
    if (collectionOrCommunity != null) {
      if (collectionOrCommunityName == null) {
        collectionOrCommunityName="String_Node_Str";
      }
 else       if (collectionOrCommunityName.length() > MAX_COLLECTION_OR_COMMUNITY_NAME) {
        collectionOrCommunityName=collectionOrCommunityName.substring(0,MAX_COLLECTION_OR_COMMUNITY_NAME - 3) + "String_Node_Str";
      }
      cell.addContent(collectionOrCommunityName + "String_Node_Str");
      Highlight highlight=cell.addHighlight("String_Node_Str");
      highlight.addContent("String_Node_Str");
      highlight.addXref(contextPath + "String_Node_Str" + collectionOrCommunity.getHandle(),T_collection_link);
      highlight.addContent("String_Node_Str");
    }
  }
  if (groups.size() <= 0) {
    Cell cell=table.addRow().addCell(1,5);
    cell.addHighlight("String_Node_Str").addContent(T_no_results);
  }
 else {
    search.addPara().addButton("String_Node_Str").setValue(T_submit_delete);
  }
  search.addHidden("String_Node_Str").setValue(knot.getId());
}