Program: 124964
Project: 124964
Buggy source:
@Override protected void removeTable(){
  CommandStack commandStack=graphicViewer.getEditDomain().getCommandStack();
  commandStack.execute(new Command(){
    @Override public void execute(){
      PigMapOutputTablePart currentSelectedOutputTable=graphicViewer.getFiguresManager().getCurrentSelectedOutputTable();
      if (currentSelectedOutputTable != null) {
        OutputTable outputTable=(OutputTable)currentSelectedOutputTable.getModel();
        int indexOf=externalPart.getModelChildren().indexOf(outputTable);
        mapperComponent.getProcess().removeUniqueConnectionName(outputTable.getName());
        removeMetadataTableByName(outputTable.getName());
        for (        TableNode tableNode : outputTable.getNodes()) {
          PigMapUtil.detachConnectionsSouce(tableNode,externalData);
        }
        externalData.getOutputTables().remove(outputTable);
        PigMapUtil.detachFilterSource(outputTable,externalData);
        indexOf=indexOf - 1;
        if (indexOf > -1 && (EditPart)externalPart.getChildren().get(indexOf) instanceof PigMapOutputTablePart) {
          graphicViewer.select((EditPart)externalPart.getChildren().get(indexOf));
        }
 else         if (indexOf > -1 && indexOf + 1 < externalPart.getChildren().size() && (EditPart)externalPart.getChildren().get(indexOf + 1) instanceof PigMapOutputTablePart) {
          graphicViewer.select((EditPart)externalPart.getChildren().get(indexOf + 1));
        }
 else {
          mapperManger.getMapperUI().getTabFolderEditors().getOutputMetaEditorView().setMetadataTableEditor(null);
        }
        mapperManger.getMapperUI().updateStatusBar();
      }
      if (externalData.getOutputTables().isEmpty() && min_size.isEnabled()) {
        min_size.setEnabled(false);
      }
    }
  }
);
}

Fixed version (ground truth):
@Override protected void removeTable(){
  CommandStack commandStack=graphicViewer.getEditDomain().getCommandStack();
  commandStack.execute(new Command(){
    @Override public void execute(){
      PigMapOutputTablePart currentSelectedOutputTable=graphicViewer.getFiguresManager().getCurrentSelectedOutputTable();
      if (currentSelectedOutputTable != null) {
        OutputTable outputTable=(OutputTable)currentSelectedOutputTable.getModel();
        int indexOf=externalPart.getModelChildren().indexOf(outputTable);
        mapperComponent.getProcess().removeUniqueConnectionName(outputTable.getName());
        removeMetadataTableByName(outputTable.getName());
        for (        TableNode tableNode : outputTable.getNodes()) {
          PigMapUtil.detachConnectionsSouce(tableNode,externalData);
        }
        externalData.getOutputTables().remove(outputTable);
        PigMapUtil.detachFilterSource(outputTable,externalData);
        indexOf=indexOf - 1;
        if (indexOf > -1 && (EditPart)externalPart.getChildren().get(indexOf) instanceof PigMapOutputTablePart) {
          graphicViewer.select((EditPart)externalPart.getChildren().get(indexOf));
        }
 else         if (indexOf > -1 && indexOf + 1 < externalPart.getChildren().size() && (EditPart)externalPart.getChildren().get(indexOf + 1) instanceof PigMapOutputTablePart) {
          graphicViewer.select((EditPart)externalPart.getChildren().get(indexOf + 1));
        }
 else {
          mapperManger.getMapperUI().getTabFolderEditors().getOutputMetaEditorView().setMetadataTableEditor(null);
        }
        mapperManger.getMapperUI().updateStatusBar();
      }
      if (externalData.getOutputTables().isEmpty() && min_size.isEnabled()) {
        min_size.setEnabled(false);
      }
      if (externalData.getOutputTables().isEmpty() || externalData.getInputTables().isEmpty()) {
        auto_map.setEnabled(false);
      }
    }
  }
);
}