Program: 52464
Project: 52464
Buggy source:
/** 
 * Perform a limited browse, which only returns the results requested,  without any extraneous information.  To perform a full browse, use BrowseEngine.browse() above.  This supports Item browse only, and does not currently support focus or values.  This method is used, for example, to generate the Recently Submitted Items results.
 * @param bs	the scope of the browse
 * @return		the results of the browse
 */
public BrowseInfo browseMini(BrowserScope bs) throws BrowseException {
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
  this.scope=bs;
  browseIndex=scope.getBrowseIndex();
  dao.setTable(browseIndex.getTableName(scope.inCommunity(),scope.inCollection()));
  dao.setAscending(scope.isAscending());
  if (scope.inCollection() || scope.inCommunity()) {
    if (scope.inCollection()) {
      Collection col=(Collection)scope.getBrowseContainer();
      dao.setContainerIDField("String_Node_Str");
      dao.setContainerID(col.getID());
    }
 else     if (scope.inCommunity()) {
      Community com=(Community)scope.getBrowseContainer();
      dao.setContainerIDField("String_Node_Str");
      dao.setContainerID(com.getID());
    }
  }
  dao.setLimit(scope.getResultsPerPage());
  String orderBy=browseIndex.getSortField();
  if (scope.getSortBy() > 0) {
    orderBy="String_Node_Str" + Integer.toString(scope.getSortBy());
  }
  dao.setOrderField(orderBy);
  List results=dao.doQuery();
  BrowseInfo browseInfo=new BrowseInfo(results,0,scope.getResultsPerPage(),0);
  browseInfo.setBrowseIndex(browseIndex);
  browseInfo.setSortOption(scope.getSortOption());
  browseInfo.setAscending(scope.isAscending());
  if (scope.inCollection() || scope.inCommunity()) {
    browseInfo.setBrowseContainer(scope.getBrowseContainer());
  }
  browseInfo.setResultsPerPage(scope.getResultsPerPage());
  browseInfo.setEtAl(scope.getEtAl());
  return browseInfo;
}

Fixed version (ground truth):
/** 
 * Perform a limited browse, which only returns the results requested,  without any extraneous information.  To perform a full browse, use BrowseEngine.browse() above.  This supports Item browse only, and does not currently support focus or values.  This method is used, for example, to generate the Recently Submitted Items results.
 * @param bs	the scope of the browse
 * @return		the results of the browse
 */
public BrowseInfo browseMini(BrowserScope bs) throws BrowseException {
  log.info(LogManager.getHeader(context,"String_Node_Str","String_Node_Str"));
  this.scope=bs;
  browseIndex=scope.getBrowseIndex();
  dao.setTable(browseIndex.getTableName(scope.inCommunity(),scope.inCollection()));
  dao.setAscending(scope.isAscending());
  if (scope.inCollection() || scope.inCommunity()) {
    if (scope.inCollection()) {
      Collection col=(Collection)scope.getBrowseContainer();
      dao.setContainerIDField("String_Node_Str");
      dao.setContainerID(col.getID());
    }
 else     if (scope.inCommunity()) {
      Community com=(Community)scope.getBrowseContainer();
      dao.setContainerIDField("String_Node_Str");
      dao.setContainerID(com.getID());
    }
  }
  dao.setLimit(scope.getResultsPerPage());
  String orderBy=browseIndex.getSortField(scope.isSecondLevel());
  if (scope.getSortBy() > 0) {
    orderBy="String_Node_Str" + Integer.toString(scope.getSortBy());
  }
  dao.setOrderField(orderBy);
  List results=dao.doQuery();
  BrowseInfo browseInfo=new BrowseInfo(results,0,scope.getResultsPerPage(),0);
  browseInfo.setBrowseIndex(browseIndex);
  browseInfo.setSortOption(scope.getSortOption());
  browseInfo.setAscending(scope.isAscending());
  if (scope.inCollection() || scope.inCommunity()) {
    browseInfo.setBrowseContainer(scope.getBrowseContainer());
  }
  browseInfo.setResultsPerPage(scope.getResultsPerPage());
  browseInfo.setEtAl(scope.getEtAl());
  return browseInfo;
}