nus-yam/ex-repair huggingface dataset:
Program: 68406
Project: 68406
Buggy source:
public synchronized ArchiveEntry createEntry(String name) throws IOException {
  assertWritable();
  ArchiveEntryV2 entry=entries.get(name);
  if (entry != null) {
    entry.setLength(0L);
    return entry;
  }
  NameEntry nameEnt=entryTbl.createEntry(name);
  entry=new ArchiveEntryV2(this,nameEnt);
  entries.put(name,entry);
  return entry;
}

Fixed version (ground truth):
public synchronized ArchiveEntry createEntry(String name) throws IOException {
  assertWritable();
  NameEntry nameEnt=entries.get(name);
  if (nameEnt != null) {
    ArchiveEntryV2 entry=new ArchiveEntryV2(this,nameEnt);
    entry.setLength(0L);
    return entry;
  }
  nameEnt=entryTbl.createEntry(name);
  entries.put(name,nameEnt);
  return new ArchiveEntryV2(this,nameEnt);
}
Program: 68407
Project: 68407
Buggy source:
synchronized public void unlockEntry(Object locker) throws IOException {
  assertOpen();
  if (locker instanceof FileLock) {
    FileLock flck=(FileLock)locker;
    flck.release();
  }
  if (!(locker instanceof ArchiveEntry)) {
    throw new IOException("String_Node_Str" + locker);
  }
}

Fixed version (ground truth):
synchronized public void unlockEntry(Object locker) throws IOException {
  assertOpen();
  if (!(locker instanceof NameEntry)) {
    throw new IOException("String_Node_Str" + locker);
  }
}
Program: 68408
Project: 68408
Buggy source:
protected final void clearResultSetTable(){
  if (recordList == null)   recordList=new ArrayList();
 else   recordList.clear();
  TableColumn[] columns=resultSetTable.getColumns();
  for (int n=0; n < columns.length; n++) {
    columns[n].dispose();
  }
  resultSetTable.removeAll();
}

Fixed version (ground truth):
protected final void clearResultSetTable(){
  if (recordList == null)   recordList=new ArrayList();
 else   recordList.clear();
  resultSetTable.removeAll();
  TableColumn[] columns=resultSetTable.getColumns();
  for (int n=0; n < columns.length; n++) {
    columns[n].dispose();
  }
}
Program: 68409
Project: 68409
Buggy source:
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!meta.isComputedColumn(i)) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i - 1);
      rsColumn.setColumnName(uniqueName);
      rsColumn.setDataType(DataAdapterUtil.adapterToModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompatibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}

Fixed version (ground truth):
/** 
 * @param meta
 * @throws BirtException 
 */
private void addResultSetColumn(DataSetHandle dataSetHandle,IResultMetaData meta) throws BirtException {
  if (meta == null || !(dataSetHandle instanceof OdaDataSetHandle))   return;
  Set computedColumnNameSet=new HashSet();
  Iterator computedIter=dataSetHandle.computedColumnsIterator();
  while (computedIter.hasNext()) {
    ComputedColumnHandle handle=(ComputedColumnHandle)computedIter.next();
    computedColumnNameSet.add(handle.getName());
  }
  List columnList=new ArrayList();
  HashSet orgColumnNameSet=new HashSet();
  HashSet uniqueColumnNameSet=new HashSet();
  for (int i=1; i <= meta.getColumnCount(); i++) {
    OdaResultSetColumn rsColumn=new OdaResultSetColumn();
    String uniqueName;
    if (!computedColumnNameSet.contains(meta.getColumnName(i))) {
      uniqueName=MetaDataPopulator.getUniqueName(orgColumnNameSet,uniqueColumnNameSet,meta.getColumnName(i),i - 1);
      rsColumn.setColumnName(uniqueName);
      if (meta.getColumnType(i) != DataType.ANY_TYPE)       rsColumn.setDataType(DataAdapterUtil.adapterToModelDataType(meta.getColumnType(i)));
      rsColumn.setNativeName(meta.getColumnName(i));
      rsColumn.setPosition(new Integer(i));
      columnList.add(rsColumn);
      uniqueColumnNameSet.add(uniqueName);
    }
  }
  CompatibilityUtil.addResultSetColumn(dataSetHandle,columnList);
}
Program: 68413
Project: 68413
Buggy source:
protected Composite getTogglesControl(Composite parent){
  if (toggles == null && providers != null) {
    composite=new Composite(parent,SWT.NONE);
    GridLayout layout=new GridLayout();
    layout.horizontalSpacing=7;
    layout.numColumns=providers.length;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData());
    toggles=new TogglePropertyDescriptor[providers.length];
    for (int i=0; i < providers.length; i++) {
      toggle=DescriptorToolkit.createTogglePropertyDescriptor();
      toggles[i]=toggle;
      toggle.setDescriptorProvider(providers[i]);
      toggle.createControl(composite);
      toggle.getControl().setLayoutData(new GridData());
      toggle.getControl().addDisposeListener(new DisposeListener(){
        public void widgetDisposed(        DisposeEvent event){
          toggle=null;
          boolean flag=true;
          for (int i=0; i < providers.length; i++) {
            if (toggles[i] != null) {
              flag=false;
              break;
            }
          }
          if (flag)           toggles=null;
        }
      }
);
    }
  }
 else {
    checkParent(composite,parent);
  }
  return composite;
}

Fixed version (ground truth):
protected Composite getTogglesControl(Composite parent){
  if (toggles == null && providers != null) {
    composite=new Composite(parent,SWT.NONE);
    GridLayout layout=new GridLayout();
    layout.horizontalSpacing=7;
    layout.numColumns=providers.length;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData());
    toggles=new TogglePropertyDescriptor[providers.length];
    for (int i=0; i < providers.length; i++) {
      toggle=DescriptorToolkit.createTogglePropertyDescriptor();
      toggles[i]=toggle;
      toggle.setDescriptorProvider(providers[i]);
      toggle.createControl(composite);
      GridData gd=new GridData();
      toggle.getControl().setLayoutData(gd);
      toggle.getControl().addDisposeListener(new DisposeListener(){
        public void widgetDisposed(        DisposeEvent event){
          toggle=null;
          boolean flag=true;
          for (int i=0; i < providers.length; i++) {
            if (toggles[i] != null) {
              flag=false;
              break;
            }
          }
          if (flag)           toggles=null;
        }
      }
);
    }
  }
 else {
    checkParent(composite,parent);
  }
  return composite;
}
Program: 68414
Project: 68414
Buggy source:
public void load(){
  for (int i=0; i < toggles.length; i++) {
    if (toggles[i] != null && !toggles[i].getControl().isDisposed())     toggles[i].load();
  }
}

Fixed version (ground truth):
public void load(){
  for (int i=0; i < toggles.length; i++) {
    if (toggles[i] != null && !toggles[i].getControl().isDisposed())     toggles[i].load();
  }
  composite.layout();
}
Program: 68416
Project: 68416
Buggy source:
/** 
 * Update the image being displayed on the button using the current color setting.
 */
protected void updateColorImage(){
  Display display=fButton.getDisplay();
  GC gc=new GC(fImage);
  if (fColor != null) {
    fColor.dispose();
  }
  if (fColorValue == null) {
    gc.setBackground(fButton.getBackground());
    gc.fillRectangle(0,0,fExtent.x,fExtent.y);
  }
 else {
    gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
    gc.drawRectangle(0,2,fExtent.x - 1,fExtent.y - 4);
    fColor=new Color(display,fColorValue);
    gc.setBackground(fColor);
    gc.fillRectangle(1,3,fExtent.x - 2,fExtent.y - 5);
  }
  gc.dispose();
  fButton.setImage(fImage);
}

Fixed version (ground truth):
/** 
 * Update the image being displayed on the button using the current color setting.
 */
protected void updateColorImage(){
  Display display=fButton.getDisplay();
  GC gc=new GC(fImage);
  if (fColor != null) {
    fColor.dispose();
  }
  if (fColorValue == null) {
    gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
    gc.drawRectangle(0,2,fExtent.x - 1,fExtent.y - 4);
    gc.setBackground(fButton.getBackground());
    gc.fillRectangle(1,3,fExtent.x - 2,fExtent.y - 5);
  }
 else {
    gc.setForeground(display.getSystemColor(SWT.COLOR_BLACK));
    gc.drawRectangle(0,2,fExtent.x - 1,fExtent.y - 4);
    fColor=new Color(display,fColorValue);
    gc.setBackground(fColor);
    gc.fillRectangle(1,3,fExtent.x - 2,fExtent.y - 5);
  }
  gc.dispose();
  fButton.setImage(fImage);
}
Program: 68417
Project: 68417
Buggy source:
/** 
 * Compute the size of the image to be displayed.
 * @param window -the window used to calculate
 * @return <code>Point</code>
 */
private Point computeImageSize(Control window){
  GC gc=new GC(window);
  Font f=JFaceResources.getFontRegistry().get(JFaceResources.DIALOG_FONT);
  gc.setFont(f);
  int height=gc.getFontMetrics().getHeight();
  gc.dispose();
  Point p=new Point(height * 3 - 6,height);
  return p;
}

Fixed version (ground truth):
/** 
 * Compute the size of the image to be displayed.
 * @param window - the window used to calculate
 * @return <code>Point</code>
 */
private Point computeImageSize(Control window){
  GC gc=new GC(window);
  Font f=JFaceResources.getFontRegistry().get(JFaceResources.DIALOG_FONT);
  gc.setFont(f);
  int height=gc.getFontMetrics().getHeight();
  gc.dispose();
  Point p=new Point(height * 3 - 6,height);
  return p;
}
Program: 68418
Project: 68418
Buggy source:
public void run(){
  if (guideHandle != null && guideHandle.isCanDeleteGuide()) {
    removeGuideFeedBack();
  }
}

Fixed version (ground truth):
public void run(){
  if (!(getModel() instanceof DesignElementHandle)) {
    return;
  }
  DesignElementHandle handle=(DesignElementHandle)getModel();
  Object[] backGroundPosition=getBackgroundPosition(handle);
  Object xPosition=backGroundPosition[0];
  Object yPosition=backGroundPosition[1];
  boolean needRefresh=false;
  if (xPosition instanceof DimensionValue) {
    needRefresh=true;
  }
  if (yPosition instanceof DimensionValue) {
    needRefresh=true;
  }
  if (needRefresh) {
    refreshVisuals();
  }
}
Program: 68419
Project: 68419
Buggy source:
public void activate(){
  if (isActive())   return;
  super.activate();
  refreshPageClip();
  getFigure().addMouseMotionListener(new MouseMotionListener.Stub(){
    public void mouseEntered(    MouseEvent me){
      addGuideFeedBack();
    }
    public void mouseExited(    MouseEvent me){
      delayRemoveGuideFeedBack();
    }
    public void mouseHover(    MouseEvent me){
      addGuideFeedBack();
    }
    public void mouseMoved(    MouseEvent me){
      addGuideFeedBack();
    }
  }
);
  getFigure().setFocusTraversable(true);
  updateLayoutPreference();
}

Fixed version (ground truth):
public void activate(){
  if (isActive())   return;
  super.activate();
  refreshPageClip();
  getFigure().addMouseMotionListener(new MouseMotionListener.Stub(){
    public void mouseEntered(    MouseEvent me){
      addGuideFeedBack();
    }
    public void mouseExited(    MouseEvent me){
      delayRemoveGuideFeedBack();
    }
    public void mouseHover(    MouseEvent me){
      addGuideFeedBack();
    }
    public void mouseMoved(    MouseEvent me){
      addGuideFeedBack();
    }
  }
);
  getFigure().setFocusTraversable(true);
  updateLayoutPreference();
  Display.getCurrent().asyncExec(new Runnable(){
    public void run(){
      if (!(getModel() instanceof DesignElementHandle)) {
        return;
      }
      DesignElementHandle handle=(DesignElementHandle)getModel();
      Object[] backGroundPosition=getBackgroundPosition(handle);
      Object xPosition=backGroundPosition[0];
      Object yPosition=backGroundPosition[1];
      boolean needRefresh=false;
      if (xPosition instanceof DimensionValue) {
        needRefresh=true;
      }
      if (yPosition instanceof DimensionValue) {
        needRefresh=true;
      }
      if (needRefresh) {
        refreshVisuals();
      }
    }
  }
);
}
Program: 68420
Project: 68420
Buggy source:
protected ConfigurableOption initializeWrappingText(){
  ConfigurableOption wrappingText=new ConfigurableOption(TEXT_WRAPPING);
  wrappingText.setDisplayName(Messages.getString("String_Node_Str"));
  wrappingText.setDataType(IConfigurableOption.DataType.BOOLEAN);
  wrappingText.setDisplayType(IConfigurableOption.DisplayType.CHECKBOX);
  wrappingText.setDefaultValue(Boolean.TRUE);
  wrappingText.setToolTip(null);
  wrappingText.setDescription(Messages.getString("String_Node_Str"));
  return wrappingText;
}

Fixed version (ground truth):
protected ConfigurableOption initializeWrappingText(){
  ConfigurableOption wrappingText=new ConfigurableOption(TEXT_WRAPPING);
  wrappingText.setDisplayName(getMessage("String_Node_Str"));
  wrappingText.setDataType(IConfigurableOption.DataType.BOOLEAN);
  wrappingText.setDisplayType(IConfigurableOption.DisplayType.CHECKBOX);
  wrappingText.setDefaultValue(Boolean.TRUE);
  wrappingText.setToolTip(null);
  wrappingText.setDescription(getMessage("String_Node_Str"));
  return wrappingText;
}
Program: 68421
Project: 68421
Buggy source:
public String getDisplayName(){
  return Messages.getString("String_Node_Str");
}

Fixed version (ground truth):
public String getDisplayName(){
  return getMessage("String_Node_Str");
}
Program: 68422
Project: 68422
Buggy source:
private void initOptions(){
  ConfigurableOption wrappingText=initializeWrappingText();
  ConfigurableOption chartDpi=new ConfigurableOption(CHART_DPI);
  chartDpi.setDisplayName(Messages.getString("String_Node_Str"));
  chartDpi.setDataType(IConfigurableOption.DataType.INTEGER);
  chartDpi.setDisplayType(IConfigurableOption.DisplayType.TEXT);
  chartDpi.setDefaultValue(new Integer(192));
  chartDpi.setToolTip(null);
  chartDpi.setDescription(Messages.getString("String_Node_Str"));
  options=new IConfigurableOption[]{wrappingText,chartDpi};
}

Fixed version (ground truth):
private void initOptions(){
  ConfigurableOption wrappingText=initializeWrappingText();
  ConfigurableOption chartDpi=new ConfigurableOption(CHART_DPI);
  chartDpi.setDisplayName(getMessage("String_Node_Str"));
  chartDpi.setDataType(IConfigurableOption.DataType.INTEGER);
  chartDpi.setDisplayType(IConfigurableOption.DisplayType.TEXT);
  chartDpi.setDefaultValue(new Integer(192));
  chartDpi.setToolTip(null);
  chartDpi.setDescription(getMessage("String_Node_Str"));
  options=new IConfigurableOption[]{wrappingText,chartDpi};
}
Program: 68423
Project: 68423
Buggy source:
public ExcelEmitterDescriptor(){
  initOptions();
}

Fixed version (ground truth):
public ExcelEmitterDescriptor(Locale locale){
  this.locale=locale;
  initOptions();
}
Program: 68424
Project: 68424
Buggy source:
public String getDescription(){
  return Messages.getString("String_Node_Str");
}

Fixed version (ground truth):
public String getDescription(){
  return getMessage("String_Node_Str");
}
Program: 68425
Project: 68425
Buggy source:
/** 
 * Returns the resource bundle.
 * @return the resource bundle.
 */
public static ResourceBundle getReportResourceBundle(){
  return RESOURCE_BUNDLE;
}

Fixed version (ground truth):
/** 
 * Returns the resource bundle.
 * @return the resource bundle.
 */
public static ResourceBundle getReportResourceBundle(Locale locale){
  ResourceBundle bundle=getReportResourceBundle();
  if (locale != null) {
    bundle=localeToBundle.get(locale);
    if (bundle == null) {
      bundle=ResourceBundle.getBundle(BUNDLE_NAME,locale);
      localeToBundle.put(locale,bundle);
    }
  }
  return bundle == null ? RESOURCE_BUNDLE : bundle;
}
Program: 68426
Project: 68426
Buggy source:
/** 
 * Returns formatted translation for current local.
 * @param key the key to translate.
 * @return translated value string.
 */
public static String getFormattedString(String key,Object[] arguments){
  return MessageFormat.format(getString(key),arguments);
}

Fixed version (ground truth):
/** 
 * Returns formatted translation for current local.
 * @param key the key to translate.
 * @return translated value string.
 */
public static String getFormattedString(String key,Object[] arguments,Locale locale){
  return MessageFormat.format(getString(key,locale),arguments);
}
Program: 68427
Project: 68427
Buggy source:
/** 
 * Returns common translation for current local.
 * @param key the key to translate.
 * @return translated value string.
 */
public static String getString(String key){
}

Fixed version (ground truth):
/** 
 * Returns common translation for current local.
 * @param key the key to translate.
 * @return translated value string.
 */
public static String getString(String key,Locale locale){
}
Program: 68428
Project: 68428
Buggy source:
public String getDisplayName(){
  return Messages.getString("String_Node_Str");
}

Fixed version (ground truth):
public String getDisplayName(){
  return getMessage("String_Node_Str");
}
Program: 68429
Project: 68429
Buggy source:
public String getDescription(){
  return Messages.getString("String_Node_Str");
}

Fixed version (ground truth):
public String getDescription(){
  return getMessage("String_Node_Str");
}
Program: 68430
Project: 68430
Buggy source:
/** 
 * Returns the resource bundle.
 * @return the resource bundle.
 */
public static ResourceBundle getReportResourceBundle(){
  return RESOURCE_BUNDLE;
}

Fixed version (ground truth):
/** 
 * Returns the resource bundle.
 * @return the resource bundle.
 */
public static ResourceBundle getReportResourceBundle(Locale locale){
  ResourceBundle bundle=getReportResourceBundle();
  if (locale != null) {
    bundle=localeToBundle.get(locale);
    if (bundle == null) {
      bundle=ResourceBundle.getBundle(BUNDLE_NAME,locale);
      localeToBundle.put(locale,bundle);
    }
  }
  return bundle == null ? RESOURCE_BUNDLE : bundle;
}
Program: 68431
Project: 68431
Buggy source:
/** 
 * Returns formatted translation for current local.
 * @param key the key to translate.
 * @return translated value string.
 */
public static String getFormattedString(String key,Object[] arguments){
  return MessageFormat.format(getString(key),arguments);
}

Fixed version (ground truth):
/** 
 * Returns formatted translation for current local.
 * @param key the key to translate.
 * @return translated value string.
 */
public static String getFormattedString(String key,Object[] arguments,Locale locale){
  return MessageFormat.format(getString(key,locale),arguments);
}
Program: 68432
Project: 68432
Buggy source:
/** 
 * Returns common translation for current local.
 * @param key the key to translate.
 * @return translated value string.
 */
public static String getString(String key){
}

Fixed version (ground truth):
/** 
 * Returns common translation for current local.
 * @param key the key to translate.
 * @return translated value string.
 */
public static String getString(String key,Locale locale){
}
Program: 68438
Project: 68438
Buggy source:
/** 
 * without column edge
 * @throws OLAPException
 * @throws BirtException 
 */
public void testCursorModel3() throws OLAPException, BirtException {
  ICubeQueryDefinition cqd=new CubeQueryDefinition(CubeUtility.cubeName);
  cqd.createMeasure("String_Node_Str");
  IEdgeDefinition rowEdge=cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);
  IDimensionDefinition dim1=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier1=dim1.createHierarchy("String_Node_Str");
  hier1.createLevel("String_Node_Str");
  IDimensionDefinition dim2=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier2=dim2.createHierarchy("String_Node_Str");
  hier2.createLevel("String_Node_Str");
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(null,cqd,de.getSession(),this.scope,de.getContext()));
  CubeCursor dataCursor=cubeView.getCubeCursor(new StopSign(),cube);
  EdgeCursor rowCursor=cubeView.getRowEdgeView().getEdgeCursor();
  DimensionCursor productCursor1=(DimensionCursor)rowCursor.getDimensionCursor().get(0);
  DimensionCursor productCursor2=(DimensionCursor)rowCursor.getDimensionCursor().get(1);
  testOut.print(creator.printCubeAlongDimension(dataCursor,null,null,null,null,productCursor1,productCursor2));
  try {
    this.checkOutputFile();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * without column edge
 * @throws OLAPException
 * @throws BirtException 
 */
public void testCursorModel3() throws OLAPException, BirtException {
  ICubeQueryDefinition cqd=new CubeQueryDefinition(CubeUtility.cubeName);
  cqd.createMeasure("String_Node_Str");
  IEdgeDefinition rowEdge=cqd.createEdge(ICubeQueryDefinition.ROW_EDGE);
  IDimensionDefinition dim1=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier1=dim1.createHierarchy("String_Node_Str");
  hier1.createLevel("String_Node_Str");
  IDimensionDefinition dim2=rowEdge.createDimension("String_Node_Str");
  IHierarchyDefinition hier2=dim2.createHierarchy("String_Node_Str");
  hier2.createLevel("String_Node_Str");
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(null,cqd,de.getSession(),this.scope,de.getContext()));
  CubeCursor dataCursor=cubeView.getCubeCursor(new StopSign(),cube,false);
  EdgeCursor rowCursor=cubeView.getRowEdgeView().getEdgeCursor();
  DimensionCursor productCursor1=(DimensionCursor)rowCursor.getDimensionCursor().get(0);
  DimensionCursor productCursor2=(DimensionCursor)rowCursor.getDimensionCursor().get(1);
  testOut.print(creator.printCubeAlongDimension(dataCursor,null,null,null,null,productCursor1,productCursor2));
  try {
    this.checkOutputFile();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}
Program: 68452
Project: 68452
Buggy source:
public void testMirrorOnQuarterDimension() throws DataException {
  ICubeQueryDefinition cqd=createMirroredQueryDefinition("String_Node_Str");
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(null,cqd,de.getSession(),this.scope,de.getContext()));
  CubeCursor dataCursor=cubeView.getCubeCursor(new StopSign(),cube);
  List rowEdgeBindingNames=new ArrayList();
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  List measureBindingNames=new ArrayList();
  measureBindingNames.add("String_Node_Str");
  try {
    testOut.print(new CubeUtility().printCubeAlongEdge(dataCursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingNames,null,null,null,null));
    this.checkOutputFile();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
public void testMirrorOnQuarterDimension() throws DataException {
  ICubeQueryDefinition cqd=createMirroredQueryDefinition("String_Node_Str");
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(null,cqd,de.getSession(),this.scope,de.getContext()));
  CubeCursor dataCursor=cubeView.getCubeCursor(new StopSign(),cube,false);
  List rowEdgeBindingNames=new ArrayList();
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  List measureBindingNames=new ArrayList();
  measureBindingNames.add("String_Node_Str");
  try {
    testOut.print(new CubeUtility().printCubeAlongEdge(dataCursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingNames,null,null,null,null));
    this.checkOutputFile();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}
Program: 68453
Project: 68453
Buggy source:
public void testMirrorOnYearDimension() throws DataException {
  ICubeQueryDefinition cqd=createMirroredQueryDefinition("String_Node_Str");
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(null,cqd,de.getSession(),this.scope,de.getContext()));
  CubeCursor dataCursor=cubeView.getCubeCursor(new StopSign(),cube);
  List rowEdgeBindingNames=new ArrayList();
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  List measureBindingNames=new ArrayList();
  measureBindingNames.add("String_Node_Str");
  try {
    testOut.print(new CubeUtility().printCubeAlongEdge(dataCursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingNames,null,null,null,null));
    this.checkOutputFile();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
public void testMirrorOnYearDimension() throws DataException {
  ICubeQueryDefinition cqd=createMirroredQueryDefinition("String_Node_Str");
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(null,cqd,de.getSession(),this.scope,de.getContext()));
  CubeCursor dataCursor=cubeView.getCubeCursor(new StopSign(),cube,false);
  List rowEdgeBindingNames=new ArrayList();
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  List measureBindingNames=new ArrayList();
  measureBindingNames.add("String_Node_Str");
  try {
    testOut.print(new CubeUtility().printCubeAlongEdge(dataCursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingNames,null,null,null,null));
    this.checkOutputFile();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}
Program: 68454
Project: 68454
Buggy source:
public void testMirrorOnMonthDimension() throws DataException {
  ICubeQueryDefinition cqd=createMirroredQueryDefinition("String_Node_Str");
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(null,cqd,de.getSession(),this.scope,de.getContext()));
  CubeCursor dataCursor=cubeView.getCubeCursor(new StopSign(),cube);
  List rowEdgeBindingNames=new ArrayList();
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  List measureBindingNames=new ArrayList();
  measureBindingNames.add("String_Node_Str");
  try {
    testOut.print(new CubeUtility().printCubeAlongEdge(dataCursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingNames,null,null,null,null));
    this.checkOutputFile();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
public void testMirrorOnMonthDimension() throws DataException {
  ICubeQueryDefinition cqd=createMirroredQueryDefinition("String_Node_Str");
  BirtCubeView cubeView=new BirtCubeView(new CubeQueryExecutor(null,cqd,de.getSession(),this.scope,de.getContext()));
  CubeCursor dataCursor=cubeView.getCubeCursor(new StopSign(),cube,false);
  List rowEdgeBindingNames=new ArrayList();
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  rowEdgeBindingNames.add("String_Node_Str");
  List columnEdgeBindingNames=new ArrayList();
  columnEdgeBindingNames.add("String_Node_Str");
  List measureBindingNames=new ArrayList();
  measureBindingNames.add("String_Node_Str");
  try {
    testOut.print(new CubeUtility().printCubeAlongEdge(dataCursor,columnEdgeBindingNames,rowEdgeBindingNames,measureBindingNames,null,null,null,null));
    this.checkOutputFile();
  }
 catch (  Exception e) {
    fail("String_Node_Str");
  }
}
Program: 68460
Project: 68460
Buggy source:
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet);
    }
    dos.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.resultObjects.length;
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,resultObjects[i],colCount,resultSetNameSet);
    }
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 68461
Project: 68461
Buggy source:
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.diskBasedResultSet.getCount();
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    int currIndex=this.currResultIndex;
    this.reset();
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,this.diskBasedResultSet.nextRow(),colCount,resultSetNameSet);
    }
    this.reset();
    this.moveTo(currIndex);
    dos.close();
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}

Fixed version (ground truth):
public void doSave(DataOutputStream outputStream,DataOutputStream rowLensStream,List<IBinding> cacheRequestMap) throws DataException {
  DataOutputStream dos=new DataOutputStream(outputStream);
  Set resultSetNameSet=ResultSetUtil.getRsColumnRequestMap(cacheRequestMap);
  try {
    int rowCount=this.diskBasedResultSet.getCount();
    int colCount=this.rsMeta.getFieldCount();
    IOUtil.writeInt(dos,rowCount);
    int currIndex=this.currResultIndex;
    this.reset();
    long offset=4;
    for (int i=0; i < rowCount; i++) {
      IOUtil.writeLong(rowLensStream,offset);
      offset+=ResultSetUtil.writeResultObject(dos,this.diskBasedResultSet.nextRow(),colCount,resultSetNameSet);
    }
    this.reset();
    this.moveTo(currIndex);
  }
 catch (  IOException e) {
    throw new DataException(ResourceConstants.RD_SAVE_ERROR,e);
  }
}
Program: 68462
Project: 68462
Buggy source:
/** 
 * @param outputStream
 * @param resultSet
 * @throws IOException
 */
private static void saveOneResultSet(DataOutputStream outputStream,IAggregationResultSet resultSet) throws IOException {
  saveMetaData(outputStream,resultSet);
  saveAggregationRowSet(outputStream,resultSet);
  outputStream.close();
}

Fixed version (ground truth):
/** 
 * @param outputStream
 * @param resultSet
 * @throws IOException
 */
private static void saveOneResultSet(DataOutputStream outputStream,IAggregationResultSet resultSet) throws IOException {
  saveMetaData(outputStream,resultSet);
  saveAggregationRowSet(outputStream,resultSet);
}
Program: 68463
Project: 68463
Buggy source:
/** 
 * Gets the BIRT resource path
 * @return
 * @throws URISyntaxException
 */
public URI getReportDesignPath(){
  if (Utility.getReportModuleHandle() == null || Utility.getReportModuleHandle().getSystemId() == null) {
    return null;
  }
  try {
    return new URI(Utility.getReportModuleHandle().getSystemId().getPath());
  }
 catch (  URISyntaxException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the BIRT resource path
 * @return
 * @throws URISyntaxException
 */
public URI getReportDesignPath(){
  if (Utility.getReportModuleHandle() == null || Utility.getReportModuleHandle().getSystemId() == null) {
    return null;
  }
  try {
    return new URI(encode(Utility.getReportModuleHandle().getSystemId().getPath()));
  }
 catch (  URISyntaxException e) {
    return null;
  }
}
Program: 68464
Project: 68464
Buggy source:
/** 
 * Gets the report design file path
 * @return
 */
public URI getBIRTResourcePath(){
  try {
    return new URI(ReportPlugin.getDefault().getResourceFolder());
  }
 catch (  URISyntaxException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the report design file path
 * @return
 */
public URI getBIRTResourcePath(){
  try {
    return new URI(encode(ReportPlugin.getDefault().getResourceFolder()));
  }
 catch (  URISyntaxException e) {
    return null;
  }
}
Program: 68465
Project: 68465
Buggy source:
/** 
 * Create query definition by related report item handle.
 * @param parent
 * @return query definition
 * @throws BirtException
 */
public IDataQueryDefinition createQuery(IDataQueryDefinition parent) throws BirtException {
  BaseQueryDefinition query=createQueryDefinition(parent);
  if (query == null) {
    return null;
  }
  List<GroupHandle> groups=getGroups();
  for (Iterator<GroupHandle> iter=groups.iterator(); iter.hasNext(); ) {
    handleGroup(iter.next(),query,modelAdapter);
  }
  if (ChartReportItemUtil.isChartInheritGroups(fReportItemHandle)) {
    ListingHandle table=null;
    DesignElementHandle container=fReportItemHandle.getContainer();
    while (container != null) {
      if (container instanceof ListingHandle) {
        table=(ListingHandle)container;
        break;
      }
      container=container.getContainer();
    }
    if (table != null) {
      Iterator<ComputedColumnHandle> iterator=table.columnBindingsIterator();
      while (iterator.hasNext()) {
        ComputedColumnHandle binding=iterator.next();
        if (binding.getAggregateFunction() != null) {
          addColumnBinding(query,binding);
        }
      }
    }
  }
  return query;
}

Fixed version (ground truth):
/** 
 * Create query definition by related report item handle.
 * @param parent
 * @return query definition
 * @throws BirtException
 */
public IDataQueryDefinition createQuery(IDataQueryDefinition parent) throws BirtException {
  BaseQueryDefinition query=createQueryDefinition(parent);
  if (query == null) {
    return null;
  }
  List<GroupHandle> groups=getGroups();
  for (Iterator<GroupHandle> iter=groups.iterator(); iter.hasNext(); ) {
    handleGroup(iter.next(),query,modelAdapter);
  }
  if (ChartReportItemUtil.isChartInheritGroups(fReportItemHandle)) {
    ListingHandle table=null;
    DesignElementHandle container=fReportItemHandle.getContainer();
    while (container != null) {
      if (container instanceof ListingHandle) {
        table=(ListingHandle)container;
        break;
      }
      container=container.getContainer();
    }
    if (table != null) {
      Iterator<ComputedColumnHandle> iterator=table.columnBindingsIterator();
      while (iterator.hasNext()) {
        ComputedColumnHandle binding=iterator.next();
        if (binding.getAggregateFunction() != null) {
          addAggregateBindings(query,binding,table);
        }
      }
    }
  }
  return query;
}
Program: 68466
Project: 68466
Buggy source:
public void seek(int index) throws IOException {
  if (index >= length) {
    throw new IndexOutOfBoundsException("String_Node_Str" + index + "String_Node_Str"+ length);
  }
  if (index >= aggregationResultRow.size()) {
    for (int i=0; i <= index - aggregationResultRow.size(); i++) {
      aggregationResultRow.add(AggregationResultSetSaveUtil.loadAggregationRow(inputStream));
    }
  }
  currentPosition=index;
  resultObject=(AggregationResultRow)aggregationResultRow.get(index);
}

Fixed version (ground truth):
public void seek(int index) throws IOException {
  if (index >= length) {
    throw new IndexOutOfBoundsException("String_Node_Str" + index + "String_Node_Str"+ length);
  }
  currentPosition=index;
  resultObject=(AggregationResultRow)aggregationResultRow.get(index);
}
Program: 68467
Project: 68467
Buggy source:
public void close() throws IOException {
  inputStream.close();
}

Fixed version (ground truth):
public void close() throws IOException {
  aggregationResultRow.close();
}
Program: 68468
Project: 68468
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) {
    this.aggregationNames=new String[aggregationNames.length];
    for (int i=0; i < aggregationNames.length; i++) {
      this.aggregationNames[i]=aggregationNames[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");
}

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.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) {
    this.aggregationNames=new String[aggregationNames.length];
    for (int i=0; i < aggregationNames.length; i++) {
      this.aggregationNames[i]=aggregationNames[i];
      aggregationResultNameMap.put(aggregationNames[i],new Integer(i));
    }
  }
  aggregationResultRow=new BufferedStructureArray(AggregationResultRow.getCreator(),Constants.LIST_BUFFER_SIZE);
  for (int i=0; i < length; i++) {
    aggregationResultRow.add(AggregationResultSetSaveUtil.loadAggregationRow(inputStream));
  }
  if (this.length > 0)   seek(0);
  logger.exiting(CachedAggregationResultSet.class.getName(),"String_Node_Str");
}
Program: 68469
Project: 68469
Buggy source:
public void clear() throws IOException {
  inputStream.close();
  length=0;
}

Fixed version (ground truth):
public void clear() throws IOException {
  aggregationResultRow.clear();
  length=0;
}
Program: 68470
Project: 68470
Buggy source:
/** 
 * Adds reference bindings of aggregate binding into query.  
 * @param qd
 * @param table
 * @param expression
 * @throws BirtException
 * @throws ChartException
 */
private void addReferenceBindings(IBaseQueryDefinition qd,ListingHandle table,String expression) throws BirtException, ChartException {
  List<IColumnBinding> exprs=ExpressionUtil.extractColumnExpressions(expression);
  for (Iterator<IColumnBinding> iter=exprs.iterator(); iter.hasNext(); ) {
    IColumnBinding cb=iter.next();
    String cname=cb.getResultSetColumnName();
    for (Iterator<ComputedColumnHandle> cbIter=table.columnBindingsIterator(); cbIter.hasNext(); ) {
      ComputedColumnHandle cch=cbIter.next();
      if (cch.getName().equals(cname)) {
        if (cch.getAggregateFunction() == null && !qd.getBindings().containsKey(cname)) {
          addColumnBinding(qd,cch);
          addReferenceBindings(qd,table,cch.getExpression());
        }
        break;
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds reference bindings of aggregate binding into query.  
 * @param qd
 * @param table
 * @param expression
 * @throws BirtException
 * @throws ChartException
 */
private void addReferenceBindings(IBaseQueryDefinition qd,ListingHandle table,String expression) throws BirtException, ChartException {
  List<IColumnBinding> exprs=ExpressionUtil.extractColumnExpressions(expression);
  for (Iterator<IColumnBinding> iter=exprs.iterator(); iter.hasNext(); ) {
    IColumnBinding cb=iter.next();
    String cname=cb.getResultSetColumnName();
    for (Iterator<ComputedColumnHandle> cbIter=table.columnBindingsIterator(); cbIter.hasNext(); ) {
      ComputedColumnHandle cch=cbIter.next();
      if (cch.getName().equals(cname)) {
        if (cch.getAggregateFunction() == null && !qd.getBindings().containsKey(cname)) {
          addColumnBinding(qd,cch);
          ScriptExpression se=ChartReportItemUtil.newExpression(modelAdapter,cch);
          addReferenceBindings(qd,table,se.getText());
        }
        break;
      }
    }
  }
}
Program: 68471
Project: 68471
Buggy source:
/** 
 * Returns the DPI info of given image if applicable.
 * @param imageStream
 * @return the DPI values in format of {hdpi, vdpi}.
 */
public static int[] getImageResolution(InputStream imageStream){
  int[] dpi={0,0};
  if (imageStream != null) {
    try {
      ImageInputStream iis=ImageIO.createImageInputStream(imageStream);
      Iterator<ImageReader> i=ImageIO.getImageReaders(iis);
      ImageReader r=i.next();
      r.setInput(iis);
      r.read(0);
      IIOMetadata meta=r.getImageMetadata(0);
      if (meta != null) {
        double mm2inch=25.4;
        NodeList lst;
        Element node=(Element)meta.getAsTree("String_Node_Str");
        lst=node.getElementsByTagName("String_Node_Str");
        if (lst != null && lst.getLength() == 1) {
          dpi[0]=(int)(mm2inch / Float.parseFloat(((Element)lst.item(0)).getAttribute("String_Node_Str")));
        }
        lst=node.getElementsByTagName("String_Node_Str");
        if (lst != null && lst.getLength() == 1) {
          dpi[1]=(int)(mm2inch / Float.parseFloat(((Element)lst.item(0)).getAttribute("String_Node_Str")));
        }
      }
    }
 catch (    IOException e) {
      e.printStackTrace();
    }
  }
  return dpi;
}

Fixed version (ground truth):
/** 
 * Returns the DPI info of given image if applicable.
 * @param imageStream
 * @return the DPI values in format of {hdpi, vdpi}.
 */
public static int[] getImageResolution(InputStream imageStream){
  int[] dpi={0,0};
  if (imageStream != null) {
    try {
      ImageInputStream iis=ImageIO.createImageInputStream(imageStream);
      Iterator<ImageReader> i=ImageIO.getImageReaders(iis);
      ImageReader r=i.next();
      r.setInput(iis);
      r.read(0);
      IIOMetadata meta=r.getImageMetadata(0);
      if (meta != null) {
        double mm2inch=25.4;
        NodeList lst;
        Element node=(Element)meta.getAsTree("String_Node_Str");
        lst=node.getElementsByTagName("String_Node_Str");
        if (lst != null && lst.getLength() == 1) {
          dpi[0]=(int)(mm2inch / Float.parseFloat(((Element)lst.item(0)).getAttribute("String_Node_Str")));
        }
        lst=node.getElementsByTagName("String_Node_Str");
        if (lst != null && lst.getLength() == 1) {
          dpi[1]=(int)(mm2inch / Float.parseFloat(((Element)lst.item(0)).getAttribute("String_Node_Str")));
        }
      }
    }
 catch (    Exception e) {
      e.printStackTrace();
    }
  }
  return dpi;
}
Program: 68475
Project: 68475
Buggy source:
public void setDataSet(String datasetName){
  try {
    boolean isPreviousDataBindingReference=false;
    if (itemHandle.getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      isPreviousDataBindingReference=true;
      itemHandle.setDataBindingReference(null);
    }
    itemHandle.setCube(null);
    if (datasetName == null) {
      if (getDataSet() != null) {
        clearBindings();
      }
      itemHandle.setDataSet(null);
    }
 else {
      DataSetHandle dataset=getReportDesignHandle().findDataSet(datasetName);
      if (isPreviousDataBindingReference || itemHandle.getDataSet() != dataset) {
        itemHandle.setDataSet(dataset);
        clearBindings();
        generateBindings(generateComputedColumns(dataset));
      }
    }
    ChartWizard.removeException(ChartWizard.RepDSProvider_Set_ID);
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.RepDSProvider_Set_ID,e.getLocalizedMessage());
  }
}

Fixed version (ground truth):
public void setDataSet(String datasetName){
  try {
    boolean isPreviousDataBindingReference=false;
    if (itemHandle.getDataBindingType() == ReportItemHandle.DATABINDING_TYPE_REPORT_ITEM_REF) {
      isPreviousDataBindingReference=true;
      itemHandle.setDataBindingReference(null);
    }
    itemHandle.setCube(null);
    if (datasetName == null) {
      if (getDataSet() != null) {
        clearBindings();
      }
      itemHandle.setDataSet(null);
    }
 else {
      DataSetHandle dataset=getReportDesignHandle().findDataSet(datasetName);
      if (isPreviousDataBindingReference || itemHandle.getDataSet() != dataset) {
        itemHandle.setDataSet(dataset);
        clearBindings();
        generateBindings(generateComputedColumns(dataset));
        List<SeriesDefinition> sds=ChartUIUtil.getBaseSeriesDefinitions(context.getModel());
        if (sds != null && sds.size() > 0) {
          SeriesDefinition base=sds.get(0);
          if (!ChartUIConstants.TYPE_GANTT.equals(context.getModel().getType())) {
            if (base.getGrouping() == null) {
              base.setGrouping(SeriesGroupingImpl.create());
            }
            base.getGrouping().setEnabled(true);
          }
        }
      }
    }
    ChartWizard.removeException(ChartWizard.RepDSProvider_Set_ID);
  }
 catch (  SemanticException e) {
    ChartWizard.showException(ChartWizard.RepDSProvider_Set_ID,e.getLocalizedMessage());
  }
}