Program: 56716
Project: 56716
Buggy source:
private void buildTable(MatrixBasedBodyDataProvider bodyDataProvider,ColumnHeaderDataProvider columnDataProvider,LineNumberRowHeaderDataProvider rowDataProvider,final boolean areRowsMoveable){
  final DataLayer bodyDataLayer=new DataLayer(bodyDataProvider,120,36);
  bodyDataLayer.addLayerListener(this);
  selectionLayer=new SelectionLayer(bodyDataLayer);
  selectionLayer.addLayerListener(this);
  ViewportLayer bodyLayer=new ViewportLayer(selectionLayer);
  final DataLayer columnDataLayer=new DataLayer(columnDataProvider,120,25);
  ColumnHeaderLayer columnHeaderLayer=new ColumnHeaderLayer(columnDataLayer,bodyLayer,selectionLayer);
  DataLayer rowDataLayer=new DataLayer(rowDataProvider,80,36);
  RowHeaderLayer rowHeaderLayer=new RowHeaderLayer(rowDataLayer,bodyLayer,selectionLayer);
  DefaultCornerDataProvider cornerDataProvider=new DefaultCornerDataProvider(columnDataProvider,rowDataProvider);
  CornerLayer cornerLayer=new CornerLayer(new DataLayer(cornerDataProvider),rowHeaderLayer,columnHeaderLayer);
  GridLayer gridLayer=new GridLayer(bodyLayer,columnHeaderLayer,rowHeaderLayer,cornerLayer);
  if (table == null) {
    table=new NatTable(parent,gridLayer,false);
  }
 else {
    table.setLayer(gridLayer);
  }
  table.setLayoutData(layoutData);
  NatTableUtil.applyDefaultNatTableStyling(table);
  ColumnOverrideLabelAccumulator acc=new ColumnOverrideLabelAccumulator(bodyDataLayer);
  bodyDataLayer.setConfigLabelAccumulator(acc);
  acc.registerColumnOverrides(0,NON_EDITABLE);
  acc.registerColumnOverrides(1,NON_EDITABLE);
  acc.registerColumnOverrides(2,EDITABLE);
  acc.registerColumnOverrides(3,"String_Node_Str");
  final ColorCellPainter colorCellPainter=new ColorCellPainter();
  final ICellPainter upImagePainter=new ImagePainter(GeneralManager.get().getResourceLoader().getImage(parent.getDisplay(),"String_Node_Str"));
  final ICellPainter downImagePainter=new ImagePainter(GeneralManager.get().getResourceLoader().getImage(parent.getDisplay(),"String_Node_Str"));
  final ICellPainter upPainter=new BeveledBorderDecorator(upImagePainter);
  final ICellPainter downPainter=new BeveledBorderDecorator(downImagePainter);
  final ICellPainter rowHeaderPainter=new CellPainterDecorator(new TextPainter(),CellEdgeEnum.LEFT,new CellPainterDecorator(upPainter,CellEdgeEnum.BOTTOM,downPainter));
  table.addConfiguration(new AbstractRegistryConfiguration(){
    @Override public void configureRegistry(    IConfigRegistry configRegistry){
      configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE,IEditableRule.ALWAYS_EDITABLE,DisplayMode.EDIT,EDITABLE);
      configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,colorCellPainter,DisplayMode.NORMAL,"String_Node_Str");
      if (areRowsMoveable) {
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,rowHeaderPainter,DisplayMode.NORMAL,GridRegion.ROW_HEADER);
      }
 else {
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,new TextPainter(),DisplayMode.NORMAL,GridRegion.ROW_HEADER);
      }
      Style cellStyle=new Style();
      cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,GUIHelper.COLOR_WIDGET_NORMAL_SHADOW);
      configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,cellStyle,DisplayMode.NORMAL,NON_EDITABLE);
    }
    @Override public void configureUiBindings(    UiBindingRegistry uiBindingRegistry){
      uiBindingRegistry.registerDoubleClickBinding(new CellPainterMouseEventMatcher(GridRegion.BODY,MouseEventMatcher.LEFT_BUTTON,colorCellPainter),new ChangeColorAction());
      if (areRowsMoveable) {
        IMouseAction moveUp=new IMouseAction(){
          @Override public void run(          NatTable natTable,          MouseEvent event){
            int rowIndex=natTable.getRowPositionByY(event.y) - 1;
            if (rowIndex > 0) {
              swapRows(rowIndex,rowIndex - 1);
              update();
              selectRow(rowIndex - 1);
            }
          }
        }
;
        IMouseAction moveDown=new IMouseAction(){
          @Override public void run(          NatTable natTable,          MouseEvent event){
            int rowIndex=natTable.getRowPositionByY(event.y) - 1;
            if (rowIndex != -1 && rowIndex < getRowCount() - 1) {
              swapRows(rowIndex,rowIndex + 1);
              update();
              selectRow(rowIndex + 1);
            }
          }
        }
;
        uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.ROW_HEADER,MouseEventMatcher.LEFT_BUTTON,upPainter),moveUp);
        uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.ROW_HEADER,MouseEventMatcher.LEFT_BUTTON,downPainter),moveDown);
        uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.ROW_HEADER,MouseEventMatcher.LEFT_BUTTON,upImagePainter),moveUp);
        uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.ROW_HEADER,MouseEventMatcher.LEFT_BUTTON,downImagePainter),moveDown);
      }
    }
  }
);
  table.addDisposeListener(this);
  table.configure();
}

Fixed version (ground truth):
private void buildTable(MatrixBasedBodyDataProvider bodyDataProvider,ColumnHeaderDataProvider columnDataProvider,LineNumberRowHeaderDataProvider rowDataProvider,final boolean areRowsMoveable){
  final DataLayer bodyDataLayer=new DataLayer(bodyDataProvider,120,36);
  bodyDataLayer.addLayerListener(this);
  selectionLayer=new SelectionLayer(bodyDataLayer);
  selectionLayer.addLayerListener(this);
  ViewportLayer bodyLayer=new ViewportLayer(selectionLayer);
  final DataLayer columnDataLayer=new DataLayer(columnDataProvider,120,25);
  ColumnHeaderLayer columnHeaderLayer=new ColumnHeaderLayer(columnDataLayer,bodyLayer,selectionLayer);
  DataLayer rowDataLayer=new DataLayer(rowDataProvider,80,36);
  RowHeaderLayer rowHeaderLayer=new RowHeaderLayer(rowDataLayer,bodyLayer,selectionLayer);
  DefaultCornerDataProvider cornerDataProvider=new DefaultCornerDataProvider(columnDataProvider,rowDataProvider);
  CornerLayer cornerLayer=new CornerLayer(new DataLayer(cornerDataProvider),rowHeaderLayer,columnHeaderLayer);
  GridLayer gridLayer=new GridLayer(bodyLayer,columnHeaderLayer,rowHeaderLayer,cornerLayer);
  if (table == null) {
    table=new NatTable(parent,gridLayer,false);
  }
 else {
    table.setLayer(gridLayer);
  }
  table.setLayoutData(layoutData);
  NatTableUtil.applyDefaultNatTableStyling(table);
  ColumnOverrideLabelAccumulator acc=new ColumnOverrideLabelAccumulator(bodyDataLayer);
  bodyDataLayer.setConfigLabelAccumulator(acc);
  acc.registerColumnOverrides(0,NON_EDITABLE);
  acc.registerColumnOverrides(1,NON_EDITABLE);
  acc.registerColumnOverrides(2,EDITABLE);
  acc.registerColumnOverrides(3,"String_Node_Str");
  final ColorCellPainter colorCellPainter=new ColorCellPainter();
  final ICellPainter upImagePainter=new ImagePainter(GeneralManager.get().getResourceLoader().getImage(parent.getDisplay(),"String_Node_Str"));
  final ICellPainter downImagePainter=new ImagePainter(GeneralManager.get().getResourceLoader().getImage(parent.getDisplay(),"String_Node_Str"));
  final ICellPainter upPainter=new BeveledBorderDecorator(upImagePainter);
  final ICellPainter downPainter=new BeveledBorderDecorator(downImagePainter);
  final ICellPainter rowHeaderPainter=new CellPainterDecorator(new TextPainter(),CellEdgeEnum.LEFT,new CellPainterDecorator(upPainter,CellEdgeEnum.BOTTOM,downPainter));
  table.addConfiguration(new AbstractRegistryConfiguration(){
    @Override public void configureRegistry(    IConfigRegistry configRegistry){
      configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE,IEditableRule.ALWAYS_EDITABLE,DisplayMode.EDIT,EDITABLE);
      configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,colorCellPainter,DisplayMode.NORMAL,"String_Node_Str");
      if (areRowsMoveable) {
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,rowHeaderPainter,DisplayMode.NORMAL,GridRegion.ROW_HEADER);
      }
 else {
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,new TextPainter(),DisplayMode.NORMAL,GridRegion.ROW_HEADER);
      }
      Style cellStyle=new Style();
      cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR,GUIHelper.COLOR_WIDGET_NORMAL_SHADOW);
      configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE,cellStyle,DisplayMode.NORMAL,NON_EDITABLE);
    }
    @Override public void configureUiBindings(    UiBindingRegistry uiBindingRegistry){
      uiBindingRegistry.registerDoubleClickBinding(new CellPainterMouseEventMatcher(GridRegion.BODY,MouseEventMatcher.LEFT_BUTTON,colorCellPainter),new ChangeColorAction());
      if (areRowsMoveable) {
        IMouseAction moveUp=new IMouseAction(){
          @Override public void run(          NatTable natTable,          MouseEvent event){
            int rowIndex=natTable.getRowIndexByPosition(natTable.getRowPositionByY(event.y));
            if (rowIndex > 0) {
              swapRows(rowIndex,rowIndex - 1);
              update();
              selectRow(rowIndex - 1);
            }
          }
        }
;
        IMouseAction moveDown=new IMouseAction(){
          @Override public void run(          NatTable natTable,          MouseEvent event){
            int rowIndex=natTable.getRowIndexByPosition(natTable.getRowPositionByY(event.y));
            if (rowIndex != -1 && rowIndex < getRowCount() - 1) {
              swapRows(rowIndex,rowIndex + 1);
              update();
              selectRow(rowIndex + 1);
            }
          }
        }
;
        uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.ROW_HEADER,MouseEventMatcher.LEFT_BUTTON,upPainter),moveUp);
        uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.ROW_HEADER,MouseEventMatcher.LEFT_BUTTON,downPainter),moveDown);
        uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.ROW_HEADER,MouseEventMatcher.LEFT_BUTTON,upImagePainter),moveUp);
        uiBindingRegistry.registerFirstSingleClickBinding(new CellPainterMouseEventMatcher(GridRegion.ROW_HEADER,MouseEventMatcher.LEFT_BUTTON,downImagePainter),moveDown);
      }
    }
  }
);
  table.addDisposeListener(this);
  table.configure();
}