nus-yam/ex-repair huggingface dataset:
Program: 75387
Project: 75387
Buggy source:
public void switchTo(String sTaskID){
  if (sCurrentActiveTask != null) {
    this.context=getCurrentTask().getContext();
  }
  sCurrentActiveTask=sTaskID;
  if (errorHints != null) {
    getCurrentTask().setErrorHints(errorHints);
  }
  getCurrentTask().setContext(context);
  errorHints=null;
  ErrorsManager.instance().removeErrors();
  detachPopup();
  dialog.switchTask();
}

Fixed version (ground truth):
public void switchTo(String sTaskID){
  if (sCurrentActiveTask != null) {
    this.context=getCurrentTask().getContext();
  }
  sCurrentActiveTask=sTaskID;
  if (errorHints != null) {
    getCurrentTask().setErrorHints(errorHints);
  }
  getCurrentTask().setContext(context);
  errorHints=null;
  ErrorsManager.instance().removeErrors();
  detachPopup();
  try {
    dialog.switchTask();
  }
 catch (  Exception e) {
    displayException(e);
  }
}
Program: 75388
Project: 75388
Buggy source:
public void dispose(){
}

Fixed version (ground truth):
public void dispose(){
  Iterator tasks=availableTasks.values().iterator();
  while (tasks.hasNext()) {
    ((ITask)tasks.next()).dispose();
  }
}
Program: 75389
Project: 75389
Buggy source:
public void widgetSelected(SelectionEvent e){
  refreshList();
  Rectangle textBounds=expressionText.getBounds();
  Point pt=expressionText.toDisplay(textBounds.x,textBounds.y);
  Rectangle rect=new Rectangle(pt.x,pt.y,expressionText.getParent().getBounds().width,textBounds.height);
  PopupSelectionList popup=new PopupSelectionList(expressionText.getParent().getShell());
  popup.setItems(popupItems);
  String value=popup.open(rect);
  int selectionIndex=popup.getSelectionIndex();
  if (value != null) {
    String newValue=null;
    if (value.equals((actions[0]))) {
      List valueList=getSelectMemberValueList();
      if (valueList == null || valueList.size() == 0) {
        MessageDialog.openInformation(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      }
 else {
        SelectValueDialog dialog=new SelectValueDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"));
        dialog.setSelectedValueList(valueList);
        if (dialog.open() == IDialogConstants.OK_ID) {
          newValue=dialog.getSelectedExprValue();
        }
      }
    }
 else     if (value.equals(actions[1])) {
      ExpressionBuilder dialog=new ExpressionBuilder(PlatformUI.getWorkbench().getDisplay().getActiveShell(),(String)getValue());
      dialog.setExpressionProvier(provider);
      if (dialog.open() == IDialogConstants.OK_ID) {
        newValue=dialog.getResult();
      }
    }
 else     if (selectionIndex > 3) {
      newValue=ExpressionUtil.createJSParameterExpression(value);
    }
    if (newValue != null) {
      setValue(newValue);
    }
    expressionText.setFocus();
  }
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  refreshList();
  Rectangle textBounds=expressionText.getBounds();
  Point pt=expressionText.toDisplay(textBounds.x,textBounds.y);
  Rectangle rect=new Rectangle(pt.x,pt.y,expressionText.getParent().getBounds().width,textBounds.height);
  PopupSelectionList popup=new PopupSelectionList(expressionText.getParent().getShell());
  popup.setItems(popupItems);
  String value=popup.open(rect);
  int selectionIndex=popup.getSelectionIndex();
  if (value != null) {
    String newValue=null;
    if (value.equals((actions[0]))) {
      List valueList=getSelectMemberValueList();
      if (valueList == null || valueList.size() == 0) {
        MessageDialog.openInformation(null,Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
      }
 else {
        SelectValueDialog dialog=new SelectValueDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(),Messages.getString("String_Node_Str"));
        dialog.setSelectedValueList(valueList);
        if (dialog.open() == IDialogConstants.OK_ID) {
          newValue=dialog.getSelectedExprValue();
        }
      }
    }
 else     if (selectionIndex > 3) {
      newValue=ExpressionUtil.createJSParameterExpression(value);
    }
    if (newValue != null) {
      setValue(newValue);
    }
    expressionText.setFocus();
  }
}
Program: 75391
Project: 75391
Buggy source:
private void createChoicePart(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  composite.setLayout(new GridLayout(3,true));
  new Label(composite,SWT.NONE).setText(LABEL_SELECT_DATA_SET_MODE);
  singleDataSet=new Button(composite,SWT.RADIO);
  singleDataSet.setText(RADIO_SINGLE);
  singleDataSet.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      refreshValueTable();
      updateButtons();
    }
  }
);
  multiDataSet=new Button(composite,SWT.RADIO);
  multiDataSet.setText(RADIO_MULTIPLE);
  multiDataSet.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      refreshValueTable();
      updateButtons();
    }
  }
);
}

Fixed version (ground truth):
private void createChoicePart(Composite parent){
  Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  composite.setLayout(new GridLayout(2,true));
  Label dataSetModeLabel=new Label(composite,SWT.NONE);
  dataSetModeLabel.setText(LABEL_SELECT_DATA_SET_MODE);
  GridData gd=new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
  gd.verticalSpan=2;
  dataSetModeLabel.setLayoutData(gd);
  singleDataSet=new Button(composite,SWT.RADIO);
  singleDataSet.setText(RADIO_SINGLE);
  singleDataSet.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      refreshValueTable();
      updateButtons();
    }
  }
);
  multiDataSet=new Button(composite,SWT.RADIO);
  multiDataSet.setText(RADIO_MULTIPLE);
  multiDataSet.addSelectionListener(new SelectionAdapter(){
    public void widgetSelected(    SelectionEvent e){
      refreshValueTable();
      updateButtons();
    }
  }
);
}
Program: 75392
Project: 75392
Buggy source:
/** 
 * Tests open design method. Test cases: <ul> <li>Case1:Open design with null ULocale. <li>Case2:Open design with a given ULocale. <li>Case3:Open design with a given design file. <li>Case4:Retrieve the session from the opened designs. <li>Case5:Check the number of designs which are kept in the session's design list. <li>Case6:Drop a design then check the size of the design list. </ul>
 * @throws DesignFileException
 */
public void testOpenDesign() throws DesignFileException {
  ULocale defaultULocale=ULocale.getDefault();
  ULocale.setDefault(ULocale.CHINA);
  DesignSession session=new DesignSession(null);
  assertEquals(ULocale.CHINA,CoreTestUtil.getSessionLocale(session));
  session=new DesignSession(ULocale.ENGLISH);
  assertEquals(ULocale.ENGLISH,CoreTestUtil.getSessionLocale(session));
  ReportDesign design=session.createDesign();
  assertNotNull(design);
  assertEquals(session,CoreTestUtil.getDesignSession(design));
  design=session.openDesign(getResource("String_Node_Str").toString());
  assertEquals(session,CoreTestUtil.getDesignSession(design));
  design=session.openDesign(getResource("String_Node_Str").toString());
  assertEquals(3,CoreTestUtil.getDesigns(session).size());
  session.drop(design);
  assertEquals(2,CoreTestUtil.getDesigns(session).size());
  design=session.createDesign("String_Node_Str");
  assertEquals(3,CoreTestUtil.getDesigns(session).size());
  ULocale.setDefault(defaultULocale);
}

Fixed version (ground truth):
/** 
 * Tests open design method. Test cases: <ul> <li>Case1:Open design with null ULocale. <li>Case2:Open design with a given ULocale. <li>Case3:Open design with a given design file. <li>Case4:Retrieve the session from the opened designs. <li>Case5:Check the number of designs which are kept in the session's design list. <li>Case6:Drop a design then check the size of the design list. </ul>
 * @throws DesignFileException
 */
public void testOpenDesign() throws DesignFileException {
  ULocale defaultULocale=ULocale.getDefault();
  ULocale.setDefault(ULocale.CHINESE);
  DesignSession session=new DesignSession(null);
  assertEquals(ULocale.CHINESE,CoreTestUtil.getSessionLocale(session));
  session=new DesignSession(ULocale.ENGLISH);
  assertEquals(ULocale.ENGLISH,CoreTestUtil.getSessionLocale(session));
  ReportDesign design=session.createDesign();
  assertNotNull(design);
  assertEquals(session,CoreTestUtil.getDesignSession(design));
  design=session.openDesign(getResource("String_Node_Str").toString());
  assertEquals(session,CoreTestUtil.getDesignSession(design));
  design=session.openDesign(getResource("String_Node_Str").toString());
  assertEquals(3,CoreTestUtil.getDesigns(session).size());
  session.drop(design);
  assertEquals(2,CoreTestUtil.getDesigns(session).size());
  design=session.createDesign("String_Node_Str");
  assertEquals(3,CoreTestUtil.getDesigns(session).size());
  ULocale.setDefault(defaultULocale);
}
Program: 75396
Project: 75396
Buggy source:
public ICategoryProvider getCategoryProvider(Object input){
  CategoryProvider provider=new CategoryProvider(new String[]{CATEGORY_KEY_GENERAL,CATEGORY_KEY_PADDING,CATEGORY_KEY_FONT,CATEGORY_KEY_BORDERS,CATEGORY_KEY_USERPROPERTIES,CATEGORY_KEY_NAMEDEXPRESSIONS,CATEGORY_KEY_ADVANCEPROPERTY},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},new Class[]{CellPage.class,CellPaddingPage.class,FontPage.class,BordersPage.class,UserPropertiesPage.class,NamedExpressionsPage.class,AdvancePropertyPage.class});
  return provider;
}

Fixed version (ground truth):
public ICategoryProvider getCategoryProvider(Object input){
  CategoryProvider provider=new CategoryProvider(new String[]{CATEGORY_KEY_GENERAL,CATEGORY_KEY_PADDING,CATEGORY_KEY_FONT,CATEGORY_KEY_BORDERS,CATEGORY_KEY_USERPROPERTIES,CATEGORY_KEY_NAMEDEXPRESSIONS,CATEGORY_KEY_ADVANCEPROPERTY},new String[]{"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"},new Class[]{CrosstabCellPage.class,CellPaddingPage.class,FontPage.class,BordersPage.class,UserPropertiesPage.class,NamedExpressionsPage.class,AdvancePropertyPage.class});
  return provider;
}
Program: 75397
Project: 75397
Buggy source:
/** 
 * @param name
 */
ColumnMeta(String name,boolean isLevelKey,IDataProcessor processor){
  this.name=name;
  this.isLevelKey=isLevelKey;
  this.dataProcessor=(processor == null) ? (IDataProcessor)new DummyDataProcessor() : processor;
}

Fixed version (ground truth):
/** 
 * @param name
 */
ColumnMeta(String name,IDataProcessor processor,int type){
  this.name=name;
  this.type=type;
  this.dataProcessor=(processor == null) ? (IDataProcessor)new DummyDataProcessor() : processor;
}
Program: 75398
Project: 75398
Buggy source:
/** 
 * @param cubeHandle
 * @param query
 * @param resultMetaList
 * @throws DataException 
 * @throws AdapterException 
 */
private void prepareMeasure(TabularCubeHandle cubeHandle,QueryDefinition query,List metaList) throws AdapterException {
  try {
    List measureGroups=cubeHandle.getContents(CubeHandle.MEASURE_GROUPS_PROP);
    for (int i=0; i < measureGroups.size(); i++) {
      MeasureGroupHandle mgh=(MeasureGroupHandle)measureGroups.get(i);
      List measures=mgh.getContents(MeasureGroupHandle.MEASURES_PROP);
      for (int j=0; j < measures.size(); j++) {
        MeasureHandle measure=(MeasureHandle)measures.get(j);
        String function=measure.getFunction();
        if (query.getGroups().size() > 0) {
          Binding binding=new Binding(measure.getName(),new ScriptExpression(measure.getMeasureExpression()));
          binding.setAggrFunction(DataAdapterUtil.adaptModelAggregationType(function));
          IGroupDefinition group=(IGroupDefinition)query.getGroups().get(query.getGroups().size() - 1);
          binding.addAggregateOn(group.getName());
          query.addBinding(binding);
        }
 else {
          query.addBinding(new Binding(measure.getName(),new ScriptExpression(measure.getMeasureExpression())));
        }
        ColumnMeta meta=new ColumnMeta(measure.getName(),false,null);
        meta.setDataType(DataAdapterUtil.adaptModelDataType(measure.getDataType()));
        metaList.add(meta);
      }
    }
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * @param cubeHandle
 * @param query
 * @param resultMetaList
 * @throws DataException 
 * @throws AdapterException 
 */
private void prepareMeasure(TabularCubeHandle cubeHandle,QueryDefinition query,List metaList) throws AdapterException {
  try {
    List measureGroups=cubeHandle.getContents(CubeHandle.MEASURE_GROUPS_PROP);
    for (int i=0; i < measureGroups.size(); i++) {
      MeasureGroupHandle mgh=(MeasureGroupHandle)measureGroups.get(i);
      List measures=mgh.getContents(MeasureGroupHandle.MEASURES_PROP);
      for (int j=0; j < measures.size(); j++) {
        MeasureHandle measure=(MeasureHandle)measures.get(j);
        String function=measure.getFunction();
        if (query.getGroups().size() > 0) {
          Binding binding=new Binding(measure.getName(),new ScriptExpression(measure.getMeasureExpression()));
          binding.setAggrFunction(DataAdapterUtil.adaptModelAggregationType(function));
          IGroupDefinition group=(IGroupDefinition)query.getGroups().get(query.getGroups().size() - 1);
          binding.addAggregateOn(group.getName());
          query.addBinding(binding);
        }
 else {
          query.addBinding(new Binding(measure.getName(),new ScriptExpression(measure.getMeasureExpression())));
        }
        ColumnMeta meta=new ColumnMeta(measure.getName(),null,ColumnMeta.MEASURE_TYPE);
        meta.setDataType(DataAdapterUtil.adaptModelDataType(measure.getDataType()));
        metaList.add(meta);
      }
    }
  }
 catch (  DataException e) {
    throw new AdapterException(e.getLocalizedMessage());
  }
}
Program: 75399
Project: 75399
Buggy source:
/** 
 * Constructor.
 * @param columnMetas
 */
ResultMeta(List columnMetas){
  this.columnMetaMap=new HashMap();
  this.indexMap=new HashMap();
  this.nullValueReplacer=new Object[columnMetas.size()];
  for (int i=0; i < columnMetas.size(); i++) {
    ColumnMeta columnMeta=(ColumnMeta)columnMetas.get(i);
    columnMeta.setIndex(i + 1);
    this.columnMetaMap.put(columnMeta.getName(),columnMeta);
    this.indexMap.put(new Integer(i + 1),columnMeta);
    if (columnMeta.isLevelKey()) {
      this.nullValueReplacer[i]=createNullValueReplacer(columnMeta.getType());
    }
  }
}

Fixed version (ground truth):
/** 
 * Constructor.
 * @param columnMetas
 */
ResultMeta(List columnMetas){
  this.columnMetaMap=new HashMap();
  this.indexMap=new HashMap();
  this.nullValueReplacer=new Object[columnMetas.size()];
  for (int i=0; i < columnMetas.size(); i++) {
    ColumnMeta columnMeta=(ColumnMeta)columnMetas.get(i);
    columnMeta.setIndex(i + 1);
    this.columnMetaMap.put(columnMeta.getName(),columnMeta);
    this.indexMap.put(new Integer(i + 1),columnMeta);
    if (columnMeta.isLevelKey() || columnMeta.isMeasure()) {
      this.nullValueReplacer[i]=createNullValueReplacer(columnMeta.getType());
    }
  }
}
Program: 75401
Project: 75401
Buggy source:
/** 
 * @return
 */
public boolean isLevelKey(){
  return this.isLevelKey;
}

Fixed version (ground truth):
/** 
 * @return
 */
public boolean isLevelKey(){
  return this.type == LEVEL_KEY_TYPE;
}
Program: 75402
Project: 75402
Buggy source:
/** 
 * @param type
 */
public void setDataType(int type){
  this.type=type;
}

Fixed version (ground truth):
/** 
 * @param type
 */
public void setDataType(int type){
  this.dataType=type;
}
Program: 75403
Project: 75403
Buggy source:
/** 
 * @return
 */
public int getType(){
  return this.type;
}

Fixed version (ground truth):
/** 
 * @return
 */
public int getType(){
  return this.dataType;
}
Program: 75404
Project: 75404
Buggy source:
protected Control createDialogArea(Composite parent){
  UIUtil.bindHelp(parent,IHelpContextIds.PREFIX + "String_Node_Str");
  getShell().setText(Messages.getString("String_Node_Str"));
  if (isNew)   this.setTitle(Messages.getString("String_Node_Str"));
 else   this.setTitle(Messages.getString("String_Node_Str"));
  this.setMessage(Messages.getString("String_Node_Str"));
  Composite area=(Composite)super.createDialogArea(parent);
  Composite contents=new Composite(area,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginWidth=20;
  contents.setLayout(layout);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.widthHint=convertWidthInCharsToPixels(80);
  data.heightHint=400;
  contents.setLayoutData(data);
  createChoiceArea(contents);
  dynamicArea=createDynamicArea(contents);
  staticArea=createStaticArea(contents);
  WidgetUtil.createGridPlaceholder(contents,1,true);
  initLevelDialog();
  parent.layout();
  return contents;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  UIUtil.bindHelp(parent,IHelpContextIds.LEVEL_PROPERTY_DIALOG);
  getShell().setText(Messages.getString("String_Node_Str"));
  if (isNew)   this.setTitle(Messages.getString("String_Node_Str"));
 else   this.setTitle(Messages.getString("String_Node_Str"));
  this.setMessage(Messages.getString("String_Node_Str"));
  Composite area=(Composite)super.createDialogArea(parent);
  Composite contents=new Composite(area,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.marginWidth=20;
  contents.setLayout(layout);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.widthHint=convertWidthInCharsToPixels(80);
  data.heightHint=400;
  contents.setLayoutData(data);
  createChoiceArea(contents);
  dynamicArea=createDynamicArea(contents);
  staticArea=createStaticArea(contents);
  WidgetUtil.createGridPlaceholder(contents,1,true);
  initLevelDialog();
  parent.layout();
  return contents;
}
Program: 75405
Project: 75405
Buggy source:
protected Control createDialogArea(Composite parent){
  createTitleArea(parent);
  Composite contents=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.verticalSpacing=0;
  layout.marginWidth=20;
  contents.setLayout(layout);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.widthHint=convertWidthInCharsToPixels(70);
  contents.setLayoutData(data);
  createMeasureArea(contents);
  WidgetUtil.createGridPlaceholder(contents,1,true);
  initMeasureDialog();
  return contents;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  createTitleArea(parent);
  UIUtil.bindHelp(parent,IHelpContextIds.MEASURE_DIALOG);
  Composite contents=new Composite(parent,SWT.NONE);
  GridLayout layout=new GridLayout();
  layout.verticalSpacing=0;
  layout.marginWidth=20;
  contents.setLayout(layout);
  GridData data=new GridData(GridData.FILL_BOTH);
  data.widthHint=convertWidthInCharsToPixels(70);
  contents.setLayoutData(data);
  createMeasureArea(contents);
  WidgetUtil.createGridPlaceholder(contents,1,true);
  initMeasureDialog();
  return contents;
}
Program: 75406
Project: 75406
Buggy source:
protected Control createContents(Composite parent){
  String title=Messages.getString("String_Node_Str");
  getShell().setText(title);
  if (showNodeId != null) {
    setDefaultNode(showNodeId);
  }
  Control control=super.createContents(parent);
  Utility.setSystemHelp(control,IHelpConstants.PREFIX + "String_Node_Str");
  return control;
}

Fixed version (ground truth):
protected Control createContents(Composite parent){
  String title=Messages.getString("String_Node_Str");
  getShell().setText(title);
  if (showNodeId != null) {
    setDefaultNode(showNodeId);
  }
  Control control=super.createContents(parent);
  UIUtil.bindHelp(control,IHelpContextIds.CUBE_BUILDER_DIALOG);
  return control;
}
Program: 75411
Project: 75411
Buggy source:
public IndexKey findFirst(Level level,Object[] keyValue) throws IOException, DataException {
  return level.getDiskIndex().findFirst(keyValue);
}

Fixed version (ground truth):
public IndexKey findFirst(Level level,Object[] keyValue) throws IOException, DataException {
  DiskIndex index=level.getDiskIndex();
  if (index == null)   return null;
  return index.findFirst(keyValue);
}
Program: 75412
Project: 75412
Buggy source:
/** 
 * @throws IOException
 * @throws DataException
 */
public void loadFromDisk() throws IOException, DataException {
  openReadDocuemntObject();
  int size=documentObj.readInt();
  levels=new Level[documentObj.readInt()];
  for (int i=0; i < levels.length; i++) {
    String levelName=documentObj.readString();
    String[] keyColName=new String[documentObj.readInt()];
    int[] keyDataType=new int[keyColName.length];
    for (int j=0; j < keyColName.length; j++) {
      keyColName[j]=documentObj.readString();
      keyDataType[j]=documentObj.readInt();
    }
    int attributeNumber=documentObj.readInt();
    String[] attributeColNames=null;
    int[] attributeDataTypes=null;
    if (attributeNumber > 0) {
      attributeColNames=new String[attributeNumber];
      attributeDataTypes=new int[attributeNumber];
      for (int j=0; j < attributeNumber; j++) {
        attributeColNames[j]=documentObj.readString();
        attributeDataTypes[j]=documentObj.readInt();
      }
    }
    levels[i]=new Level(documentManager,new LevelDefinition(levelName,keyColName,attributeColNames),keyDataType,attributeDataTypes,size,DiskIndex.loadIndex(documentManager,NamingUtil.getLevelIndexDocName(dimensionName,levelName)));
  }
}

Fixed version (ground truth):
/** 
 * @throws IOException
 * @throws DataException
 */
public void loadFromDisk() throws IOException, DataException {
  openReadDocuemntObject();
  int size=documentObj.readInt();
  levels=new Level[documentObj.readInt()];
  for (int i=0; i < levels.length; i++) {
    String levelName=documentObj.readString();
    String[] keyColName=new String[documentObj.readInt()];
    int[] keyDataType=new int[keyColName.length];
    for (int j=0; j < keyColName.length; j++) {
      keyColName[j]=documentObj.readString();
      keyDataType[j]=documentObj.readInt();
    }
    int attributeNumber=documentObj.readInt();
    String[] attributeColNames=null;
    int[] attributeDataTypes=null;
    if (attributeNumber > 0) {
      attributeColNames=new String[attributeNumber];
      attributeDataTypes=new int[attributeNumber];
      for (int j=0; j < attributeNumber; j++) {
        attributeColNames[j]=documentObj.readString();
        attributeDataTypes[j]=documentObj.readInt();
      }
    }
    levels[i]=new Level(documentManager,new LevelDefinition(levelName,keyColName,attributeColNames),keyDataType,attributeDataTypes,size,size == 0 ? null : DiskIndex.loadIndex(documentManager,NamingUtil.getLevelIndexDocName(dimensionName,levelName)));
  }
}
Program: 75413
Project: 75413
Buggy source:
/** 
 * @return
 * @throws IOException
 */
public IDiskArray readAllRows() throws IOException {
  BufferedStructureArray resultArray=new BufferedStructureArray(DimensionRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  documentObj.seek(0);
  int size=documentObj.readInt();
  offsetDocObj.seek(0);
  documentObj.seek(offsetDocObj.readInt());
  for (int i=0; i < size; i++) {
    resultArray.add(readDimensionRow());
  }
  return resultArray;
}

Fixed version (ground truth):
/** 
 * @return
 * @throws IOException
 */
public IDiskArray readAllRows() throws IOException {
  BufferedStructureArray resultArray=new BufferedStructureArray(DimensionRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  documentObj.seek(0);
  int size=documentObj.readInt();
  if (size == 0)   return resultArray;
  offsetDocObj.seek(0);
  documentObj.seek(offsetDocObj.readInt());
  for (int i=0; i < size; i++) {
    resultArray.add(readDimensionRow());
  }
  return resultArray;
}
Program: 75414
Project: 75414
Buggy source:
CachedAggregationResultSet(DataInputStream inputStream,int length,DimLevel[] levels,int[] sortTypes,String[][] keyNames,String[][] attributeNames,int[][] keyDataTypes,int[][] attributeDataTypes,String[] aggregationNames,int[] aggregationDataType) throws IOException {
  Object[] params={inputStream,new Integer(length),levels,sortTypes,keyNames,attributeNames,keyDataTypes,attributeDataTypes,aggregationNames,aggregationDataType};
  logger.entering(CachedAggregationResultSet.class.getName(),"String_Node_Str",params);
  this.inputStream=inputStream;
  this.currentPosition=0;
  this.length=length;
  this.levels=levels;
  this.sortType=sortTypes;
  this.keyNames=keyNames;
  this.attributeNames=attributeNames;
  this.keyDataTypes=keyDataTypes;
  this.attributeDataTypes=attributeDataTypes;
  this.aggregationDataType=aggregationDataType;
  this.aggregationResultNameMap=new HashMap();
  if (aggregationNames != null) {
    for (int i=0; i < aggregationNames.length; i++) {
      aggregationResultNameMap.put(aggregationNames[i],new Integer(i));
    }
  }
  aggregationResultRow=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  seek(0);
  logger.exiting(CachedAggregationResultSet.class.getName(),"String_Node_Str");
}

Fixed version (ground truth):
CachedAggregationResultSet(DataInputStream inputStream,int length,DimLevel[] levels,int[] sortTypes,String[][] keyNames,String[][] attributeNames,int[][] keyDataTypes,int[][] attributeDataTypes,String[] aggregationNames,int[] aggregationDataType) throws IOException {
  Object[] params={inputStream,new Integer(length),levels,sortTypes,keyNames,attributeNames,keyDataTypes,attributeDataTypes,aggregationNames,aggregationDataType};
  logger.entering(CachedAggregationResultSet.class.getName(),"String_Node_Str",params);
  this.inputStream=inputStream;
  this.currentPosition=0;
  this.length=length;
  this.levels=levels;
  this.sortType=sortTypes;
  this.keyNames=keyNames;
  this.attributeNames=attributeNames;
  this.keyDataTypes=keyDataTypes;
  this.attributeDataTypes=attributeDataTypes;
  this.aggregationDataType=aggregationDataType;
  this.aggregationResultNameMap=new HashMap();
  if (aggregationNames != null) {
    for (int i=0; i < aggregationNames.length; i++) {
      aggregationResultNameMap.put(aggregationNames[i],new Integer(i));
    }
  }
  aggregationResultRow=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  if (this.length > 0)   seek(0);
  logger.exiting(CachedAggregationResultSet.class.getName(),"String_Node_Str");
}
Program: 75415
Project: 75415
Buggy source:
/** 
 * @param level
 * @param filter
 * @return
 * @throws IOException
 * @throws DataException
 */
private static BaseDiskSortedStack find(Level level,ISelection[] filter) throws IOException, DataException {
  IDiskArray indexKeyArray=level.getDiskIndex().find(filter);
  PrimitiveDiskSortedStack resultStack=new PrimitiveDiskSortedStack(Constants.LIST_BUFFER_SIZE,true,true);
  for (int i=0; i < indexKeyArray.size(); i++) {
    IndexKey key=(IndexKey)indexKeyArray.get(i);
    resultStack.push(new Integer(key.getDimensionPos()));
  }
  return resultStack;
}

Fixed version (ground truth):
/** 
 * @param level
 * @param filter
 * @return
 * @throws IOException
 * @throws DataException
 */
private static BaseDiskSortedStack find(Level level,ISelection[] filter) throws IOException, DataException {
  IDiskArray indexKeyArray=level.getDiskIndex().find(filter);
  PrimitiveDiskSortedStack resultStack=new PrimitiveDiskSortedStack(Constants.LIST_BUFFER_SIZE,true,true);
  if (indexKeyArray != null) {
    for (int i=0; i < indexKeyArray.size(); i++) {
      IndexKey key=(IndexKey)indexKeyArray.get(i);
      resultStack.push(new Integer(key.getDimensionPos()));
    }
  }
  return resultStack;
}
Program: 75416
Project: 75416
Buggy source:
/** 
 * Initialize the resultClass. This method is lightweight.
 * @param dataEngine
 * @param dataSetDesign
 * @param appContext
 * @throws DataException
 */
private void initializeResultClass(DataEngineImpl dataEngine,Map appContext) throws DataException {
  try {
    IResultMetaData leftMetaData=this.leftQueryResults.getResultMetaData();
    IResultMetaData rightMetaData=this.rightQueryResults.getResultMetaData();
    JointResultMetadata meta=getJointResultMetadata(leftMetaData,rightMetaData);
    resultClass=meta.getResultClass();
  }
 catch (  BirtException be) {
    throw DataException.wrap(be);
  }
}

Fixed version (ground truth):
/** 
 * Initialize the resultClass. This method is lightweight.
 * @param dataEngine
 * @param dataSetDesign
 * @param appContext
 * @throws DataException
 */
private void initializeResultClass(DataEngineImpl dataEngine,Map appContext) throws DataException {
  try {
    IResultMetaData leftMetaData=this.leftResultMetaData;
    IResultMetaData rightMetaData=this.rightResultMetaData;
    JointResultMetadata meta=getJointResultMetadata(leftMetaData,rightMetaData);
    resultClass=meta.getResultClass();
  }
 catch (  BirtException be) {
    throw DataException.wrap(be);
  }
}
Program: 75417
Project: 75417
Buggy source:
protected IQuery createOdiQuery() throws DataException {
  setCurrentDataSet(dataSetDesign);
  populatePreparedQuery();
  initializeResultClass(dataEngine,appContext);
  return new JointDataSetQuery(resultClass);
}

Fixed version (ground truth):
protected IQuery createOdiQuery() throws DataException {
  setCurrentDataSet(dataSetDesign);
  try {
    populatePreparedQuery();
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
  initializeResultClass(dataEngine,appContext);
  return new JointDataSetQuery(resultClass);
}
Program: 75418
Project: 75418
Buggy source:
private void populateSeriesTypesList(){
  cbSeriesType.removeAll();
  Series series=getSeriesDefinitionForProcessing().getDesignTimeSeries();
  if (series.canParticipateInCombination()) {
    populateSeriesTypes(ChartUIExtensionsImpl.instance().getUIChartTypeExtensions(),series,this.orientation);
  }
 else {
    String seriesName=series.getDisplayName();
    ;
    cbSeriesType.add(seriesName);
    cbSeriesType.select(0);
  }
  if (this.chartModel != null && chartModel instanceof ChartWithAxes) {
    Axis xAxis=((Axis)((ChartWithAxes)chartModel).getAxes().get(0));
    if (xAxis.getAssociatedAxes().size() > 1) {
      Axis overlayAxis=(Axis)xAxis.getAssociatedAxes().get(1);
      String sDisplayName=((SeriesDefinition)overlayAxis.getSeriesDefinitions().get(0)).getDesignTimeSeries().getDisplayName();
      cbSeriesType.setText(sDisplayName);
    }
  }
}

Fixed version (ground truth):
private void populateSeriesTypesList(){
  cbSeriesType.removeAll();
  Series series=getSeriesDefinitionForProcessing().getDesignTimeSeries();
  if (series.canParticipateInCombination()) {
    populateSeriesTypes(ChartUIExtensionsImpl.instance().getUIChartTypeExtensions(),series,this.orientation);
  }
 else {
    String seriesName=series.getDisplayName();
    ;
    cbSeriesType.add(seriesName);
    cbSeriesType.select(0);
  }
  if (this.chartModel != null && chartModel instanceof ChartWithAxes) {
    Axis xAxis=((Axis)((ChartWithAxes)chartModel).getAxes().get(0));
    if (xAxis.getAssociatedAxes().size() > 1) {
      Axis overlayAxis=(Axis)xAxis.getAssociatedAxes().get(1);
      if (!overlayAxis.getSeriesDefinitions().isEmpty()) {
        String sDisplayName=((SeriesDefinition)overlayAxis.getSeriesDefinitions().get(0)).getDesignTimeSeries().getDisplayName();
        cbSeriesType.setText(sDisplayName);
      }
    }
  }
}
Program: 75421
Project: 75421
Buggy source:
public void close() throws BirtException {
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    while (this.next())     ;
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
public void close() throws BirtException {
  if (state == NOT_STARTED || state == CLOSED)   return;
  if (this.getRdSaveHelper().needsSaveToDoc()) {
    while (this.next())     ;
    this.getRdSaveHelper().doSaveFinish();
  }
  if (needCache()) {
    while (this.next()) {
    }
    closeCacheOutputStream();
  }
  if (odiResult != null)   odiResult.close();
  odiResult=null;
  resultService=null;
  state=CLOSED;
  logger.logp(Level.FINE,ResultIterator.class.getName(),"String_Node_Str","String_Node_Str");
}
Program: 75422
Project: 75422
Buggy source:
/** 
 * @return
 * @throws DataException
 */
private void populateComputedColumns(List aggCCList) throws DataException {
  if (!psController.needDoOperation(PassStatusController.DATA_SET_COMPUTED_COLUMN_POPULATING))   return;
  if (!psController.needDoOperation(PassStatusController.DATA_SET_FILTERING)) {
    if (iccState != null) {
      for (int i=0; i < iccState.getCount(); i++) {
        if (iccState.isValueAvailable(i)) {
          for (int k=0; k < this.populator.getQuery().getFetchEvents().size(); k++) {
            if (this.populator.getQuery().getFetchEvents().get(k) instanceof ComputedColumnHelper) {
              ComputedColumnHelper helper=(ComputedColumnHelper)this.populator.getQuery().getFetchEvents().get(k);
              helper.getComputedColumnList().remove(iccState.getComputedColumn(i));
              break;
            }
          }
        }
      }
    }
    PassUtil.pass(this.populator,new OdiResultSetWrapper(populator.getResultIterator()),false,this.session);
  }
  computedColumnHelper.getComputedColumnList().clear();
  computedColumnHelper.getComputedColumnList().addAll(aggCCList);
  computedColumnHelper.setModel(TransformationConstants.DATA_SET_MODEL);
  iccState.setModel(TransformationConstants.DATA_SET_MODEL);
  if (iccState.getCount() > 0) {
    ComputedColumnCalculator.populateComputedColumns(this.populator,new OdiResultSetWrapper(this.populator.getResultIterator()),iccState,computedColumnHelper,this.session);
  }
  computedColumnHelper.setModel(TransformationConstants.NONE_MODEL);
}

Fixed version (ground truth):
/** 
 * @return
 * @throws DataException
 */
private void populateComputedColumns(List aggCCList) throws DataException {
  if (!psController.needDoOperation(PassStatusController.DATA_SET_COMPUTED_COLUMN_POPULATING))   return;
  if (!psController.needDoOperation(PassStatusController.DATA_SET_FILTERING)) {
    PassUtil.pass(this.populator,new OdiResultSetWrapper(populator.getResultIterator()),false,this.session);
  }
  computedColumnHelper.getComputedColumnList().clear();
  computedColumnHelper.getComputedColumnList().addAll(aggCCList);
  computedColumnHelper.setModel(TransformationConstants.DATA_SET_MODEL);
  iccState.setModel(TransformationConstants.DATA_SET_MODEL);
  if (iccState.getCount() > 0) {
    ComputedColumnCalculator.populateComputedColumns(this.populator,new OdiResultSetWrapper(this.populator.getResultIterator()),iccState,computedColumnHelper,this.session);
  }
  computedColumnHelper.setModel(TransformationConstants.NONE_MODEL);
}
Program: 75423
Project: 75423
Buggy source:
/** 
 * @throws DataException
 */
private void populateDataSet() throws DataException {
  int originalMaxRows=this.populator.getQuery().getMaxRows();
  boolean changeMaxRows=filterByRow == null ? false : filterByRow.getFilterList(FilterByRow.QUERY_FILTER).size() + filterByRow.getFilterList(FilterByRow.GROUP_FILTER).size() > 0;
  if (changeMaxRows)   this.populator.getQuery().setMaxRows(0);
  List aggCCList=prepareComputedColumns(TransformationConstants.DATA_SET_MODEL);
  doDataSetFilter(changeMaxRows);
  populateAggrCCs(this.getAggrComputedColumns(aggCCList,true));
  populateComputedColumns(this.getAggrComputedColumns(aggCCList,false));
  this.populator.getQuery().setMaxRows(originalMaxRows);
}

Fixed version (ground truth):
/** 
 * @throws DataException
 */
private void populateDataSet() throws DataException {
  int originalMaxRows=this.populator.getQuery().getMaxRows();
  boolean changeMaxRows=filterByRow == null ? false : filterByRow.getFilterList(FilterByRow.QUERY_FILTER).size() + filterByRow.getFilterList(FilterByRow.GROUP_FILTER).size() > 0;
  if (changeMaxRows)   this.populator.getQuery().setMaxRows(0);
  List aggCCList=prepareComputedColumns(TransformationConstants.DATA_SET_MODEL);
  populateAggrCCs(this.getAggrComputedColumns(aggCCList,true));
  removeAvailableComputedColumns();
  doDataSetFilter(changeMaxRows);
  populateComputedColumns(this.getAggrComputedColumns(aggCCList,false));
  this.populator.getQuery().setMaxRows(originalMaxRows);
}
Program: 75424
Project: 75424
Buggy source:
/** 
 * @param nameList
 * @param dataSetCCList
 * @return
 * @throws DataException
 */
private boolean hasAggregation(List nameList,List dataSetCCList) throws DataException {
  try {
    for (int k=0; k < nameList.size(); k++) {
      IComputedColumn column=null;
      for (int i=0; i < dataSetCCList.size(); i++) {
        column=(IComputedColumn)dataSetCCList.get(i);
        if (column.getName() != null && column.getName().equals(nameList.get(k)))         break;
 else         column=null;
      }
      if (column != null) {
        if (ExpressionCompilerUtil.hasAggregationInExpr(column.getExpression())) {
          return true;
        }
 else {
          List referedList=ExpressionUtil.extractColumnExpressions(((IScriptExpression)column.getExpression()).getText());
          List newList=new ArrayList();
          for (int j=0; j < referedList.size(); j++) {
            IColumnBinding binding=(IColumnBinding)referedList.get(j);
            String name=binding.getResultSetColumnName();
            newList.add(name);
          }
          return hasAggregation(newList,dataSetCCList);
        }
      }
 else {
        continue;
      }
    }
    return false;
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * @param nameList
 * @param dataSetCCList
 * @return
 * @throws DataException
 */
private boolean hasAggregation(List nameList,List dataSetCCList) throws DataException {
  try {
    for (int k=0; k < nameList.size(); k++) {
      IComputedColumn column=null;
      for (int i=0; i < dataSetCCList.size(); i++) {
        column=(IComputedColumn)dataSetCCList.get(i);
        if (column.getName() != null && column.getName().equals(nameList.get(k)))         break;
 else         column=null;
      }
      if (column != null) {
        if (ExpressionCompilerUtil.hasAggregationInExpr(column.getExpression()) || column.getAggregateFunction() != null) {
          return true;
        }
 else {
          List referedList=ExpressionUtil.extractColumnExpressions(((IScriptExpression)column.getExpression()).getText());
          List newList=new ArrayList();
          for (int j=0; j < referedList.size(); j++) {
            IColumnBinding binding=(IColumnBinding)referedList.get(j);
            String name=binding.getResultSetColumnName();
            newList.add(name);
          }
          return hasAggregation(newList,dataSetCCList);
        }
      }
 else {
        continue;
      }
    }
    return false;
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 75425
Project: 75425
Buggy source:
/** 
 * @param dataSetCCList
 * @return
 * @throws DataException 
 */
private void getAvailableComputedList(List refernceNameList,List dataSetCCList,List result) throws DataException {
  try {
    for (int i=0; i < dataSetCCList.size(); i++) {
      IComputedColumn column=(IComputedColumn)dataSetCCList.get(i);
      if (!refernceNameList.contains(column.getName())) {
        continue;
      }
      if (ExpressionCompilerUtil.hasAggregationInExpr(column.getExpression())) {
        continue;
      }
 else {
        List referedList=ExpressionUtil.extractColumnExpressions(((IScriptExpression)column.getExpression()).getText());
        if (referedList.size() == 0) {
          result.add(column);
        }
 else {
          List newList=new ArrayList();
          for (int j=0; j < referedList.size(); j++) {
            IColumnBinding binding=(IColumnBinding)referedList.get(j);
            String name=binding.getResultSetColumnName();
            newList.add(name);
          }
          if (!hasAggregation(newList,dataSetCCList)) {
            result.add(column);
          }
        }
      }
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}

Fixed version (ground truth):
/** 
 * @param dataSetCCList
 * @return
 * @throws DataException 
 */
private void getAvailableComputedList(List refernceNameList,List dataSetCCList,List result) throws DataException {
  try {
    for (int i=0; i < dataSetCCList.size(); i++) {
      IComputedColumn column=(IComputedColumn)dataSetCCList.get(i);
      if (!refernceNameList.contains(column.getName())) {
        continue;
      }
      if (ExpressionCompilerUtil.hasAggregationInExpr(column.getExpression()) || column.getAggregateFunction() != null) {
        continue;
      }
 else {
        List referedList=ExpressionUtil.extractColumnExpressions(((IScriptExpression)column.getExpression()).getText());
        if (referedList.size() == 0) {
          result.add(column);
        }
 else {
          List newList=new ArrayList();
          for (int j=0; j < referedList.size(); j++) {
            IColumnBinding binding=(IColumnBinding)referedList.get(j);
            String name=binding.getResultSetColumnName();
            newList.add(name);
          }
          if (!hasAggregation(newList,dataSetCCList)) {
            result.add(column);
          }
        }
      }
    }
  }
 catch (  BirtException e) {
    throw DataException.wrap(e);
  }
}
Program: 75426
Project: 75426
Buggy source:
public Iterator getMemberValueIterator(TabularCubeHandle cubeHandle,String targetLevel,ILevelDefinition[] higherLevelDefns,Object[] values) throws AdapterException {
  try {
    if ((higherLevelDefns == null && values != null) || (higherLevelDefns != null && values == null) || cubeHandle == null || targetLevel == null)     return null;
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(targetLevel);
    TabularHierarchyHandle hierHandle=(TabularHierarchyHandle)(cubeHandle.getDimension(target.getDimensionName()).getContent(TabularDimensionHandle.HIERARCHIES_PROP,0));
    defineDataSourceAndDataSet(hierHandle.getDataSet());
    Map levelValueMap=new HashMap();
    if (higherLevelDefns != null) {
      for (int i=0; i < higherLevelDefns.length; i++) {
        if (target.getDimensionName().equals(higherLevelDefns[i].getHierarchy().getDimension().getName())) {
          levelValueMap.put(higherLevelDefns[i].getName(),values[i]);
        }
      }
    }
    DataSetIterator it=new DataSetIterator(this.session,hierHandle);
    return new MemberValueIterator(it,levelValueMap,target.getLevelName());
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}

Fixed version (ground truth):
public Iterator getMemberValueIterator(TabularCubeHandle cubeHandle,String targetLevel,ILevelDefinition[] higherLevelDefns,Object[] values) throws AdapterException {
  try {
    if ((higherLevelDefns == null && values != null) || (higherLevelDefns != null && values == null) || cubeHandle == null || targetLevel == null)     return null;
    DimLevel target=OlapExpressionUtil.getTargetDimLevel(targetLevel);
    TabularHierarchyHandle hierHandle=(TabularHierarchyHandle)(cubeHandle.getDimension(target.getDimensionName()).getContent(TabularDimensionHandle.HIERARCHIES_PROP,0));
    defineDataSourceAndDataSet(hierHandle.getDataSet());
    Map levelValueMap=new HashMap();
    if (higherLevelDefns != null) {
      for (int i=0; i < higherLevelDefns.length; i++) {
        if (target.getDimensionName().equals(higherLevelDefns[i].getHierarchy().getDimension().getName())) {
          levelValueMap.put(higherLevelDefns[i].getName(),values[i]);
        }
      }
    }
    DataSetIterator it=null;
    if (hierHandle.getDataSet() != cubeHandle.getDataSet())     it=new DataSetIterator(this.session,hierHandle);
 else     it=new DataSetIterator(this.session,cubeHandle);
    return new MemberValueIterator(it,levelValueMap,target.getLevelName());
  }
 catch (  BirtException e) {
    throw new AdapterException(e.getLocalizedMessage(),e);
  }
}
Program: 75427
Project: 75427
Buggy source:
/** 
 * Constructor of the AbstractContent
 * @param content content can't be null
 */
public AbstractContent(IContent content){
  assert(content != null && content instanceof ReportContent);
  this.report=content.getReportContent();
  this.parent=content.getReportContent().getRoot();
  this.cssEngine=((ReportContent)content.getReportContent()).getCSSEngine();
  this.name=content.getName();
  this.x=content.getX();
  this.y=content.getY();
  this.width=content.getWidth();
  this.height=content.getHeight();
  this.hyperlink=content.getHyperlinkAction();
  this.bookmark=content.getBookmark();
  this.helpText=content.getHelpText();
  this.inlineStyle=content.getInlineStyle();
  this.generateBy=content.getGenerateBy();
  this.styleClass=content.getStyleClass();
  this.instanceId=content.getInstanceID();
  this.toc=content.getTOC();
  Object ext=content.getExtension(IContent.DOCUMENT_EXTENSION);
  if (ext != null) {
    setExtension(IContent.DOCUMENT_EXTENSION,ext);
  }
}

Fixed version (ground truth):
/** 
 * Constructor of the AbstractContent
 * @param content content can't be null
 */
public AbstractContent(IContent content){
  this.report=content.getReportContent();
  this.parent=content.getReportContent().getRoot();
  this.cssEngine=((ReportContent)content.getReportContent()).getCSSEngine();
  this.name=content.getName();
  this.x=content.getX();
  this.y=content.getY();
  this.width=content.getWidth();
  this.height=content.getHeight();
  this.hyperlink=content.getHyperlinkAction();
  this.bookmark=content.getBookmark();
  this.helpText=content.getHelpText();
  this.inlineStyle=content.getInlineStyle();
  this.generateBy=content.getGenerateBy();
  this.styleClass=content.getStyleClass();
  this.instanceId=content.getInstanceID();
  this.toc=content.getTOC();
  Object ext=content.getExtension(IContent.DOCUMENT_EXTENSION);
  if (ext != null) {
    setExtension(IContent.DOCUMENT_EXTENSION,ext);
  }
}
Program: 75429
Project: 75429
Buggy source:
/** 
 * @param expression
 * @return
 * @throws DataException
 */
public boolean hasAggregation(IBaseExpression expression) throws DataException {
  boolean hasAggregate=false;
  MultiPassExpressionCompiler helper=new MultiPassExpressionCompiler(rsPopulator,baseQuery,null,null);
  helper.setDataSetMode(isDataSetMode);
  IBaseExpression baseExpression=expression;
  compileBaseExpression(baseExpression,helper);
  hasAggregate=helper.getAggregateStatus();
  clear();
  return hasAggregate;
}

Fixed version (ground truth):
/** 
 * @param expression
 * @return
 * @throws DataException
 */
public boolean hasAggregation(IBaseExpression expression){
  boolean hasAggregate=false;
  try {
    MultiPassExpressionCompiler helper=new MultiPassExpressionCompiler(rsPopulator,baseQuery,null,null);
    helper.setDataSetMode(isDataSetMode);
    IBaseExpression baseExpression=expression;
    compileBaseExpression(baseExpression,helper);
    hasAggregate=helper.getAggregateStatus();
    clear();
  }
 catch (  DataException ex) {
    clear();
    return false;
  }
  return hasAggregate;
}