nus-yam/ex-repair huggingface dataset:
Program: 52340
Project: 52340
Buggy source:
public int doOffsetQuery(String column,String value,boolean isAscending) throws BrowseException {
  TableRowIterator tri=null;
  try {
    List paramsList=new ArrayList();
    StringBuffer queryBuf=new StringBuffer();
    queryBuf.append("String_Node_Str").append(column).append("String_Node_Str");
    buildSelectStatement(queryBuf,paramsList);
    if (isAscending) {
      queryBuf.append("String_Node_Str").append(column).append("String_Node_Str");
      paramsList.add(value);
    }
 else {
      queryBuf.append("String_Node_Str").append(column).append("String_Node_Str");
      paramsList.add(value + Character.MAX_VALUE);
    }
    if (containerTable != null || (value != null && valueField != null && tableDis != null && tableMap != null)) {
      queryBuf.append("String_Node_Str").append("String_Node_Str");
      queryBuf.append(table).append("String_Node_Str");
    }
    tri=DatabaseManager.query(context,queryBuf.toString(),paramsList.toArray());
    TableRow row;
    if (tri.hasNext()) {
      row=tri.next();
      return (int)row.getLongColumn("String_Node_Str");
    }
 else {
      return 0;
    }
  }
 catch (  SQLException e) {
    throw new BrowseException(e);
  }
 finally {
    if (tri != null) {
      tri.close();
    }
  }
}

Fixed version (ground truth):
public int doOffsetQuery(String column,String value,boolean isAscending) throws BrowseException {
  TableRowIterator tri=null;
  if (column == null || value == null)   return 0;
  try {
    List paramsList=new ArrayList();
    StringBuffer queryBuf=new StringBuffer();
    queryBuf.append("String_Node_Str").append(column).append("String_Node_Str");
    buildSelectStatement(queryBuf,paramsList);
    if (isAscending) {
      queryBuf.append("String_Node_Str").append(column).append("String_Node_Str");
      paramsList.add(value);
    }
 else {
      queryBuf.append("String_Node_Str").append(column).append("String_Node_Str");
      paramsList.add(value + Character.MAX_VALUE);
    }
    if (containerTable != null || (value != null && valueField != null && tableDis != null && tableMap != null)) {
      queryBuf.append("String_Node_Str").append("String_Node_Str");
      queryBuf.append(table).append("String_Node_Str");
    }
    tri=DatabaseManager.query(context,queryBuf.toString(),paramsList.toArray());
    TableRow row;
    if (tri.hasNext()) {
      row=tri.next();
      return (int)row.getLongColumn("String_Node_Str");
    }
 else {
      return 0;
    }
  }
 catch (  SQLException e) {
    throw new BrowseException(e);
  }
 finally {
    if (tri != null) {
      tri.close();
    }
  }
}
Program: 52341
Project: 52341
Buggy source:
public static Identifiable getResource(Context context,ResolvableIdentifier ri) throws IdentifierException {
  try {
    ObjectIdentifier oid=ri.getObjectIdentifier();
    if (oid.getResourceTypeID() == -1 || oid.getResourceID() == -1) {
      ObjectIdentifierDAO dao=ObjectIdentifierDAOFactory.getInstance(context);
      ObjectIdentifier noid=dao.retrieve(oid.getUUID());
      if (noid == null) {
        return null;
      }
    }
    return IdentifierService.getObjectByResourceID(context,oid);
  }
 catch (  ObjectIdentifierStorageException e) {
    log.error("String_Node_Str",e);
    throw new IdentifierException(e);
  }
}

Fixed version (ground truth):
public static Identifiable getResource(Context context,ResolvableIdentifier ri) throws IdentifierException {
  try {
    ObjectIdentifier oid=ri.getObjectIdentifier();
    if (oid.getResourceTypeID() == -1 || oid.getResourceID() == -1) {
      ObjectIdentifierDAO dao=ObjectIdentifierDAOFactory.getInstance(context);
      ObjectIdentifier noid=dao.retrieve(oid.getUUID());
      if (noid == null) {
        return null;
      }
      oid=noid;
    }
    return IdentifierService.getObjectByResourceID(context,oid);
  }
 catch (  ObjectIdentifierStorageException e) {
    log.error("String_Node_Str",e);
    throw new IdentifierException(e);
  }
}
Program: 52347
Project: 52347
Buggy source:
/** 
 * Get the limit clause to perform search result truncation.  Will return something of the form: <code> LIMIT [limit] </code>
 */
private void buildRowLimitAndOffset(StringBuffer queryBuf,List params){
  if (limit > 0 || offset > 0) {
    queryBuf.insert(0,"String_Node_Str");
    queryBuf.append("String_Node_Str");
  }
  if (limit > 0) {
    queryBuf.append("String_Node_Str");
    if (offset > 0)     params.add(new Integer(limit + offset));
 else     params.add(new Integer(limit));
  }
  if (offset > -1) {
    queryBuf.insert(0,"String_Node_Str");
    queryBuf.append("String_Node_Str");
    params.add(new Integer(offset));
  }
}

Fixed version (ground truth):
/** 
 * Get the limit clause to perform search result truncation.  Will return something of the form: <code> LIMIT [limit] </code>
 */
private void buildRowLimitAndOffset(StringBuffer queryBuf,List params){
  if (limit > 0 || offset > 0) {
    queryBuf.insert(0,"String_Node_Str");
    queryBuf.append("String_Node_Str");
  }
  if (limit > 0) {
    queryBuf.append("String_Node_Str");
    if (offset > 0)     params.add(new Integer(limit + offset));
 else     params.add(new Integer(limit));
  }
  if (offset > 0) {
    queryBuf.insert(0,"String_Node_Str");
    queryBuf.append("String_Node_Str");
    params.add(new Integer(offset));
  }
}
Program: 52350
Project: 52350
Buggy source:
/** 
 * Query DSpace for a list of all items / collections / or communities that match the given search query.
 * @return The associated query results.
 */
protected void performSearch() throws SQLException, IOException {
  if (queryResults != null)   return;
  Context context=ContextUtil.obtainContext(objectModel);
  String query=getQuery();
  DSpaceObject scope=getScope();
  int page=getParameterPage();
  QueryArgs qArgs=new QueryArgs();
  qArgs.setPageSize(getParameterRpp());
  try {
    qArgs.setSortOption(SortOption.getSortOption(getParameterSortBy()));
  }
 catch (  SortException se) {
  }
  qArgs.setSortOrder(getParameterOrder());
  qArgs.setQuery(query);
  if (page > 1)   qArgs.setStart((Integer.valueOf(page) - 1) * qArgs.getPageSize());
 else   qArgs.setStart(0);
  QueryResults qResults=null;
  if (scope instanceof Community) {
    qResults=DSQuery.doQuery(context,qArgs,(Community)scope);
  }
 else   if (scope instanceof Collection) {
    qResults=DSQuery.doQuery(context,qArgs,(Collection)scope);
  }
 else {
    qResults=DSQuery.doQuery(context,qArgs);
  }
  this.queryResults=qResults;
}

Fixed version (ground truth):
/** 
 * Query DSpace for a list of all items / collections / or communities that match the given search query.
 * @return The associated query results.
 */
protected void performSearch() throws SQLException, IOException, UIException {
  if (queryResults != null)   return;
  Context context=ContextUtil.obtainContext(objectModel);
  String query=getQuery();
  DSpaceObject scope=getScope();
  int page=getParameterPage();
  QueryArgs qArgs=new QueryArgs();
  qArgs.setPageSize(getParameterRpp());
  try {
    qArgs.setSortOption(SortOption.getSortOption(getParameterSortBy()));
  }
 catch (  SortException se) {
  }
  qArgs.setSortOrder(getParameterOrder());
  qArgs.setQuery(query);
  if (page > 1)   qArgs.setStart((Integer.valueOf(page) - 1) * qArgs.getPageSize());
 else   qArgs.setStart(0);
  QueryResults qResults=null;
  if (scope instanceof Community) {
    qResults=DSQuery.doQuery(context,qArgs,(Community)scope);
  }
 else   if (scope instanceof Collection) {
    qResults=DSQuery.doQuery(context,qArgs,(Collection)scope);
  }
 else {
    qResults=DSQuery.doQuery(context,qArgs);
  }
  this.queryResults=qResults;
}
Program: 52351
Project: 52351
Buggy source:
/** 
 * Extract the query string. Under most implementations this will be derived from the url parameters.
 * @return The query string.
 */
abstract protected String getQuery();

Fixed version (ground truth):
/** 
 * Extract the query string. Under most implementations this will be derived from the url parameters.
 * @return The query string.
 */
abstract protected String getQuery() throws UIException ;
Program: 52352
Project: 52352
Buggy source:
/** 
 * Build the query field for the given cell.
 * @param row The current row.
 * @param cell The current cell.
 */
private void buildQueryField(int row,Cell cell) throws WingException {
  Request request=ObjectModelHelper.getRequest(objectModel);
  String current=request.getParameter("String_Node_Str" + row);
  Text text=cell.addText("String_Node_Str" + row);
  if (current != null)   text.setValue(current);
}

Fixed version (ground truth):
/** 
 * Build the query field for the given cell.
 * @param row The current row.
 * @param cell The current cell.
 */
private void buildQueryField(int row,Cell cell) throws WingException {
  Request request=ObjectModelHelper.getRequest(objectModel);
  String current=URLDecode(request.getParameter("String_Node_Str" + row));
  Text text=cell.addText("String_Node_Str" + row);
  if (current != null)   text.setValue(current);
}
Program: 52353
Project: 52353
Buggy source:
/** 
 * Get a list of search fields from the request object and parse them into a linear array of fileds. The field's index is preserved, so if it comes in as index 17 it will  be outputted as field 17.
 * @param request The http request object
 * @return Array of search fields
 */
public ArrayList<SearchField> getSearchFields(Request request){
  if (this.fields != null)   return this.fields;
  int numSearchField;
  try {
    String numSearchFieldStr=request.getParameter("String_Node_Str");
    numSearchField=Integer.valueOf(numSearchFieldStr);
  }
 catch (  NumberFormatException nfe) {
    numSearchField=FIELD_MAX_COUNT;
  }
  ArrayList<SearchField> fields=new ArrayList<SearchField>();
  for (int i=1; i <= numSearchField; i++) {
    String field=request.getParameter("String_Node_Str" + i);
    String query=request.getParameter("String_Node_Str" + i);
    String conjunction=request.getParameter("String_Node_Str" + i);
    if (field != null) {
      field=field.trim();
      if (field.length() == 0)       field=null;
    }
    if (query != null) {
      query=query.trim();
      if (query.length() == 0)       query=null;
    }
    if (conjunction != null) {
      conjunction=conjunction.trim();
      if (conjunction.length() == 0)       conjunction=null;
    }
    if (field == null)     field="String_Node_Str";
    if (conjunction == null)     conjunction="String_Node_Str";
    if (query != null)     fields.add(new SearchField(i,field,query,conjunction));
  }
  this.fields=fields;
  return this.fields;
}

Fixed version (ground truth):
/** 
 * Get a list of search fields from the request object and parse them into a linear array of fileds. The field's index is preserved, so if it comes in as index 17 it will  be outputted as field 17.
 * @param request The http request object
 * @return Array of search fields
 * @throws UIException 
 */
public ArrayList<SearchField> getSearchFields(Request request) throws UIException {
  if (this.fields != null)   return this.fields;
  int numSearchField;
  try {
    String numSearchFieldStr=request.getParameter("String_Node_Str");
    numSearchField=Integer.valueOf(numSearchFieldStr);
  }
 catch (  NumberFormatException nfe) {
    numSearchField=FIELD_MAX_COUNT;
  }
  ArrayList<SearchField> fields=new ArrayList<SearchField>();
  for (int i=1; i <= numSearchField; i++) {
    String field=request.getParameter("String_Node_Str" + i);
    String query=URLDecode(request.getParameter("String_Node_Str" + i));
    String conjunction=request.getParameter("String_Node_Str" + i);
    if (field != null) {
      field=field.trim();
      if (field.length() == 0)       field=null;
    }
    if (query != null) {
      query=query.trim();
      if (query.length() == 0)       query=null;
    }
    if (conjunction != null) {
      conjunction=conjunction.trim();
      if (conjunction.length() == 0)       conjunction=null;
    }
    if (field == null)     field="String_Node_Str";
    if (conjunction == null)     conjunction="String_Node_Str";
    if (query != null)     fields.add(new SearchField(i,field,query,conjunction));
  }
  this.fields=fields;
  return this.fields;
}
Program: 52354
Project: 52354
Buggy source:
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  Division search=body.addInteractiveDivision("String_Node_Str",contextPath + "String_Node_Str",Division.METHOD_POST,"String_Node_Str");
  search.setHead(T_head);
  search.addPara(T_para1);
  Para fields=search.addPara();
  fields.addText("String_Node_Str");
  fields.addButton("String_Node_Str").setValue(T_go);
}

Fixed version (ground truth):
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  Division search=body.addInteractiveDivision("String_Node_Str",contextPath + "String_Node_Str",Division.METHOD_GET,"String_Node_Str");
  search.setHead(T_head);
  search.addPara(T_para1);
  Para fields=search.addPara();
  fields.addText("String_Node_Str");
  fields.addButton("String_Node_Str").setValue(T_go);
}
Program: 52355
Project: 52355
Buggy source:
/** 
 * build the DRI page representing the body of the search query. This provides a widget to generate a new query and list of search results if present.
 */
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  String queryString=getQuery();
  Division search=body.addDivision("String_Node_Str","String_Node_Str");
  search.setHead(T_head);
  Division query=search.addInteractiveDivision("String_Node_Str","String_Node_Str",Division.METHOD_POST,"String_Node_Str");
  List queryList=query.addList("String_Node_Str",List.TYPE_FORM);
  if (variableScope()) {
    Select scope=queryList.addItem().addSelect("String_Node_Str");
    scope.setLabel(T_search_scope);
    buildScopeList(scope);
  }
  Text text=queryList.addItem().addText("String_Node_Str");
  text.setLabel(T_full_text_search);
  text.setValue(queryString);
  buildSearchControls(query);
  query.addPara(null,"String_Node_Str").addButton("String_Node_Str").setValue(T_go);
  buildSearchResultsDivision(search);
}

Fixed version (ground truth):
/** 
 * build the DRI page representing the body of the search query. This provides a widget to generate a new query and list of search results if present.
 */
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  String queryString=getQuery();
  Division search=body.addDivision("String_Node_Str","String_Node_Str");
  search.setHead(T_head);
  Division query=search.addInteractiveDivision("String_Node_Str","String_Node_Str",Division.METHOD_GET,"String_Node_Str");
  List queryList=query.addList("String_Node_Str",List.TYPE_FORM);
  if (variableScope()) {
    Select scope=queryList.addItem().addSelect("String_Node_Str");
    scope.setLabel(T_search_scope);
    buildScopeList(scope);
  }
  Text text=queryList.addItem().addText("String_Node_Str");
  text.setLabel(T_full_text_search);
  text.setValue(queryString);
  buildSearchControls(query);
  query.addPara(null,"String_Node_Str").addButton("String_Node_Str").setValue(T_go);
  buildSearchResultsDivision(search);
}
Program: 52356
Project: 52356
Buggy source:
/** 
 * Get the search query from the URL parameter, if none is found the empty string is returned.
 */
protected String getQuery(){
  Request request=ObjectModelHelper.getRequest(objectModel);
  String query=request.getParameter("String_Node_Str");
  if (query == null)   return "String_Node_Str";
  return query;
}

Fixed version (ground truth):
/** 
 * Get the search query from the URL parameter, if none is found the empty string is returned.
 */
protected String getQuery() throws UIException {
  Request request=ObjectModelHelper.getRequest(objectModel);
  String query=URLDecode(request.getParameter("String_Node_Str"));
  if (query == null)   return "String_Node_Str";
  return query;
}
Program: 52358
Project: 52358
Buggy source:
/** 
 * Decode the given string from URL transmission.
 * @param encodedString The encoded string.
 * @return The unencoded string
 */
public static String URLDecode(String encodedString) throws UIException {
  try {
    return URLDecoder.decode(encodedString,Constants.DEFAULT_ENCODING);
  }
 catch (  UnsupportedEncodingException uee) {
    throw new UIException(uee);
  }
}

Fixed version (ground truth):
/** 
 * Decode the given string from URL transmission.
 * @param encodedString The encoded string.
 * @return The unencoded string
 */
public static String URLDecode(String encodedString) throws UIException {
  if (encodedString == null)   return null;
  try {
    return URLDecoder.decode(encodedString,Constants.DEFAULT_ENCODING);
  }
 catch (  UnsupportedEncodingException uee) {
    throw new UIException(uee);
  }
}
Program: 52365
Project: 52365
Buggy source:
/** 
 */
public static Properties getProperties(){
  return (Properties)properties.clone();
}

Fixed version (ground truth):
/** 
 */
public static Properties getProperties(){
  if (properties == null) {
    loadConfig(null);
  }
  return (Properties)properties.clone();
}
Program: 52366
Project: 52366
Buggy source:
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  Division feedback=body.addInteractiveDivision("String_Node_Str",contextPath + "String_Node_Str",Division.METHOD_POST,"String_Node_Str");
  feedback.setHead(T_head);
  feedback.addPara(T_para1);
  List form=feedback.addList("String_Node_Str",List.TYPE_FORM);
  Text email=form.addItem().addText("String_Node_Str");
  email.setLabel(T_email);
  email.setHelp(T_email_help);
  email.setValue(parameters.getParameter("String_Node_Str","String_Node_Str"));
  TextArea comments=form.addItem().addTextArea("String_Node_Str");
  comments.setLabel(T_comments);
  comments.setSize(5,60);
  comments.setValue(parameters.getParameter("String_Node_Str","String_Node_Str"));
  form.addItem().addButton("String_Node_Str").setValue(T_submit);
  feedback.addHidden("String_Node_Str").setValue(parameters.getParameter("String_Node_Str","String_Node_Str"));
}

Fixed version (ground truth):
public void addBody(Body body) throws SAXException, WingException, UIException, SQLException, IOException, AuthorizeException {
  Division feedback=body.addInteractiveDivision("String_Node_Str",contextPath + "String_Node_Str",Division.METHOD_POST,"String_Node_Str");
  feedback.setHead(T_head);
  feedback.addPara(T_para1);
  List form=feedback.addList("String_Node_Str",List.TYPE_FORM);
  Text email=form.addItem().addText("String_Node_Str");
  email.setLabel(T_email);
  email.setHelp(T_email_help);
  email.setValue(parameters.getParameter("String_Node_Str","String_Node_Str"));
  TextArea comments=form.addItem().addTextArea("String_Node_Str");
  comments.setLabel(T_comments);
  comments.setValue(parameters.getParameter("String_Node_Str","String_Node_Str"));
  form.addItem().addButton("String_Node_Str").setValue(T_submit);
  feedback.addHidden("String_Node_Str").setValue(parameters.getParameter("String_Node_Str","String_Node_Str"));
}
Program: 52367
Project: 52367
Buggy source:
/** 
 * figures out if the date is valid for the policy
 * @return true if policy has begun and hasn't expired yet (or no dates areset)
 */
public boolean isDateValid(){
  Date sd=getStartDate();
  Date ed=getEndDate();
  if ((sd == null) && (ed == null)) {
    return true;
  }
  Date now=new Date();
  if (sd != null) {
    if (now.before(sd)) {
      return false;
    }
  }
  if (ed != null) {
    if (now.after(sd)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * figures out if the date is valid for the policy
 * @return true if policy has begun and hasn't expired yet (or no dates areset)
 */
public boolean isDateValid(){
  Date sd=getStartDate();
  Date ed=getEndDate();
  if ((sd == null) && (ed == null)) {
    return true;
  }
  Date now=new Date();
  if (sd != null) {
    if (now.before(sd)) {
      return false;
    }
  }
  if (ed != null) {
    if (now.after(ed)) {
      return false;
    }
  }
  return true;
}
Program: 52368
Project: 52368
Buggy source:
/** 
 * figures out if the date is valid for the policy
 * @return true if policy has begun and hasn't expired yet (or no dates areset)
 */
public boolean isDateValid(){
  Date sd=getStartDate();
  Date ed=getEndDate();
  if ((sd == null) && (ed == null)) {
    return true;
  }
  Date now=new Date();
  if (sd != null) {
    if (now.before(sd)) {
      return false;
    }
  }
  if (ed != null) {
    if (now.after(sd)) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * figures out if the date is valid for the policy
 * @return true if policy has begun and hasn't expired yet (or no dates areset)
 */
public boolean isDateValid(){
  Date sd=getStartDate();
  Date ed=getEndDate();
  if ((sd == null) && (ed == null)) {
    return true;
  }
  Date now=new Date();
  if (sd != null) {
    if (now.before(sd)) {
      return false;
    }
  }
  if (ed != null) {
    if (now.after(ed)) {
      return false;
    }
  }
  return true;
}
Program: 52370
Project: 52370
Buggy source:
/** 
 * Get the total number of results.  The argument determines whether this is a distinct browse or not as this has an impact on how results are counted
 * @param distinct  is this a distinct browse or not
 * @return          the total number of results available in this type of browse
 * @throws SQLException
 * @throws BrowseException
 */
private int getTotalResults(boolean distinct) throws SQLException, BrowseException {
  log.debug(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + distinct));
  dao.setDistinct(distinct);
  String[] select={"String_Node_Str"};
  dao.setCountValues(select);
  String focusField=dao.getJumpToField();
  String focusValue=dao.getJumpToValue();
  String orderField=dao.getOrderField();
  int limit=dao.getLimit();
  int offset=dao.getOffset();
  dao.setJumpToField(null);
  dao.setJumpToValue(null);
  dao.setOrderField(null);
  dao.setLimit(-1);
  dao.setOffset(-1);
  int count=dao.doCountQuery();
  dao.setJumpToField(focusField);
  dao.setJumpToValue(focusValue);
  dao.setOrderField(orderField);
  dao.setLimit(limit);
  dao.setOffset(offset);
  log.debug(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + count));
  return count;
}

Fixed version (ground truth):
/** 
 * Get the total number of results.  The argument determines whether this is a distinct browse or not as this has an impact on how results are counted
 * @param distinct  is this a distinct browse or not
 * @return          the total number of results available in this type of browse
 * @throws SQLException
 * @throws BrowseException
 */
private int getTotalResults(boolean distinct) throws SQLException, BrowseException {
  log.debug(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + distinct));
  dao.setDistinct(distinct);
  String[] select={"String_Node_Str"};
  dao.setCountValues(select);
  String focusField=dao.getJumpToField();
  String focusValue=dao.getJumpToValue();
  String orderField=dao.getOrderField();
  int limit=dao.getLimit();
  int offset=dao.getOffset();
  dao.setJumpToField(null);
  dao.setJumpToValue(null);
  dao.setOrderField(null);
  dao.setLimit(-1);
  dao.setOffset(-1);
  int count=dao.doCountQuery();
  dao.setJumpToField(focusField);
  dao.setJumpToValue(focusValue);
  dao.setOrderField(orderField);
  dao.setLimit(limit);
  dao.setOffset(offset);
  dao.setCountValues(null);
  log.debug(LogManager.getHeader(context,"String_Node_Str","String_Node_Str" + count));
  return count;
}
Program: 52372
Project: 52372
Buggy source:
/** 
 * Set the database id of the container object.  This should be the id of a  Community or Collection.  This will constrain the results of the browse to only items or values within items that appear in the given container.
 * @param containerID
 */
public void setContainerID(int containerID);

Fixed version (ground truth):
/** 
 * Set the database id of the container object.  This should be the id of a Community or Collection.  This will constrain the results of the browse to only items or values within items that appear in the given container.
 * @param containerID
 */
public void setContainerID(int containerID);
Program: 52373
Project: 52373
Buggy source:
/** 
 * get the integer number which is the limit of the results that will be returned by any query.  The default is -1, which means unlimited results.
 * @return	the maximum possible number of results allowed to be returned
 */
public int getLimit();

Fixed version (ground truth):
/** 
 * get the integer number which is the limit of the results that will be returned by any query.  The default is -1, which means unlimited results.
 * @return  the maximum possible number of results allowed to be returned
 */
public int getLimit();
Program: 52374
Project: 52374
Buggy source:
/** 
 * Get the offset from the first result from which to return results.  This  functionality is present for backwards compatibility, but is ill advised.  All normal browse operations can be completed without it.  The default is -1, which means do not offset.
 * @return		the offset
 */
public int getOffset();

Fixed version (ground truth):
/** 
 * Get the offset from the first result from which to return results.  This functionality is present for backwards compatibility, but is ill advised.  All normal browse operations can be completed without it.  The default is -1, which means do not offset.
 * @return      the offset
 */
public int getOffset();
Program: 52375
Project: 52375
Buggy source:
/** 
 * get the name of the field in which to look for the container id.  This is principally for use internal to the DAO.
 * @return	the name of the container id field.  For example "collection_id" or"community_id"
 */
public String getContainerIDField();

Fixed version (ground truth):
/** 
 * get the name of the field in which to look for the container id.  This is principally for use internal to the DAO.
 * @return  the name of the container id field.  For example "collection_id" or"community_id"
 */
public String getContainerIDField();
Program: 52376
Project: 52376
Buggy source:
/** 
 * Set the focus field upon which we will match a value from which to start the browse.  This will either be the "sort_value" field or one of the additional sort fields defined by configuration param focusField		the name of the focus field
 */
public void setJumpToField(String focusField);

Fixed version (ground truth):
/** 
 * Set the focus field upon which we will match a value from which to start the browse.  This will either be the "sort_value" field or one of the additional sort fields defined by configuration param focusField     the name of the focus field
 */
public void setJumpToField(String focusField);
Program: 52377
Project: 52377
Buggy source:
/** 
 * This executes a query which will count the number of results for the parameters you set.
 * @return		the integer value of the number of results found
 * @throws BrowseException
 */
public int doCountQuery() throws BrowseException ;

Fixed version (ground truth):
/** 
 * This executes a query which will count the number of results for the parameters you set.
 * @return      the integer value of the number of results found
 * @throws BrowseException
 */
public int doCountQuery() throws BrowseException ;
Program: 52378
Project: 52378
Buggy source:
/** 
 * Get the database ID of the container object.  The container object will be a Community or a Collection.
 * @return	the database id of the container, or -1 if none is set
 */
public int getContainerID();

Fixed version (ground truth):
/** 
 * Get the database ID of the container object.  The container object will be a Community or a Collection.
 * @return  the database id of the container, or -1 if none is set
 */
public int getContainerID();
Program: 52379
Project: 52379
Buggy source:
/** 
 * Set whether the query should use an equals comparator when doing less than or  greater than comparisons.  That is, if true then comparisons will be made  using the equivalent of "<=" and ">=", while if false it will use the  equivalent of "<" and ">"
 * @param equalsComparator	true to use, false to not.
 */
public void setEqualsComparator(boolean equalsComparator);

Fixed version (ground truth):
/** 
 * Set whether the query should use an equals comparator when doing less than or greater than comparisons.  That is, if true then comparisons will be made using the equivalent of "<=" and ">=", while if false it will use the equivalent of "<" and ">"
 * @param equalsComparator  true to use, false to not.
 */
public void setEqualsComparator(boolean equalsComparator);
Program: 52380
Project: 52380
Buggy source:
/** 
 * Get the array of values that we will be selecting on.  The default is to select all of the values from a given table
 * @return	an array of values to select on
 */
public String[] getSelectValues();

Fixed version (ground truth):
/** 
 * Get the array of values that we will be selecting on.  The default is to select all of the values from a given table
 * @return  an array of values to select on
 */
public String[] getSelectValues();
Program: 52381
Project: 52381
Buggy source:
/** 
 * Get the offset from the first result from which to return results.  This  functionality is present for backwards compatibility, but is ill advised.  All normal browse operations can be completed without it.  The default is -1, which means do not offset.
 * @param offset
 */
public void setOffset(int offset);

Fixed version (ground truth):
/** 
 * Get the offset from the first result from which to return results.  This functionality is present for backwards compatibility, but is ill advised.  All normal browse operations can be completed without it.  The default is -1, which means do not offset.
 * @param offset
 */
public void setOffset(int offset);
Program: 52382
Project: 52382
Buggy source:
/** 
 * Set the database field which will be used to sort result sets on
 * @param orderField	the field by which results will be sorted
 */
public void setOrderField(String orderField);

Fixed version (ground truth):
/** 
 * Set the database field which will be used to sort result sets on
 * @param orderField    the field by which results will be sorted
 */
public void setOrderField(String orderField);
Program: 52383
Project: 52383
Buggy source:
/** 
 * Does the query use the equals comparator when doing less than or greater than comparisons.  @see setEqualsComparator Default value is true
 * @return	true if using it, false if not
 */
public boolean useEqualsComparator();

Fixed version (ground truth):
/** 
 * Does the query use the equals comparator when doing less than or greater than comparisons.  @see setEqualsComparator Default value is true
 * @return  true if using it, false if not
 */
public boolean useEqualsComparator();
Program: 52384
Project: 52384
Buggy source:
/** 
 * Get the name of the field in which the value to constrain results is contained
 * @return	the name of the field
 */
public String getFilterValueField();

Fixed version (ground truth):
/** 
 * Get the name of the field in which the value to constrain results is contained
 * @return  the name of the field
 */
public String getFilterValueField();
Program: 52385
Project: 52385
Buggy source:
/** 
 * Get the array of fields that we will be counting on.
 * @return	an array of fields to be counted over
 */
public String[] getCountValues();

Fixed version (ground truth):
/** 
 * Get the array of fields that we will be counting on.
 * @return  an array of fields to be counted over
 */
public String[] getCountValues();
Program: 52386
Project: 52386
Buggy source:
/** 
 * Get the value which we are constraining all our browse results to contain.
 * @return	the value to which to constrain results
 */
public String getFilterValue();

Fixed version (ground truth):
/** 
 * Get the value which we are constraining all our browse results to contain.
 * @return  the value to which to constrain results
 */
public String getFilterValue();
Program: 52387
Project: 52387
Buggy source:
/** 
 * Set the value upon which to start the browse from.  The value supplied here will be the top result on the page of results
 * @param focusValue	the value in the focus field on which to start browsing
 */
public void setJumpToValue(String focusValue);

Fixed version (ground truth):
/** 
 * Set the value upon which to start the browse from.  The value supplied here will be the top result on the page of results
 * @param focusValue    the value in the focus field on which to start browsing
 */
public void setJumpToValue(String focusValue);
Program: 52388
Project: 52388
Buggy source:
/** 
 * Set whether the results should be sorted in ascending order (on the given sort column) or descending order.
 * @param ascending		true to ascend, false to descend
 */
public void setAscending(boolean ascending);

Fixed version (ground truth):
/** 
 * Set whether the results should be sorted in ascending order (on the given sort column) or descending order.
 * @param ascending     true to ascend, false to descend
 */
public void setAscending(boolean ascending);
Program: 52389
Project: 52389
Buggy source:
/** 
 * Set he name of the field in which the value to constrain results is  contained
 * @param valueField 	the name of the field
 */
public void setFilterValueField(String valueField);

Fixed version (ground truth):
/** 
 * Set he name of the field in which the value to constrain results is contained
 * @param valueField    the name of the field
 */
public void setFilterValueField(String valueField);
Program: 52390
Project: 52390
Buggy source:
/** 
 * Set the array of columns that we will be counting over.  In general, the wildcard (*) will suffice
 * @param fields	an array of fields to be counted over
 */
public void setCountValues(String[] fields);

Fixed version (ground truth):
/** 
 * Set the array of columns that we will be counting over.  In general, the wildcard (*) will suffice
 * @param fields    an array of fields to be counted over
 */
public void setCountValues(String[] fields);
Program: 52391
Project: 52391
Buggy source:
/** 
 * If we have specified a container id and container field, we must also specify a container table.  This is the name of the table that maps the item onto the distinct value.  Since we are in a container, this value will actually be the view which allows us to select only items which are within a given container
 * @param containerTable	the name of the container table mapping
 */
public void setContainerTable(String containerTable);

Fixed version (ground truth):
/** 
 * If we have specified a container id and container field, we must also specify a container table.  This is the name of the table that maps the item onto the distinct value.  Since we are in a container, this value will actually be the view which allows us to select only items which are within a given container
 * @param containerTable    the name of the container table mapping
 */
public void setContainerTable(String containerTable);
Program: 52392
Project: 52392
Buggy source:
/** 
 * This executes a query which returns a List object containing String values which represent the results of a single value browse (for example, the list of all subject headings).  This is most commonly used with a Distinct browse type.
 * @return	List of Strings representing the single value query results
 * @throws BrowseException
 */
public List doValueQuery() throws BrowseException ;

Fixed version (ground truth):
/** 
 * This executes a query which returns a List object containing String values which represent the results of a single value browse (for example, the list of all subject headings).  This is most commonly used with a Distinct browse type.
 * @return  List of Strings representing the single value query results
 * @throws BrowseException
 */
public List doValueQuery() throws BrowseException ;
Program: 52393
Project: 52393
Buggy source:
/** 
 * Is this a distinct value browse?
 * @return	true if distinct, false if not
 */
public boolean isDistinct();

Fixed version (ground truth):
/** 
 * Is this a distinct value browse?
 * @return  true if distinct, false if not
 */
public boolean isDistinct();
Program: 52394
Project: 52394
Buggy source:
/** 
 * This executes a query which returns the value of the "highest" (max) value in the given table's column for the given item id.
 * @param column	the column to interrogate
 * @param table		the table to query
 * @param itemID	the item id
 * @return			String representing the max value in the given column
 * @throws BrowseException
 */
public String doMaxQuery(String column,String table,int itemID) throws BrowseException ;

Fixed version (ground truth):
/** 
 * This executes a query which returns the value of the "highest" (max) value in the given table's column for the given item id.
 * @param column    the column to interrogate
 * @param table     the table to query
 * @param itemID    the item id
 * @return          String representing the max value in the given column
 * @throws BrowseException
 */
public String doMaxQuery(String column,String table,int itemID) throws BrowseException ;
Program: 52395
Project: 52395
Buggy source:
/** 
 * Get the value at which the browse will start.  The value supplied here will be the top result on the page of results.
 * @return		the value to start browsing on
 */
public String getJumpToValue();

Fixed version (ground truth):
/** 
 * Get the value at which the browse will start.  The value supplied here will be the top result on the page of results.
 * @return      the value to start browsing on
 */
public String getJumpToValue();
Program: 52396
Project: 52396
Buggy source:
/** 
 * Set the array of values to select on.  This should be a list of the columns available in the target table, or the SQL wildcards.  The default is  single element array with the standard wildcard (*)
 * @param selectValues	the values to select on
 */
public void setSelectValues(String[] selectValues);

Fixed version (ground truth):
/** 
 * Set the array of values to select on.  This should be a list of the columns available in the target table, or the SQL wildcards.  The default is single element array with the standard wildcard (*)
 * @param selectValues  the values to select on
 */
public void setSelectValues(String[] selectValues);
Program: 52397
Project: 52397
Buggy source:
/** 
 * Get the database field which will be used to do the sorting of result sets on.
 * @return		the field by which results will be sorted
 */
public String getOrderField();

Fixed version (ground truth):
/** 
 * Get the database field which will be used to do the sorting of result sets on.
 * @return      the field by which results will be sorted
 */
public String getOrderField();
Program: 52398
Project: 52398
Buggy source:
/** 
 * get the name of the table that we are querying
 * @return	the name of the table
 */
public String getTable();

Fixed version (ground truth):
/** 
 * get the name of the table that we are querying
 * @return  the name of the table
 */
public String getTable();
Program: 52399
Project: 52399
Buggy source:
/** 
 * Set the limit for how many results should be returned.  This is generally for use in paging or limiting the number of items be be displayed.  The default is -1, meaning unlimited results.  Note that if the number of results of the query is less than this number, the size of the result set will be smaller than this limit.
 * @param limit		the maximum number of results to return.
 */
public void setLimit(int limit);

Fixed version (ground truth):
/** 
 * Set the limit for how many results should be returned.  This is generally for use in paging or limiting the number of items be be displayed.  The default is -1, meaning unlimited results.  Note that if the number of results of the query is less than this number, the size of the result set will be smaller than this limit.
 * @param limit     the maximum number of results to return.
 */
public void setLimit(int limit);
Program: 52400
Project: 52400
Buggy source:
/** 
 * Set the name of the table to query
 * @param table		the name of the table
 */
public void setTable(String table);

Fixed version (ground truth):
/** 
 * Set the name of the table to query
 * @param table     the name of the table
 */
public void setTable(String table);
Program: 52401
Project: 52401
Buggy source:
/** 
 * Get the name of the container table that is being used to map items to distinct values when in a container constrained browse
 * @return	the name of the table
 */
public String getContainerTable();

Fixed version (ground truth):
/** 
 * Get the name of the container table that is being used to map items to distinct values when in a container constrained browse
 * @return  the name of the table
 */
public String getContainerTable();
Program: 52402
Project: 52402
Buggy source:
/** 
 * set the name of the field in which to look for the container id.
 * @param containerIDField	the name of the container id field.  For example "collection_id" or "community_id"
 */
public void setContainerIDField(String containerIDField);

Fixed version (ground truth):
/** 
 * set the name of the field in which to look for the container id.
 * @param containerIDField  the name of the container id field.For example "collection_id" or "community_id"
 */
public void setContainerIDField(String containerIDField);
Program: 52403
Project: 52403
Buggy source:
/** 
 * Set whether this is a distinct value browse or not
 * @param bool	true if distinct value, false if not
 */
public void setDistinct(boolean bool);

Fixed version (ground truth):
/** 
 * Set whether this is a distinct value browse or not
 * @param bool  true if distinct value, false if not
 */
public void setDistinct(boolean bool);
Program: 52404
Project: 52404
Buggy source:
/** 
 * Get the field in which we will match a focus value from which to start the browse.  This will either be the "sort_value" field or one of the additional sort fields defined by configuration
 * @return	the name of the focus field
 */
public String getJumpToField();

Fixed version (ground truth):
/** 
 * Get the field in which we will match a focus value from which to start the browse.  This will either be the "sort_value" field or one of the additional sort fields defined by configuration
 * @return  the name of the focus field
 */
public String getJumpToField();
Program: 52405
Project: 52405
Buggy source:
/** 
 * Is the sort order ascending or descending? Default value is true
 * @return	true for ascending, false for descending
 */
public boolean isAscending();

Fixed version (ground truth):
/** 
 * Is the sort order ascending or descending? Default value is true
 * @return  true for ascending, false for descending
 */
public boolean isAscending();
Program: 52406
Project: 52406
Buggy source:
/** 
 * Set the value to which all our browse results should be constrained.  For example, if you are listing all of the publications by a single author your value would be the author name.
 * @param value	the value to which to constrain results
 */
public void setFilterValue(String value);

Fixed version (ground truth):
/** 
 * Set the value to which all our browse results should be constrained.  For example, if you are listing all of the publications by a single author your value would be the author name.
 * @param value the value to which to constrain results
 */
public void setFilterValue(String value);
Program: 52407
Project: 52407
Buggy source:
/** 
 * assemble a WHERE clause with the given constraints.  This will return something of the form: <code> WHERE [focus clause] [AND] [value clause] [AND] [container constraint] </code> The container constraint is described in one of either getFullConstraint or  getDistinctConstraint, and the form of that section of the query can be found in their documentation. If either of focusClause or valueClause is null, they will be duly omitted from the WHERE clause.
 */
private void buildWhereClauseDistinctConstraints(StringBuffer queryBuf,List params){
  if (containerIDField != null && containerID != -1 && containerTable != null) {
    buildWhereClauseOpInsert(queryBuf);
    queryBuf.append("String_Node_Str");
    buildFocusedSelectTables(queryBuf);
    queryBuf.append("String_Node_Str");
    buildFocusedSelectClauses(queryBuf,params);
    queryBuf.append("String_Node_Str" + table + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * assemble a WHERE clause with the given constraints.  This will return something of the form: <code> WHERE [focus clause] [AND] [value clause] [AND] [container constraint] </code> The container constraint is described in one of either getFullConstraint or getDistinctConstraint, and the form of that section of the query can be found in their documentation. If either of focusClause or valueClause is null, they will be duly omitted from the WHERE clause.
 */
private void buildWhereClauseDistinctConstraints(StringBuffer queryBuf,List params){
  if (containerIDField != null && containerID != -1 && containerTable != null) {
    buildWhereClauseOpInsert(queryBuf);
    queryBuf.append("String_Node_Str").append(table).append("String_Node_Str");
  }
}
Program: 52408
Project: 52408
Buggy source:
/** 
 * assemble a WHERE clause with the given constraints.  This will return something of the form: <code> WHERE [focus clause] [AND] [value clause] [AND] [container constraint] </code> The container constraint is described in one of either getFullConstraint or  getDistinctConstraint, and the form of that section of the query can be found in their documentation. If either of focusClause or valueClause is null, they will be duly omitted from the WHERE clause.
 */
private void buildWhereClauseFullConstraints(StringBuffer queryBuf,List params){
  if (tableDis == null || tableMap == null) {
    if (containerIDField != null && containerID != -1) {
      buildWhereClauseOpInsert(queryBuf);
      queryBuf.append("String_Node_Str").append(table).append("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * assemble a WHERE clause with the given constraints.  This will return something of the form: <code> WHERE [focus clause] [AND] [value clause] [AND] [container constraint] </code> The container constraint is described in one of either getFullConstraint or getDistinctConstraint, and the form of that section of the query can be found in their documentation. If either of focusClause or valueClause is null, they will be duly omitted from the WHERE clause.
 */
private void buildWhereClauseFullConstraints(StringBuffer queryBuf,List params){
  if (tableDis == null || tableMap == null) {
    if (containerIDField != null && containerID != -1) {
      buildWhereClauseOpInsert(queryBuf);
      queryBuf.append("String_Node_Str").append(table).append("String_Node_Str");
    }
  }
}
Program: 52409
Project: 52409
Buggy source:
/** 
 * Prepare the select clause using the pre-prepared arguments.  This will produce something of the form: <code> SELECT [arguments] FROM [table] </code>
 * @param queryBuf  the string value obtained from distinctClause, countClause or selectValues
 * @return  the SELECT part of the query
 */
private void buildSelectStatementDistinct(StringBuffer queryBuf,List params) throws BrowseException {
  if (queryBuf.length() == 0) {
    throw new BrowseException("String_Node_Str");
  }
  if (table == null || "String_Node_Str".equals(table)) {
    throw new BrowseException("String_Node_Str");
  }
  queryBuf.insert(0,"String_Node_Str");
  queryBuf.append("String_Node_Str");
  queryBuf.append(table);
  queryBuf.append("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Prepare the select clause using the pre-prepared arguments.  This will produce something of the form: <code> SELECT [arguments] FROM [table] </code>
 * @param queryBuf  the string value obtained from distinctClause, countClause or selectValues
 * @return  the SELECT part of the query
 */
private void buildSelectStatementDistinct(StringBuffer queryBuf,List params) throws BrowseException {
  if (queryBuf.length() == 0) {
    throw new BrowseException("String_Node_Str");
  }
  if (table == null || "String_Node_Str".equals(table)) {
    throw new BrowseException("String_Node_Str");
  }
  queryBuf.insert(0,"String_Node_Str");
  queryBuf.append("String_Node_Str");
  queryBuf.append(table);
  if (containerTable != null && tableMap != null) {
    queryBuf.append("String_Node_Str").append(tableMap).append("String_Node_Str");
    queryBuf.append("String_Node_Str");
    buildFocusedSelectTables(queryBuf);
    queryBuf.append("String_Node_Str");
    buildFocusedSelectClauses(queryBuf,params);
    queryBuf.append("String_Node_Str");
  }
  queryBuf.append("String_Node_Str");
}