Program: 52357
Project: 52357
Buggy source:
/** 
 * Get the query parameters supplied to the browse.
 * @return
 * @throws SQLException
 * @throws UIException
 */
private BrowseParams getUserParams() throws SQLException, UIException {
  if (this.userParams != null)   return this.userParams;
  Context context=ContextUtil.obtainContext(objectModel);
  Request request=ObjectModelHelper.getRequest(objectModel);
  BrowseParams params=new BrowseParams();
  params.month=request.getParameter(BrowseParams.MONTH);
  params.year=request.getParameter(BrowseParams.YEAR);
  params.etAl=RequestUtils.getIntParameter(request,BrowseParams.ETAL);
  params.scope=new BrowserScope(context);
  DSpaceObject dso=HandleUtil.obtainHandle(objectModel);
  if (dso instanceof Community)   params.scope.setCommunity((Community)dso);
  if (dso instanceof Collection)   params.scope.setCollection((Collection)dso);
  try {
    String type=request.getParameter(BrowseParams.TYPE);
    int sortBy=RequestUtils.getIntParameter(request,BrowseParams.SORT_BY);
    BrowseIndex bi=BrowseIndex.getBrowseIndex(type);
    if (bi == null) {
      throw new BrowseException("String_Node_Str" + type);
    }
    if (sortBy == -1) {
      SortOption so=bi.getSortOption();
      if (so != null) {
        sortBy=so.getNumber();
      }
    }
 else     if (bi.isItemIndex() && !bi.isInternalIndex()) {
      try {
        SortOption bso=bi.getSortOption();
        SortOption so=SortOption.getSortOption(sortBy);
        if (bso != null && bso != so) {
          BrowseIndex newBi=BrowseIndex.getBrowseIndex(so);
          if (newBi != null) {
            bi=newBi;
            type=bi.getName();
          }
        }
      }
 catch (      SortException se) {
        throw new UIException("String_Node_Str",se);
      }
    }
    params.scope.setBrowseIndex(bi);
    params.scope.setSortBy(sortBy);
    params.scope.setJumpToItem(RequestUtils.getIntParameter(request,BrowseParams.JUMPTO_ITEM));
    params.scope.setOrder(request.getParameter(BrowseParams.ORDER));
    int offset=RequestUtils.getIntParameter(request,BrowseParams.OFFSET);
    params.scope.setOffset(offset > 0 ? offset : 0);
    params.scope.setResultsPerPage(RequestUtils.getIntParameter(request,BrowseParams.RESULTS_PER_PAGE));
    params.scope.setStartsWith(request.getParameter(BrowseParams.STARTS_WITH));
    params.scope.setFilterValue(request.getParameter(BrowseParams.FILTER_VALUE));
    params.scope.setJumpToValue(request.getParameter(BrowseParams.JUMPTO_VALUE));
    params.scope.setJumpToValueLang(request.getParameter(BrowseParams.JUMPTO_VALUE_LANG));
    params.scope.setFilterValueLang(request.getParameter(BrowseParams.FILTER_VALUE_LANG));
    if (params.scope.getFilterValue() != null)     params.scope.setBrowseLevel(1);
    if (params.year != null && !"String_Node_Str".equals(params.year) && !"String_Node_Str".equals(params.year)) {
      String startsWith=params.year;
      if ((params.month != null) && !"String_Node_Str".equals(params.month) && !"String_Node_Str".equals(params.month)) {
        if ("String_Node_Str".equals(params.scope.getOrder())) {
          params.month=Integer.toString((Integer.parseInt(params.month) - 1));
        }
        if (params.month.length() == 1) {
          params.month="String_Node_Str" + params.month;
        }
        startsWith=params.year + "String_Node_Str" + params.month;
        if ("String_Node_Str".equals(params.scope.getOrder())) {
          startsWith=startsWith + "String_Node_Str";
        }
      }
      params.scope.setStartsWith(startsWith);
    }
  }
 catch (  BrowseException bex) {
    throw new UIException("String_Node_Str",bex);
  }
  this.userParams=params;
  return params;
}

Fixed version (ground truth):
/** 
 * Get the query parameters supplied to the browse.
 * @return
 * @throws SQLException
 * @throws UIException
 */
private BrowseParams getUserParams() throws SQLException, UIException {
  if (this.userParams != null)   return this.userParams;
  Context context=ContextUtil.obtainContext(objectModel);
  Request request=ObjectModelHelper.getRequest(objectModel);
  BrowseParams params=new BrowseParams();
  params.month=request.getParameter(BrowseParams.MONTH);
  params.year=request.getParameter(BrowseParams.YEAR);
  params.etAl=RequestUtils.getIntParameter(request,BrowseParams.ETAL);
  params.scope=new BrowserScope(context);
  DSpaceObject dso=HandleUtil.obtainHandle(objectModel);
  if (dso instanceof Community)   params.scope.setCommunity((Community)dso);
  if (dso instanceof Collection)   params.scope.setCollection((Collection)dso);
  try {
    String type=request.getParameter(BrowseParams.TYPE);
    int sortBy=RequestUtils.getIntParameter(request,BrowseParams.SORT_BY);
    BrowseIndex bi=BrowseIndex.getBrowseIndex(type);
    if (bi == null) {
      throw new BrowseException("String_Node_Str" + type);
    }
    if (sortBy == -1) {
      SortOption so=bi.getSortOption();
      if (so != null) {
        sortBy=so.getNumber();
      }
    }
 else     if (bi.isItemIndex() && !bi.isInternalIndex()) {
      try {
        SortOption bso=bi.getSortOption();
        SortOption so=SortOption.getSortOption(sortBy);
        if (bso != null && bso != so) {
          BrowseIndex newBi=BrowseIndex.getBrowseIndex(so);
          if (newBi != null) {
            bi=newBi;
            type=bi.getName();
          }
        }
      }
 catch (      SortException se) {
        throw new UIException("String_Node_Str",se);
      }
    }
    params.scope.setBrowseIndex(bi);
    params.scope.setSortBy(sortBy);
    params.scope.setJumpToItem(RequestUtils.getIntParameter(request,BrowseParams.JUMPTO_ITEM));
    params.scope.setOrder(request.getParameter(BrowseParams.ORDER));
    int offset=RequestUtils.getIntParameter(request,BrowseParams.OFFSET);
    params.scope.setOffset(offset > 0 ? offset : 0);
    params.scope.setResultsPerPage(RequestUtils.getIntParameter(request,BrowseParams.RESULTS_PER_PAGE));
    params.scope.setStartsWith(URLDecode(request.getParameter(BrowseParams.STARTS_WITH)));
    params.scope.setFilterValue(URLDecode(request.getParameter(BrowseParams.FILTER_VALUE)));
    params.scope.setJumpToValue(URLDecode(request.getParameter(BrowseParams.JUMPTO_VALUE)));
    params.scope.setJumpToValueLang(URLDecode(request.getParameter(BrowseParams.JUMPTO_VALUE_LANG)));
    params.scope.setFilterValueLang(URLDecode(request.getParameter(BrowseParams.FILTER_VALUE_LANG)));
    if (params.scope.getFilterValue() != null)     params.scope.setBrowseLevel(1);
    if (params.year != null && !"String_Node_Str".equals(params.year) && !"String_Node_Str".equals(params.year)) {
      String startsWith=params.year;
      if ((params.month != null) && !"String_Node_Str".equals(params.month) && !"String_Node_Str".equals(params.month)) {
        if ("String_Node_Str".equals(params.scope.getOrder())) {
          params.month=Integer.toString((Integer.parseInt(params.month) - 1));
        }
        if (params.month.length() == 1) {
          params.month="String_Node_Str" + params.month;
        }
        startsWith=params.year + "String_Node_Str" + params.month;
        if ("String_Node_Str".equals(params.scope.getOrder())) {
          startsWith=startsWith + "String_Node_Str";
        }
      }
      params.scope.setStartsWith(startsWith);
    }
  }
 catch (  BrowseException bex) {
    throw new UIException("String_Node_Str",bex);
  }
  this.userParams=params;
  return params;
}