Program: 107774
Project: 107774
Buggy source:
/** 
 * Creates control for ROC curves
 * @param parent
 * @return
 */
private Control createROCControl(Composite parent){
  this.rocRoot=parent;
  this.rocRoot.setLayout(new FillLayout());
  this.rocSash=new SashForm(this.rocRoot,SWT.VERTICAL);
  final Composite composite=new Composite(this.rocSash,SWT.NONE);
  composite.setLayout(SWTUtil.createGridLayout(1));
  final Composite composite2=new Composite(composite,SWT.NONE);
  composite2.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  composite2.setLayout(SWTUtil.createGridLayout(2,false));
  final Label lblTargetVariable=new Label(composite2,SWT.PUSH);
  lblTargetVariable.setText(Resources.getMessage("String_Node_Str"));
  this.rocCombo=new Combo(composite2,SWT.READ_ONLY);
  this.rocCombo.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  this.rocCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      if (rocCombo.getSelectionIndex() >= 0) {
        String selectedTarget=rocCombo.getItem(rocCombo.getSelectionIndex());
        getModel().setSelectedAttribute(selectedTarget);
        List<String> classes=new ArrayList<>(originalRocCurves.get(selectedTarget).keySet());
        Collections.sort(classes);
        getModel().setSelectedClassValue(classes.get(0));
        updateOverviewSelection(selectedTarget);
        updateROCSelection(classes.get(0));
        getController().update(new ModelEvent(ViewStatisticsClassification.this,ModelPart.SELECTED_ATTRIBUTE,selectedTarget));
      }
    }
  }
);
  this.rocTable=SWTUtil.createTableDynamic(composite,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.FULL_SELECTION);
  this.rocTable.setHeaderVisible(true);
  this.rocTable.setLinesVisible(true);
  this.rocTable.setMenu(new ClipboardHandlerTable(rocTable).getMenu());
  this.rocTable.setLayoutData(SWTUtil.createFillGridData(2));
  String[] columns=getColumnHeadersForAUCTable();
  String width=String.valueOf(Math.round(100d / ((double)(getTarget() == ModelPart.OUTPUT ? 4 : 3)) * 100d) / 100d) + "String_Node_Str";
  DynamicTableColumn c=new DynamicTableColumn(rocTable,SWT.LEFT);
  c.setWidth(width,"String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  for (  String column : columns) {
    c=new DynamicTableColumn(rocTable,SWT.LEFT);
    SWTUtil.createColumnWithBarCharts(rocTable,c);
    c.setWidth(width,"String_Node_Str");
    c.setText(column);
  }
  for (  final TableColumn col : performancePerTargetTable.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(performancePerTargetTable);
  resetChart();
  this.rocSash.setWeights(new int[]{2,2});
  final StringBuilder builder=new StringBuilder();
  this.rocSash.addListener(SWT.MouseMove,new Listener(){
    @Override public void handleEvent(    Event event){
      if (rocChart != null) {
        IAxisSet axisSet=rocChart.getAxisSet();
        if (axisSet != null) {
          IAxis xAxis=axisSet.getXAxis(0);
          IAxis yAxis=axisSet.getYAxis(0);
          if (xAxis != null && yAxis != null) {
            Point cursor=rocChart.getPlotArea().toControl(Display.getCurrent().getCursorLocation());
            if (cursor.x >= 0 && cursor.x < rocChart.getPlotArea().getSize().x && cursor.y >= 0 && cursor.y < rocChart.getPlotArea().getSize().y) {
              ISeries[] data=rocChart.getSeriesSet().getSeries();
              if (data != null && data.length > 0) {
                double[] x=data[0].getXSeries();
                double[] y=data[0].getYSeries();
                int index=getIndex(x,xAxis.getDataCoordinate(cursor.x));
                if (index >= 0) {
                  builder.setLength(0);
                  builder.append("String_Node_Str");
                  builder.append(Resources.getMessage("String_Node_Str")).append("String_Node_Str");
                  builder.append(SWTUtil.getPrettyString(x[index])).append("String_Node_Str");
                  builder.append(Resources.getMessage("String_Node_Str")).append("String_Node_Str");
                  builder.append(SWTUtil.getPrettyString(y[index]));
                  builder.append("String_Node_Str");
                  rocSash.setToolTipText(builder.toString());
                  return;
                }
              }
            }
          }
        }
        rocSash.setToolTipText(null);
      }
    }
  }
);
  rocTable.addListener(SWT.MouseDown,new Listener(){
    public void handleEvent(    Event event){
      Rectangle clientArea=rocTable.getClientArea();
      Point pt=new Point(event.x,event.y);
      int index=rocTable.getTopIndex();
      while (index < rocTable.getItemCount()) {
        boolean visible=false;
        TableItem item=rocTable.getItem(index);
        for (int i=0; i < rocTable.getColumnCount(); i++) {
          Rectangle rect=item.getBounds(i);
          if (rect.contains(pt)) {
            if (item.getData() != null) {
              rocSetChartSeries((ROCCurve[])item.getData());
            }
            getModel().setSelectedClassValue(item.getText(0));
            getController().update(new ModelEvent(ViewStatisticsClassification.this,ModelPart.SELECTED_CLASS_VALUE,item.getText(0)));
            return;
          }
          if (!visible && rect.intersects(clientArea)) {
            visible=true;
          }
        }
        if (!visible)         return;
        index++;
      }
    }
  }
);
  return this.rocRoot;
}

Fixed version (ground truth):
/** 
 * Creates control for ROC curves
 * @param parent
 * @return
 */
private Control createROCControl(Composite parent){
  this.rocRoot=parent;
  this.rocRoot.setLayout(new FillLayout());
  this.rocSash=new SashForm(this.rocRoot,SWT.VERTICAL);
  final Composite composite=new Composite(this.rocSash,SWT.NONE);
  composite.setLayout(SWTUtil.createGridLayout(1));
  final Composite composite2=new Composite(composite,SWT.NONE);
  composite2.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  composite2.setLayout(SWTUtil.createGridLayout(2,false));
  final Label lblTargetVariable=new Label(composite2,SWT.PUSH);
  lblTargetVariable.setText(Resources.getMessage("String_Node_Str"));
  this.rocCombo=new Combo(composite2,SWT.READ_ONLY);
  this.rocCombo.setLayoutData(SWTUtil.createFillHorizontallyGridData());
  this.rocCombo.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      if (rocCombo.getSelectionIndex() >= 0) {
        String selectedTarget=rocCombo.getItem(rocCombo.getSelectionIndex());
        getModel().setSelectedAttribute(selectedTarget);
        List<String> classes=new ArrayList<>(originalRocCurves.get(selectedTarget).keySet());
        Collections.sort(classes);
        getModel().setSelectedClassValue(classes.get(0));
        updateOverviewSelection(selectedTarget);
        updateROCSelection(classes.get(0));
        getController().update(new ModelEvent(ViewStatisticsClassification.this,ModelPart.SELECTED_ATTRIBUTE,selectedTarget));
      }
    }
  }
);
  this.rocTable=SWTUtil.createTableDynamic(composite,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL| SWT.FULL_SELECTION);
  this.rocTable.setHeaderVisible(true);
  this.rocTable.setLinesVisible(true);
  this.rocTable.setMenu(new ClipboardHandlerTable(rocTable).getMenu());
  this.rocTable.setLayoutData(SWTUtil.createFillGridData(2));
  String[] columns=getColumnHeadersForAUCTable();
  String width=String.valueOf(Math.round(100d / ((double)(getTarget() == ModelPart.OUTPUT ? 4 : 3)) * 100d) / 100d) + "String_Node_Str";
  DynamicTableColumn c=new DynamicTableColumn(rocTable,SWT.LEFT);
  c.setWidth(width,"String_Node_Str");
  c.setText(Resources.getMessage("String_Node_Str"));
  for (  String column : columns) {
    c=new DynamicTableColumn(rocTable,SWT.LEFT);
    SWTUtil.createColumnWithBarCharts(rocTable,c);
    c.setWidth(width,"String_Node_Str");
    c.setText(column);
  }
  for (  final TableColumn col : performanceTableOverview.getColumns()) {
    col.pack();
  }
  SWTUtil.createGenericTooltip(performanceTableOverview);
  resetChart();
  this.rocSash.setWeights(new int[]{2,2});
  final StringBuilder builder=new StringBuilder();
  this.rocSash.addListener(SWT.MouseMove,new Listener(){
    @Override public void handleEvent(    Event event){
      if (rocChart != null) {
        IAxisSet axisSet=rocChart.getAxisSet();
        if (axisSet != null) {
          IAxis xAxis=axisSet.getXAxis(0);
          IAxis yAxis=axisSet.getYAxis(0);
          if (xAxis != null && yAxis != null) {
            Point cursor=rocChart.getPlotArea().toControl(Display.getCurrent().getCursorLocation());
            if (cursor.x >= 0 && cursor.x < rocChart.getPlotArea().getSize().x && cursor.y >= 0 && cursor.y < rocChart.getPlotArea().getSize().y) {
              ISeries[] data=rocChart.getSeriesSet().getSeries();
              if (data != null && data.length > 0) {
                double[] x=data[0].getXSeries();
                double[] y=data[0].getYSeries();
                int index=getIndex(x,xAxis.getDataCoordinate(cursor.x));
                if (index >= 0) {
                  builder.setLength(0);
                  builder.append("String_Node_Str");
                  builder.append(Resources.getMessage("String_Node_Str")).append("String_Node_Str");
                  builder.append(SWTUtil.getPrettyString(x[index])).append("String_Node_Str");
                  builder.append(Resources.getMessage("String_Node_Str")).append("String_Node_Str");
                  builder.append(SWTUtil.getPrettyString(y[index]));
                  builder.append("String_Node_Str");
                  rocSash.setToolTipText(builder.toString());
                  return;
                }
              }
            }
          }
        }
        rocSash.setToolTipText(null);
      }
    }
  }
);
  rocTable.addListener(SWT.MouseDown,new Listener(){
    public void handleEvent(    Event event){
      Rectangle clientArea=rocTable.getClientArea();
      Point pt=new Point(event.x,event.y);
      int index=rocTable.getTopIndex();
      while (index < rocTable.getItemCount()) {
        boolean visible=false;
        TableItem item=rocTable.getItem(index);
        for (int i=0; i < rocTable.getColumnCount(); i++) {
          Rectangle rect=item.getBounds(i);
          if (rect.contains(pt)) {
            if (item.getData() != null) {
              rocSetChartSeries((ROCCurve[])item.getData());
            }
            getModel().setSelectedClassValue(item.getText(0));
            getController().update(new ModelEvent(ViewStatisticsClassification.this,ModelPart.SELECTED_CLASS_VALUE,item.getText(0)));
            return;
          }
          if (!visible && rect.intersects(clientArea)) {
            visible=true;
          }
        }
        if (!visible)         return;
        index++;
      }
    }
  }
);
  return this.rocRoot;
}