Program: 139913
Project: 139913
Buggy source:
private void creatChart(Composite parent,String tableA,String tableB){
  CustomerDefaultCategoryDataset dataset=new CustomerDefaultCategoryDataset();
  dataset.addValue(rowMatchingIndicatorA.getNotMatchingValueCount(),NOT_MATCHING,tableA);
  dataset.addValue(rowMatchingIndicatorA.getMatchingValueCount(),MATCHING,tableA);
  PatternChartDataEntity dataEntityA=new PatternChartDataEntity();
  dataEntityA.setLabel(tableA);
  dataEntityA.setIndicator(rowMatchingIndicatorA);
  dataEntityA.setNumMatch(rowMatchingIndicatorA.getMatchingValueCount().toString());
  dataEntityA.setNumNoMatch(rowMatchingIndicatorA.getNotMatchingValueCount().toString());
  dataset.addDataEntity(dataEntityA);
  if (!isHasDeactivatedIndicator) {
    dataset.addValue(rowMatchingIndicatorB.getNotMatchingValueCount(),NOT_MATCHING,tableB);
    dataset.addValue(rowMatchingIndicatorB.getMatchingValueCount(),MATCHING,tableB);
    PatternChartDataEntity dataEntityB=new PatternChartDataEntity();
    dataEntityB.setLabel(tableB);
    dataEntityB.setIndicator(rowMatchingIndicatorB);
    dataEntityB.setNumMatch(rowMatchingIndicatorB.getMatchingValueCount().toString());
    dataEntityB.setNumNoMatch(rowMatchingIndicatorB.getNotMatchingValueCount().toString());
    dataset.addDataEntity(dataEntityB);
  }
  JFreeChart chart=TopChartFactory.createStacked3DBarChart(DefaultMessagesImpl.getString("String_Node_Str"),dataset,PlotOrientation.HORIZONTAL);
  ChartDecorator.decorate(chart);
  GridData gd=new GridData();
  gd.heightHint=180;
  gd.widthHint=450;
  final ChartComposite chartComp=new ChartComposite(parent,SWT.NONE,chart);
  chartComp.setLayoutData(gd);
  chartComp.addChartMouseListener(new ChartMouseListener(){
    public void chartMouseClicked(    ChartMouseEvent event){
      boolean flag=event.getTrigger().getButton() != MouseEvent.BUTTON3;
      chartComp.setDomainZoomable(flag);
      chartComp.setRangeZoomable(flag);
      if (flag) {
        return;
      }
      ChartEntity chartEntity=event.getEntity();
      if (chartEntity != null) {
        CategoryItemEntity cateEntity=(CategoryItemEntity)chartEntity;
        CustomerDefaultCategoryDataset dataEntity=(CustomerDefaultCategoryDataset)cateEntity.getDataset();
        Menu menu=new Menu(chartComp.getShell(),SWT.POP_UP);
        chartComp.setMenu(menu);
        ChartDataEntity currentDataEntity=null;
        ChartDataEntity[] dataEntities=dataEntity.getDataEntities();
        if (dataEntities.length == 1) {
          currentDataEntity=dataEntities[0];
        }
 else {
          for (          ChartDataEntity entity : dataEntities) {
            if (cateEntity.getColumnKey().compareTo(entity.getLabel()) == 0) {
              currentDataEntity=entity;
            }
 else {
              if (cateEntity.getRowKey().compareTo(entity.getLabel()) == 0) {
                currentDataEntity=entity;
              }
            }
          }
        }
        if (currentDataEntity != null) {
          RowMatchExplorer explorer=new RowMatchExplorer();
          final Analysis analysis=getAnalysisHandler().getAnalysis();
          final Indicator indicator=currentDataEntity.getIndicator();
          MenuItemEntity[] itemEntities=ChartTableMenuGenerator.generate(explorer,analysis,currentDataEntity);
          for (          final MenuItemEntity itemEntity : itemEntities) {
            MenuItem menuItem=new MenuItem(menu,SWT.NONE);
            menuItem.setText(itemEntity.getLabel());
            menuItem.setImage(ImageLib.getImage(ImageLib.EXPLORE_IMAGE));
            menuItem.addSelectionListener(new SelectionAdapter(){
              public void widgetSelected(              SelectionEvent e){
                Display.getDefault().asyncExec(new Runnable(){
                  public void run(){
                    TdDataProvider tdDataProvider=SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(analysis.getContext().getConnection());
                    String query=itemEntity.getQuery();
                    String editorName=indicator.getAnalyzedElement().getName();
                    CorePlugin.getDefault().runInDQViewer(tdDataProvider,query,editorName);
                  }
                }
);
              }
            }
);
          }
        }
        menu.setVisible(true);
      }
    }
    public void chartMouseMoved(    ChartMouseEvent event){
    }
  }
);
}

Fixed version (ground truth):
private void creatChart(Composite parent,String tableA,String tableB){
  CustomerDefaultCategoryDataset dataset=new CustomerDefaultCategoryDataset();
  dataset.addValue(rowMatchingIndicatorA.getNotMatchingValueCount(),NOT_MATCHING,tableA);
  dataset.addValue(rowMatchingIndicatorA.getMatchingValueCount(),MATCHING,tableA);
  PatternChartDataEntity dataEntityA=new PatternChartDataEntity();
  dataEntityA.setLabel(tableA);
  dataEntityA.setIndicator(rowMatchingIndicatorA);
  dataEntityA.setNumMatch(rowMatchingIndicatorA.getMatchingValueCount().toString());
  dataEntityA.setNumNoMatch(rowMatchingIndicatorA.getNotMatchingValueCount().toString());
  dataset.addDataEntity(dataEntityA);
  if (!isHasDeactivatedIndicator) {
    dataset.addValue(rowMatchingIndicatorB.getNotMatchingValueCount(),NOT_MATCHING,tableB);
    dataset.addValue(rowMatchingIndicatorB.getMatchingValueCount(),MATCHING,tableB);
    PatternChartDataEntity dataEntityB=new PatternChartDataEntity();
    dataEntityB.setLabel(tableB);
    dataEntityB.setIndicator(rowMatchingIndicatorB);
    dataEntityB.setNumMatch(rowMatchingIndicatorB.getMatchingValueCount().toString());
    dataEntityB.setNumNoMatch(rowMatchingIndicatorB.getNotMatchingValueCount().toString());
    dataset.addDataEntity(dataEntityB);
  }
  JFreeChart chart=TopChartFactory.createStacked3DBarChart(DefaultMessagesImpl.getString("String_Node_Str"),dataset,PlotOrientation.HORIZONTAL);
  ChartDecorator.decorate(chart);
  GridData gd=new GridData();
  gd.heightHint=180;
  gd.widthHint=450;
  final ChartComposite chartComp=new ChartComposite(parent,SWT.NONE,chart);
  chartComp.setLayoutData(gd);
  chartComp.addChartMouseListener(new ChartMouseListener(){
    public void chartMouseClicked(    ChartMouseEvent event){
      boolean flag=event.getTrigger().getButton() != MouseEvent.BUTTON3;
      chartComp.setDomainZoomable(flag);
      chartComp.setRangeZoomable(flag);
      if (flag) {
        return;
      }
      ChartEntity chartEntity=event.getEntity();
      if (chartEntity != null && chartEntity instanceof CategoryItemEntity) {
        CategoryItemEntity cateEntity=(CategoryItemEntity)chartEntity;
        CustomerDefaultCategoryDataset dataEntity=(CustomerDefaultCategoryDataset)cateEntity.getDataset();
        Menu menu=new Menu(chartComp.getShell(),SWT.POP_UP);
        chartComp.setMenu(menu);
        ChartDataEntity currentDataEntity=null;
        ChartDataEntity[] dataEntities=dataEntity.getDataEntities();
        if (dataEntities.length == 1) {
          currentDataEntity=dataEntities[0];
        }
 else {
          for (          ChartDataEntity entity : dataEntities) {
            if (cateEntity.getColumnKey().compareTo(entity.getLabel()) == 0) {
              currentDataEntity=entity;
            }
 else {
              if (cateEntity.getRowKey().compareTo(entity.getLabel()) == 0) {
                currentDataEntity=entity;
              }
            }
          }
        }
        if (currentDataEntity != null) {
          RowMatchExplorer explorer=new RowMatchExplorer();
          final Analysis analysis=getAnalysisHandler().getAnalysis();
          final Indicator indicator=currentDataEntity.getIndicator();
          MenuItemEntity[] itemEntities=ChartTableMenuGenerator.generate(explorer,analysis,currentDataEntity);
          for (          final MenuItemEntity itemEntity : itemEntities) {
            MenuItem menuItem=new MenuItem(menu,SWT.NONE);
            menuItem.setText(itemEntity.getLabel());
            menuItem.setImage(ImageLib.getImage(ImageLib.EXPLORE_IMAGE));
            menuItem.addSelectionListener(new SelectionAdapter(){
              public void widgetSelected(              SelectionEvent e){
                Display.getDefault().asyncExec(new Runnable(){
                  public void run(){
                    TdDataProvider tdDataProvider=SwitchHelpers.TDDATAPROVIDER_SWITCH.doSwitch(analysis.getContext().getConnection());
                    String query=itemEntity.getQuery();
                    String editorName=indicator.getAnalyzedElement().getName();
                    CorePlugin.getDefault().runInDQViewer(tdDataProvider,query,editorName);
                  }
                }
);
              }
            }
);
          }
        }
        menu.setVisible(true);
      }
    }
    public void chartMouseMoved(    ChartMouseEvent event){
    }
  }
);
}