Program: 124963
Project: 124963
Buggy source:
@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 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);
  }
}