Program: 72993
Project: 72993
Buggy source:
public int open(final ExtendedItemHandle eih){
  if (iInstanceCount > 0) {
    return Window.CANCEL;
  }
  iInstanceCount++;
  if (ChartXTabUtil.isAxisChart(eih)) {
    DesignElementHandle hostChart=eih.getElementProperty(ChartReportItemUtil.PROPERTY_HOST_CHART);
    this.extendedHandle=(ExtendedItemHandle)hostChart;
  }
 else {
    this.extendedHandle=eih;
  }
  try {
    IReportItem item=null;
    try {
      item=extendedHandle.getReportItem();
      if (item == null) {
        extendedHandle.loadExtendedElement();
        item=extendedHandle.getReportItem();
      }
    }
 catch (    ExtendedElementException exception) {
      logger.log(exception);
    }
    if (item == null) {
      logger.log(ILogger.ERROR,Messages.getString("String_Node_Str"));
      return Window.CANCEL;
    }
    final CommandStack commandStack=extendedHandle.getRoot().getCommandStack();
    final String TRANS_NAME="String_Node_Str";
    commandStack.startTrans(TRANS_NAME);
    final ChartReportItemImpl crii=((ChartReportItemImpl)item);
    final Chart cm=(Chart)crii.getProperty(ChartReportItemUtil.PROPERTY_CHART);
    final Chart cmClone=(cm == null) ? null : (Chart)EcoreUtil.copy(cm);
    final Object[] applyData=new Object[2];
    Shell parentShell=null;
    if (PlatformUI.isWorkbenchRunning()) {
      parentShell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
    }
    final ChartWizard chartBuilder=new ChartWizard(parentShell);
    ReportDataServiceProvider dataProvider=new ReportDataServiceProvider(extendedHandle);
    IChartDataSheet dataSheet=new StandardChartDataSheet(extendedHandle,dataProvider);
    final ChartWizardContext context=new ChartWizardContext(cmClone,this,dataProvider,dataSheet);
    dataProvider.setWizardContext(context);
    if (dataProvider.checkState(IDataServiceProvider.PART_CHART)) {
      context.setEnabled(ChartUIConstants.SUBTASK_AXIS,false);
      context.setEnabled(ChartUIConstants.SUBTASK_AXIS_X,false);
      context.setEnabled(ChartUIConstants.SUBTASK_AXIS_Y,false);
      context.setEnabled(ChartUIConstants.SUBTASK_AXIS_Z,false);
      context.setEnabled(ChartUIConstants.SUBTASK_LEGEND,false);
      context.setEnabled(ChartUIConstants.SUBTASK_TITLE,false);
      context.setEnabled(ChartUIConstants.TYPE_PIE,false);
      context.setEnabled(ChartUIConstants.TYPE_METER,false);
      context.setEnabled(ChartUIConstants.TYPE_STOCK,false);
      context.setEnabled(ChartUIConstants.TYPE_BUBBLE,false);
      context.setEnabled(ChartUIConstants.TYPE_DIFFERENCE,false);
      context.setEnabled(ChartUIConstants.TYPE_GANTT,false);
    }
    chartBuilder.addCustomButton(new ApplyButtonHandler(chartBuilder){
      public void run(){
        super.run();
        applyData[0]=EcoreUtil.copy(context.getModel());
        applyData[1]=context.getOutputFormat();
        commandStack.commit();
        commandStack.startTrans(TRANS_NAME);
      }
    }
);
    context.setRtL(ChartReportItemUtil.isRtl());
    Object of=extendedHandle.getProperty(ChartReportItemUtil.PROPERTY_OUTPUT);
    if (of instanceof String) {
      if (of.equals("String_Node_Str")) {
        context.setOutputFormat("String_Node_Str");
      }
 else       context.setOutputFormat((String)of);
    }
    context.setExtendedItem(extendedHandle);
    context.setProcessor(new ChartReportStyleProcessor(extendedHandle,false));
    ChartWizardContext contextResult=(ChartWizardContext)chartBuilder.open(null,taskId,context);
    if (contextResult != null && contextResult.getModel() != null) {
      commandStack.commit();
      updateModel(extendedHandle,chartBuilder,crii,cm,contextResult.getModel(),contextResult.getOutputFormat());
      if (dataProvider.isPartChart()) {
        ChartXTabUIUtil.updateXTabForAxis(ChartXTabUtil.getXtabContainerCell(extendedHandle),extendedHandle,cm,contextResult.getModel());
      }
      return Window.OK;
    }
 else     if (applyData[0] != null) {
      commandStack.rollback();
      updateModel(extendedHandle,chartBuilder,crii,cm,(Chart)applyData[0],(String)applyData[1]);
      if (dataProvider.isPartChart()) {
        ChartXTabUIUtil.updateXTabForAxis(ChartXTabUtil.getXtabContainerCell(extendedHandle),extendedHandle,cm,(Chart)applyData[0]);
      }
      return Window.OK;
    }
    commandStack.rollback();
    return Window.CANCEL;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
 finally {
    iInstanceCount--;
    this.extendedHandle=null;
  }
}

Fixed version (ground truth):
public int open(final ExtendedItemHandle eih){
  if (iInstanceCount > 0) {
    return Window.CANCEL;
  }
  iInstanceCount++;
  if (ChartXTabUtil.isAxisChart(eih)) {
    DesignElementHandle hostChart=eih.getElementProperty(ChartReportItemUtil.PROPERTY_HOST_CHART);
    this.extendedHandle=(ExtendedItemHandle)hostChart;
  }
 else {
    this.extendedHandle=eih;
  }
  try {
    IReportItem item=null;
    try {
      item=extendedHandle.getReportItem();
      if (item == null) {
        extendedHandle.loadExtendedElement();
        item=extendedHandle.getReportItem();
      }
    }
 catch (    ExtendedElementException exception) {
      logger.log(exception);
    }
    if (item == null) {
      logger.log(ILogger.ERROR,Messages.getString("String_Node_Str"));
      return Window.CANCEL;
    }
    final CommandStack commandStack=extendedHandle.getRoot().getCommandStack();
    final String TRANS_NAME="String_Node_Str";
    commandStack.startTrans(TRANS_NAME);
    final ChartReportItemImpl crii=((ChartReportItemImpl)item);
    final Chart cm=(Chart)crii.getProperty(ChartReportItemUtil.PROPERTY_CHART);
    final Chart cmClone=(cm == null) ? null : (Chart)EcoreUtil.copy(cm);
    final Object[] applyData=new Object[2];
    Shell parentShell=null;
    if (PlatformUI.isWorkbenchRunning()) {
      parentShell=PlatformUI.getWorkbench().getDisplay().getActiveShell();
    }
    final ChartWizard chartBuilder=new ChartWizard(parentShell);
    ReportDataServiceProvider dataProvider=new ReportDataServiceProvider(extendedHandle);
    IChartDataSheet dataSheet=new StandardChartDataSheet(extendedHandle,dataProvider);
    final ChartWizardContext context=new ChartWizardContext(cmClone,this,dataProvider,dataSheet);
    dataProvider.setWizardContext(context);
    if (dataProvider.checkState(IDataServiceProvider.PART_CHART)) {
      context.setEnabled(ChartUIConstants.SUBTASK_AXIS,false);
      context.setEnabled(ChartUIConstants.SUBTASK_AXIS_X,false);
      context.setEnabled(ChartUIConstants.SUBTASK_AXIS_Y,false);
      context.setEnabled(ChartUIConstants.SUBTASK_AXIS_Z,false);
      context.setEnabled(ChartUIConstants.SUBTASK_LEGEND,false);
      context.setEnabled(ChartUIConstants.SUBTASK_TITLE,false);
      context.setEnabled(ChartUIConstants.TYPE_PIE,false);
      context.setEnabled(ChartUIConstants.TYPE_METER,false);
      context.setEnabled(ChartUIConstants.TYPE_STOCK,false);
      context.setEnabled(ChartUIConstants.TYPE_BUBBLE,false);
      context.setEnabled(ChartUIConstants.TYPE_DIFFERENCE,false);
      context.setEnabled(ChartUIConstants.TYPE_GANTT,false);
    }
    chartBuilder.addCustomButton(new ApplyButtonHandler(chartBuilder){
      public void run(){
        super.run();
        applyData[0]=EcoreUtil.copy(context.getModel());
        applyData[1]=context.getOutputFormat();
        commandStack.commit();
        commandStack.startTrans(TRANS_NAME);
      }
    }
);
    context.setRtL(ChartReportItemUtil.isRtl());
    Object of=extendedHandle.getProperty(ChartReportItemUtil.PROPERTY_OUTPUT);
    if (of instanceof String) {
      if (of.equals("String_Node_Str")) {
        context.setOutputFormat("String_Node_Str");
      }
 else       context.setOutputFormat((String)of);
    }
    context.setExtendedItem(extendedHandle);
    context.setProcessor(new ChartReportStyleProcessor(extendedHandle,false));
    ChartWizardContext contextResult=(ChartWizardContext)chartBuilder.open(null,taskId,context);
    if (contextResult != null && contextResult.getModel() != null) {
      commandStack.commit();
      updateModel(extendedHandle,chartBuilder,crii,cm,contextResult.getModel(),contextResult.getOutputFormat());
      if (dataProvider.isPartChart()) {
        ChartXTabUIUtil.updateXTabForAxis(ChartXTabUtil.getXtabContainerCell(extendedHandle),extendedHandle,ChartXTabUIUtil.isTransposedChartWithAxes(cm),contextResult.getModel());
      }
      return Window.OK;
    }
 else     if (applyData[0] != null) {
      commandStack.rollback();
      updateModel(extendedHandle,chartBuilder,crii,cm,(Chart)applyData[0],(String)applyData[1]);
      if (dataProvider.isPartChart()) {
        ChartXTabUIUtil.updateXTabForAxis(ChartXTabUtil.getXtabContainerCell(extendedHandle),extendedHandle,ChartXTabUIUtil.isTransposedChartWithAxes(cm),(Chart)applyData[0]);
      }
      return Window.OK;
    }
    commandStack.rollback();
    return Window.CANCEL;
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
 finally {
    iInstanceCount--;
    this.extendedHandle=null;
  }
}