Program: 107966
Project: 107966
Buggy source:
/** 
 * Creates a new instance.
 * @param parent
 * @param controller
 */
public LayoutUtility(final Composite parent,final Controller controller){
  centerSash=new SashForm(parent,SWT.VERTICAL);
  centerSash.setLayoutData(SWTUtil.createFillGridData());
  final Composite center=new Composite(centerSash,SWT.NONE);
  center.setLayoutData(SWTUtil.createFillGridData());
  center.setLayout(SWTUtil.createGridLayoutWithEqualWidth(2));
  centerLeft=new Composite(center,SWT.NONE);
  centerLeft.setLayoutData(SWTUtil.createFillGridData());
  centerLeft.setLayout(SWTUtil.createGridLayout(1));
  centerRight=new Composite(center,SWT.NONE);
  centerRight.setLayoutData(SWTUtil.createFillGridData());
  centerRight.setLayout(SWTUtil.createGridLayout(1));
  dataInputView=new ViewDataInput(centerLeft,controller,"String_Node_Str");
  dataOutputView=new ViewDataOutput(centerRight,controller,"String_Node_Str");
  dataInputView.addScrollBarListener(new Listener(){
    @Override public void handleEvent(    final Event arg0){
      PixelCoordinate coordinate=dataInputView.getViewportLayer().getOrigin();
      final int row=coordinate.getY();
      final int col=coordinate.getX();
      if (dataOutputView != null) {
        dataOutputView.getViewportLayer().setOriginY(row);
        dataOutputView.getViewportLayer().setOriginX(col);
        synchronize(dataInputView,dataOutputView);
      }
    }
  }
);
  dataOutputView.addScrollBarListener(new Listener(){
    @Override public void handleEvent(    final Event arg0){
      PixelCoordinate coordinate=dataOutputView.getViewportLayer().getOrigin();
      final int row=coordinate.getY();
      final int col=coordinate.getX();
      if (dataInputView != null) {
        dataInputView.getViewportLayer().setOriginY(row);
        dataInputView.getViewportLayer().setOriginX(col);
        synchronize(dataOutputView,dataInputView);
      }
    }
  }
);
  Composite classificationInput=dataInputView.createAdditionalItem(Resources.getMessage("String_Node_Str"),"String_Node_Str");
  classificationInput.setLayout(new FillLayout());
  new ViewStatisticsLogisticRegressionInput(classificationInput,controller);
  Composite classificationOutput=dataOutputView.createAdditionalItem(Resources.getMessage("String_Node_Str"),"String_Node_Str");
  classificationOutput.setLayout(new FillLayout());
  new ViewStatisticsLogisticRegressionOutput(classificationOutput,controller);
  final Composite compositeBottom=new Composite(centerSash,SWT.NONE);
  compositeBottom.setLayout(new FillLayout());
  final SashForm bottomSash=new SashForm(compositeBottom,SWT.HORIZONTAL | SWT.SMOOTH);
  bottomLeft=new Composite(bottomSash,SWT.NONE);
  bottomLeft.setLayout(new FillLayout());
  bottomRight=new Composite(bottomSash,SWT.NONE);
  bottomRight.setLayout(new FillLayout());
  statisticsInputLayout=new LayoutUtilityStatistics(bottomLeft,controller,ModelPart.INPUT,null);
  statisticsOutputLayout=new LayoutUtilityStatistics(bottomRight,controller,ModelPart.OUTPUT,ModelPart.INPUT);
  dataInputView.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      dataOutputView.setSelectionIndex(dataInputView.getSelectionIndex());
      if (dataInputView.getSelectionIndex() == 1) {
        statisticsInputLayout.setSelectedView(ViewUtilityType.CLASSIFICATION);
        statisticsOutputLayout.setSelectedView(ViewUtilityType.CLASSIFICATION);
      }
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  dataOutputView.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      dataInputView.setSelectionIndex(dataOutputView.getSelectionIndex());
      if (dataOutputView.getSelectionIndex() == 1) {
        statisticsInputLayout.setSelectedView(ViewUtilityType.CLASSIFICATION);
        statisticsOutputLayout.setSelectedView(ViewUtilityType.CLASSIFICATION);
      }
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  statisticsInputLayout.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      statisticsOutputLayout.setSelectedView(statisticsInputLayout.getSelectedView());
      if (statisticsInputLayout.getSelectedView() == ViewUtilityType.CLASSIFICATION) {
        dataOutputView.setSelectionIndex(1);
        dataInputView.setSelectionIndex(1);
      }
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  statisticsOutputLayout.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      statisticsInputLayout.setSelectedView(statisticsOutputLayout.getSelectedView());
      if (statisticsOutputLayout.getSelectedView() == ViewUtilityType.CLASSIFICATION) {
        dataOutputView.setSelectionIndex(1);
        dataInputView.setSelectionIndex(1);
      }
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  statisticsInputLayout.setItemVisibilityListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      statisticsOutputLayout.setVisibleItems(statisticsInputLayout.getVisibleItems());
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  statisticsOutputLayout.setItemVisibilityListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      statisticsInputLayout.setVisibleItems(statisticsOutputLayout.getVisibleItems());
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  centerSash.setWeights(new int[]{WEIGHT_TOP,WEIGHT_BOTTOM});
  bottomSash.setWeights(new int[]{WEIGHT_LEFT,WEIGHT_RIGHT});
}

Fixed version (ground truth):
/** 
 * Creates a new instance.
 * @param parent
 * @param controller
 */
public LayoutUtility(final Composite parent,final Controller controller){
  centerSash=new SashForm(parent,SWT.VERTICAL);
  centerSash.setLayoutData(SWTUtil.createFillGridData());
  final Composite center=new Composite(centerSash,SWT.NONE);
  center.setLayoutData(SWTUtil.createFillGridData());
  center.setLayout(SWTUtil.createGridLayoutWithEqualWidth(2));
  centerLeft=new Composite(center,SWT.NONE);
  centerLeft.setLayoutData(SWTUtil.createFillGridData());
  centerLeft.setLayout(SWTUtil.createGridLayout(1));
  centerRight=new Composite(center,SWT.NONE);
  centerRight.setLayoutData(SWTUtil.createFillGridData());
  centerRight.setLayout(SWTUtil.createGridLayout(1));
  dataInputView=new ViewDataInput(centerLeft,controller,"String_Node_Str");
  dataOutputView=new ViewDataOutput(centerRight,controller,"String_Node_Str");
  dataInputView.addScrollBarListener(new Listener(){
    @Override public void handleEvent(    final Event arg0){
      PixelCoordinate coordinate=dataInputView.getViewportLayer().getOrigin();
      final int row=coordinate.getY();
      final int col=coordinate.getX();
      if (dataOutputView != null) {
        dataOutputView.getViewportLayer().setOriginY(row);
        dataOutputView.getViewportLayer().setOriginX(col);
        synchronize(dataInputView,dataOutputView);
      }
    }
  }
);
  dataOutputView.addScrollBarListener(new Listener(){
    @Override public void handleEvent(    final Event arg0){
      PixelCoordinate coordinate=dataOutputView.getViewportLayer().getOrigin();
      final int row=coordinate.getY();
      final int col=coordinate.getX();
      if (dataInputView != null) {
        dataInputView.getViewportLayer().setOriginY(row);
        dataInputView.getViewportLayer().setOriginX(col);
        synchronize(dataOutputView,dataInputView);
      }
    }
  }
);
  Composite classificationInput=dataInputView.createAdditionalItem(Resources.getMessage("String_Node_Str"),"String_Node_Str");
  classificationInput.setLayout(new FillLayout());
  new ViewStatisticsLogisticRegressionInput(classificationInput,controller);
  Composite classificationOutput=dataOutputView.createAdditionalItem(Resources.getMessage("String_Node_Str"),"String_Node_Str");
  classificationOutput.setLayout(new FillLayout());
  new ViewStatisticsLogisticRegressionOutput(classificationOutput,controller);
  final Composite compositeBottom=new Composite(centerSash,SWT.NONE);
  compositeBottom.setLayout(new FillLayout());
  final SashForm bottomSash=new SashForm(compositeBottom,SWT.HORIZONTAL | SWT.SMOOTH);
  bottomLeft=new Composite(bottomSash,SWT.NONE);
  bottomLeft.setLayout(new FillLayout());
  bottomRight=new Composite(bottomSash,SWT.NONE);
  bottomRight.setLayout(new FillLayout());
  statisticsInputLayout=new LayoutUtilityStatistics(bottomLeft,controller,ModelPart.INPUT,null);
  statisticsOutputLayout=new LayoutUtilityStatistics(bottomRight,controller,ModelPart.OUTPUT,ModelPart.INPUT);
  dataInputView.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      dataOutputView.setSelectionIndex(dataInputView.getSelectionIndex());
      if (dataInputView.getSelectionIndex() == 1) {
        statisticsInputLayout.setSelectedView(ViewUtilityType.CLASSIFICATION);
        statisticsOutputLayout.setSelectedView(ViewUtilityType.CLASSIFICATION);
      }
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  dataOutputView.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      dataInputView.setSelectionIndex(dataOutputView.getSelectionIndex());
      if (dataOutputView.getSelectionIndex() == 1) {
        statisticsInputLayout.setSelectedView(ViewUtilityType.CLASSIFICATION);
        statisticsOutputLayout.setSelectedView(ViewUtilityType.CLASSIFICATION);
      }
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  statisticsInputLayout.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      statisticsOutputLayout.setSelectedView(statisticsInputLayout.getSelectedView());
      if (statisticsInputLayout.getSelectedView() == ViewUtilityType.CLASSIFICATION) {
        dataOutputView.setSelectionIndex(1);
        dataInputView.setSelectionIndex(1);
      }
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  statisticsOutputLayout.addSelectionListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      statisticsInputLayout.setSelectedView(statisticsOutputLayout.getSelectedView());
      if (statisticsOutputLayout.getSelectedView() == ViewUtilityType.CLASSIFICATION) {
        dataOutputView.setSelectionIndex(1);
        dataInputView.setSelectionIndex(1);
      }
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  statisticsInputLayout.setItemVisibilityListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      statisticsOutputLayout.setVisibleItems(statisticsInputLayout.getVisibleItems());
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  statisticsOutputLayout.setItemVisibilityListener(new SelectionAdapter(){
    @Override public void widgetSelected(    final SelectionEvent arg0){
      statisticsInputLayout.setVisibleItems(statisticsOutputLayout.getVisibleItems());
      controller.update(new ModelEvent(this,ModelPart.SELECTED_UTILITY_VISUALIZATION,null));
    }
  }
);
  centerSash.setWeights(new int[]{WEIGHT_TOP,WEIGHT_BOTTOM});
  bottomSash.setWeights(new int[]{WEIGHT_LEFT,WEIGHT_RIGHT});
  SWTUtil.fixOSXSashBug(centerSash);
  SWTUtil.fixOSXSashBug(bottomSash);
}