Program: 136487
Project: 136487
Buggy source:
/** 
 * DOC zshen Comment method "computePagination".
 */
private void computePagination(){
  disposeChartComposite();
  if (uiPagination == null) {
    uiPagination=new UIPagination(toolkit);
    uiPagination.setComposite(navigationComposite);
  }
 else {
    lastTimePageNumber=uiPagination.getCurrentPageNumber();
    uiPagination.reset();
  }
  final ModelElementIndicator[] modelElementIndicatorArrary=this.getCurrentModelElementIndicators();
  int pageSize=IndicatorPaginationInfo.getPageSize();
  int totalPages=modelElementIndicatorArrary.length / pageSize;
  List<ModelElementIndicator> modelElementIndicatorList=null;
  for (int index=0; index < totalPages; index++) {
    modelElementIndicatorList=new ArrayList<ModelElementIndicator>();
    for (int idx=0; idx < pageSize; idx++) {
      modelElementIndicatorList.add(modelElementIndicatorArrary[index * pageSize + idx]);
    }
    IndicatorPaginationInfo pginfo=new MasterPaginationInfo(form,previewChartList,modelElementIndicatorList,uiPagination,treeViewer);
    uiPagination.addPage(pginfo);
  }
  int left=modelElementIndicatorArrary.length % pageSize;
  if (left != 0 || totalPages == 0) {
    modelElementIndicatorList=new ArrayList<ModelElementIndicator>();
    for (int leftIdx=0; leftIdx < left; leftIdx++) {
      modelElementIndicatorList.add(modelElementIndicatorArrary[totalPages * pageSize + leftIdx]);
    }
    IndicatorPaginationInfo pginfo=new MasterPaginationInfo(form,previewChartList,modelElementIndicatorList,uiPagination,treeViewer);
    uiPagination.addPage(pginfo);
    totalPages++;
  }
  uiPagination.init();
}

Fixed version (ground truth):
/** 
 * DOC zshen Comment method "computePagination".
 */
private void computePagination(){
  disposeChartComposite();
  if (uiPagination == null) {
    uiPagination=new UIPagination(toolkit,navigationComposite);
  }
 else {
    lastTimePageNumber=uiPagination.getCurrentPageNumber();
    uiPagination.reset();
  }
  final ModelElementIndicator[] modelElementIndicatorArrary=this.getCurrentModelElementIndicators();
  int pageSize=IndicatorPaginationInfo.getPageSize();
  int totalPages=modelElementIndicatorArrary.length / pageSize;
  List<ModelElementIndicator> modelElementIndicatorList=null;
  for (int index=0; index < totalPages; index++) {
    modelElementIndicatorList=new ArrayList<ModelElementIndicator>();
    for (int idx=0; idx < pageSize; idx++) {
      modelElementIndicatorList.add(modelElementIndicatorArrary[index * pageSize + idx]);
    }
    IndicatorPaginationInfo pginfo=new MasterPaginationInfo(form,previewChartList,modelElementIndicatorList,uiPagination,treeViewer);
    uiPagination.addPage(pginfo);
  }
  int left=modelElementIndicatorArrary.length % pageSize;
  if (left != 0 || totalPages == 0) {
    modelElementIndicatorList=new ArrayList<ModelElementIndicator>();
    for (int leftIdx=0; leftIdx < left; leftIdx++) {
      modelElementIndicatorList.add(modelElementIndicatorArrary[totalPages * pageSize + leftIdx]);
    }
    IndicatorPaginationInfo pginfo=new MasterPaginationInfo(form,previewChartList,modelElementIndicatorList,uiPagination,treeViewer);
    uiPagination.addPage(pginfo);
    totalPages++;
  }
  uiPagination.init();
}