nus-yam/ex-repair huggingface dataset:
Program: 57490
Project: 57490
Buggy source:
private void updateScoredTablePerspectives(){
  tablePerspectives.clear();
  for (  Button dataDomainButton : dataDomainButtons) {
    if (!dataDomainButton.isSelected())     continue;
    ATableBasedDataDomain dataDomain=(ATableBasedDataDomain)DataDomainManager.get().getDataDomainByID(dataDomainButton.getPickingType());
    if (dataDomain.getLabel().contains("String_Node_Str") || dataDomain.getLabel().contains("String_Node_Str")) {
      tablePerspectives.addAll(dataDomain.getAllTablePerspectives());
    }
 else {
      String dimensionPerspectiveID=(String)dataDomain.getDimensionPerspectiveIDs().toArray()[0];
      Set<String> rowIDs=dataDomain.getRecordPerspectiveIDs();
      for (      String id : rowIDs) {
        boolean existsAlready=false;
        if (dataDomain.hasTablePerspective(id,dimensionPerspectiveID))         existsAlready=true;
        TablePerspective newTablePerspective=dataDomain.getTablePerspective(id,dimensionPerspectiveID);
        if (!existsAlready)         newTablePerspective.setPrivate(true);
        if (referenceTablePerspective == newTablePerspective || referenceBrickColumn.getTablePerspective() == newTablePerspective)         continue;
        tablePerspectives.add(newTablePerspective);
      }
    }
  }
}

Fixed version (ground truth):
private void updateScoredTablePerspectives(){
  tablePerspectives.clear();
  for (  Button dataDomainButton : dataDomainButtons) {
    if (!dataDomainButton.isSelected())     continue;
    ATableBasedDataDomain dataDomain=(ATableBasedDataDomain)DataDomainManager.get().getDataDomainByID(dataDomainButton.getPickingType());
    if (dataDomain.getLabel().contains("String_Node_Str") || dataDomain.getLabel().contains("String_Node_Str")) {
      tablePerspectives.addAll(dataDomain.getAllTablePerspectives());
    }
 else {
      String dimensionPerspectiveID=(String)dataDomain.getDimensionPerspectiveIDs().toArray()[0];
      Set<String> rowPerspectiveIDs=dataDomain.getRecordPerspectiveIDs();
      for (      String rowPerspectiveID : rowPerspectiveIDs) {
        boolean existsAlready=false;
        if (dataDomain.hasTablePerspective(rowPerspectiveID,dimensionPerspectiveID))         existsAlready=true;
        TablePerspective newTablePerspective=dataDomain.getTablePerspective(rowPerspectiveID,dimensionPerspectiveID);
        if (!existsAlready)         newTablePerspective.setPrivate(true);
        if (referenceTablePerspective == newTablePerspective || referenceBrickColumn.getTablePerspective() == newTablePerspective)         continue;
        tablePerspectives.add(newTablePerspective);
      }
    }
  }
}
Program: 57492
Project: 57492
Buggy source:
@Override public void display(GL2 gl){
  if (!uninitializedSubViews.isEmpty()) {
    while (uninitializedSubViews.peek() != null) {
      uninitializedSubViews.poll().initRemote(gl,this,glMouseListener);
    }
    initLayouts();
  }
  if (isDisplayListDirty) {
    buildDisplayList(gl,displayListIndex);
    isDisplayListDirty=false;
  }
  vendingMachine.processEvents();
  for (  BrickColumn group : brickColumnManager.getBrickColumns()) {
    group.processEvents();
  }
  handleHorizontalColumnMove(gl);
  if (isLayoutDirty) {
    isLayoutDirty=false;
    layoutManager.updateLayout();
    float minWidth=pixelGLConverter.getGLWidthForPixelWidth(BRICK_COLUMN_SPACING_MIN_PIXEL_WIDTH);
    for (    ElementLayout layout : centerRowLayout) {
      if (!(layout.getRenderer() instanceof BrickColumnSpacingRenderer))       continue;
      if (resizeNecessary)       break;
      if (layout.getSizeScaledX() < minWidth - 0.01f) {
        resizeNecessary=true;
        break;
      }
    }
  }
  if (resizeNecessary) {
    resizeNecessary=false;
  }
  for (  BrickColumn dimensionGroup : brickColumnManager.getBrickColumns()) {
    dimensionGroup.display(gl);
  }
  if (isConnectionLinesDirty)   performConnectionLinesUpdate();
  layoutManager.render(gl);
  if (!isRightDetailShown && !isLeftDetailShown) {
    renderArch(gl);
  }
  dragAndDropController.handleDragging(gl,glMouseListener);
}

Fixed version (ground truth):
@Override public void display(GL2 gl){
  if (!uninitializedSubViews.isEmpty()) {
    while (uninitializedSubViews.peek() != null) {
      uninitializedSubViews.poll().initRemote(gl,this,glMouseListener);
    }
    initLayouts();
  }
  if (isDisplayListDirty) {
    buildDisplayList(gl,displayListIndex);
    isDisplayListDirty=false;
  }
  vendingMachine.processEvents();
  for (  BrickColumn group : brickColumnManager.getBrickColumns()) {
    group.processEvents();
  }
  handleHorizontalColumnMove(gl);
  if (isLayoutDirty) {
    isLayoutDirty=false;
    vendingMachine.updatLayout();
    layoutManager.updateLayout();
    float minWidth=pixelGLConverter.getGLWidthForPixelWidth(BRICK_COLUMN_SPACING_MIN_PIXEL_WIDTH);
    for (    ElementLayout layout : centerRowLayout) {
      if (!(layout.getRenderer() instanceof BrickColumnSpacingRenderer))       continue;
      if (resizeNecessary)       break;
      if (layout.getSizeScaledX() < minWidth - 0.01f) {
        resizeNecessary=true;
        break;
      }
    }
  }
  if (resizeNecessary) {
    resizeNecessary=false;
  }
  for (  BrickColumn dimensionGroup : brickColumnManager.getBrickColumns()) {
    dimensionGroup.display(gl);
  }
  if (isConnectionLinesDirty)   performConnectionLinesUpdate();
  layoutManager.render(gl);
  if (!isRightDetailShown && !isLeftDetailShown) {
    renderArch(gl);
  }
  dragAndDropController.handleDragging(gl,glMouseListener);
}
Program: 57493
Project: 57493
Buggy source:
public void initLayouts(){
  brickColumnManager.getBrickColumnSpacers().clear();
  mainRow.clear();
  initLeftLayout();
  initCenterLayout();
  initRightLayout();
  if (vendingMachine.isActive())   mainRow.append(vendingMachine.getLayout());
  layoutManager.updateLayout();
  updateConnectionLinesBetweenDimensionGroups();
}

Fixed version (ground truth):
public void initLayouts(){
  brickColumnManager.getBrickColumnSpacers().clear();
  mainRow.clear();
  initLeftLayout();
  initCenterLayout();
  initRightLayout();
  mainRow.append(vendingMachine.getLayout());
  layoutManager.updateLayout();
  updateConnectionLinesBetweenDimensionGroups();
}
Program: 57494
Project: 57494
Buggy source:
public void selectChoice(){
  scoreToTablePerspective.get(selectedTablePerspectiveIndex).getSecond().setPrivate(false);
  isActive=false;
  brickColumnManager.getBrickColumn(scoreToTablePerspective.get(selectedTablePerspectiveIndex).getSecond()).getLayout().clearBackgroundRenderers();
  brickColumnManager.getBrickColumn(referenceTablePerspective).getLayout().clearBackgroundRenderers();
  stratomex.initLayouts();
  stratomex.updateLayout();
  stratomex.setLayoutDirty();
}

Fixed version (ground truth):
public void selectChoice(){
  scoreToTablePerspective.get(selectedTablePerspectiveIndex).getSecond().setPrivate(false);
  isActive=false;
  brickColumnManager.getBrickColumn(scoreToTablePerspective.get(selectedTablePerspectiveIndex).getSecond()).getLayout().clearBackgroundRenderers();
  brickColumnManager.getBrickColumn(referenceTablePerspective).getLayout().clearBackgroundRenderers();
  stratomex.updateLayout();
  stratomex.setLayoutDirty();
}
Program: 57497
Project: 57497
Buggy source:
/** 
 * Method from http://eclipsenuggets.blogspot.com/2007/09/how-to-save-eclipse -ui-workbench-state_6644.html
 */
private IStatus saveState(final IMemento memento){
  MultiStatus result=new MultiStatus(PlatformUI.PLUGIN_ID,IStatus.OK,WorkbenchMessages.Workbench_problemsSaving,null);
  memento.putString(IWorkbenchConstants.TAG_VERSION,"String_Node_Str");
  memento.putInteger(IWorkbenchConstants.TAG_PROGRESS_COUNT,10);
  result.add(Status.OK_STATUS);
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow[] windows=workbench.getWorkbenchWindows();
  for (int nX=0; nX < windows.length; nX++) {
    WorkbenchWindow window=(WorkbenchWindow)windows[nX];
    IMemento childMem=memento.createChild(IWorkbenchConstants.TAG_WINDOW);
    result.merge(window.saveState(childMem));
  }
  result.add(((Workbench)workbench).getEditorHistory().saveState(memento.createChild(IWorkbenchConstants.TAG_MRU_LIST)));
  return result;
}

Fixed version (ground truth):
/** 
 * Method from http://eclipsenuggets.blogspot.com/2007/09/how-to-save-eclipse -ui-workbench-state_6644.html
 */
private IStatus saveState(final IMemento memento){
  MultiStatus result=new MultiStatus(PlatformUI.PLUGIN_ID,IStatus.OK,WorkbenchMessages.Workbench_problemsSaving,null);
  memento.putString(IWorkbenchConstants.TAG_VERSION,"String_Node_Str");
  memento.putInteger(IWorkbenchConstants.TAG_PROGRESS_COUNT,10);
  result.add(Status.OK_STATUS);
  IWorkbench workbench=PlatformUI.getWorkbench();
  IWorkbenchWindow[] windows=workbench.getWorkbenchWindows();
  result.add(((Workbench)workbench).getEditorHistory().saveState(memento.createChild(IWorkbenchConstants.TAG_MRU_LIST)));
  return result;
}
Program: 57499
Project: 57499
Buggy source:
private void setDataDependendStuff(){
  typeOptions[0]=dataDomain.getRecordDenomination(true,false);
  typeOptions[1]=dataDomain.getDimensionDenomination(true,false);
  clusterTypeCombo.setItems(typeOptions);
  clusterTypeCombo.select(0);
  clusterTypeCombo.setEnabled(true);
  clusterTargetName=typeOptions[0];
  parent.dataOK();
}

Fixed version (ground truth):
private void setDataDependendStuff(){
  typeOptions[0]=dataDomain.getRecordDenomination(true,false);
  typeOptions[1]=dataDomain.getDimensionDenomination(true,false);
  clusterTypeCombo.setItems(typeOptions);
  clusterTypeCombo.select(0);
  clusterTypeCombo.setEnabled(true);
  parent.dataOK();
}
Program: 57501
Project: 57501
Buggy source:
public void execute(boolean cancelPressed){
  if (cancelPressed) {
    clusterConfiguration=null;
    return;
  }
  int selectionIndex=tabFolder.getSelectionIndex();
  TabItem tabItem=tabFolder.getItems()[selectionIndex];
  AClusterTab clusterTab=(AClusterTab)tabItem.getData();
  clusterConfiguration=clusterTab.getClusterConfiguration();
  if (clusterTargetName.equals(typeOptions[0]))   clusterConfiguration.setClusterTarget(EClustererTarget.RECORD_CLUSTERING);
 else   if (clusterTargetName.equals(typeOptions[1]))   clusterConfiguration.setClusterTarget(EClustererTarget.DIMENSION_CLUSTERING);
 else {
    throw new IllegalStateException("String_Node_Str" + clusterTargetName);
  }
  clusterConfiguration.setDistanceMeasure(EDistanceMeasure.getTypeForName(distanceMeasureName));
  clusterConfiguration.setSourceRecordPerspective(recordPerspective);
  clusterConfiguration.setSourceDimensionPerspective(dimensionPerspective);
  clusterConfiguration.setOptionalTargetRecordPerspective(parent.getTargetRecordPerspective());
  clusterConfiguration.setOptionalTargetDimensionPerspective(parent.getTargetDimensionPerspective());
  ClusteringProgressBar progressBar=new ClusteringProgressBar(clusterConfiguration.getClusterAlgorithmName());
  progressBar.run();
  if (clusterConfiguration == null)   return;
  StartClusteringEvent event=null;
  event=new StartClusteringEvent(clusterConfiguration);
  event.setDataDomainID(dataDomain.getDataDomainID());
  GeneralManager.get().getEventPublisher().triggerEvent(event);
}

Fixed version (ground truth):
public void execute(boolean cancelPressed){
  if (cancelPressed) {
    clusterConfiguration=null;
    return;
  }
  int selectionIndex=tabFolder.getSelectionIndex();
  TabItem tabItem=tabFolder.getItems()[selectionIndex];
  AClusterTab clusterTab=(AClusterTab)tabItem.getData();
  clusterConfiguration=clusterTab.getClusterConfiguration();
  if (clusterTypeCombo.getText().equals(typeOptions[0]))   clusterConfiguration.setClusterTarget(EClustererTarget.RECORD_CLUSTERING);
 else   if (clusterTypeCombo.getText().equals(typeOptions[1]))   clusterConfiguration.setClusterTarget(EClustererTarget.DIMENSION_CLUSTERING);
 else {
    throw new IllegalStateException("String_Node_Str" + clusterTypeCombo.getText());
  }
  clusterConfiguration.setDistanceMeasure(EDistanceMeasure.getTypeForName(distanceMeasureCombo.getText()));
  clusterConfiguration.setSourceRecordPerspective(recordPerspective);
  clusterConfiguration.setSourceDimensionPerspective(dimensionPerspective);
  clusterConfiguration.setOptionalTargetRecordPerspective(parent.getTargetRecordPerspective());
  clusterConfiguration.setOptionalTargetDimensionPerspective(parent.getTargetDimensionPerspective());
  ClusteringProgressBar progressBar=new ClusteringProgressBar(clusterConfiguration.getClusterAlgorithmName());
  progressBar.run();
  if (clusterConfiguration == null)   return;
  StartClusteringEvent event=null;
  event=new StartClusteringEvent(clusterConfiguration);
  event.setDataDomainID(dataDomain.getDataDomainID());
  GeneralManager.get().getEventPublisher().triggerEvent(event);
}
Program: 57502
Project: 57502
Buggy source:
@Override public void run(){
  super.run();
  StartClusteringDialog dialog=new StartClusteringDialog(new Shell());
  dialog.open();
}

Fixed version (ground truth):
@Override public void run(){
  super.run();
  ClusterDialog dialog=new ClusterDialog(new Shell());
  dialog.open();
}
Program: 57503
Project: 57503
Buggy source:
@Override public void focusLost(FocusEvent e){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      splash.forceActive();
    }
  }
);
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
}
Program: 57504
Project: 57504
Buggy source:
private void doEventLoop(){
  final Shell splash=getSplash();
  if (splash.getDisplay().readAndDispatch() == false) {
    splash.getDisplay().sleep();
  }
  splash.addFocusListener(new FocusListener(){
    @Override public void focusGained(    FocusEvent e){
    }
    @Override public void focusLost(    FocusEvent e){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          splash.forceActive();
        }
      }
);
    }
  }
);
}

Fixed version (ground truth):
private void doEventLoop(){
  final Shell splash=getSplash();
  if (splash.getDisplay().readAndDispatch() == false) {
    splash.getDisplay().sleep();
  }
  splash.addFocusListener(new FocusListener(){
    @Override public void focusGained(    FocusEvent e){
    }
    @Override public void focusLost(    FocusEvent e){
    }
  }
);
}
Program: 57505
Project: 57505
Buggy source:
protected void createGLCanvas(){
  GLProfile profile=GLProfile.get(GLProfile.GL2);
  GLCapabilities glCapabilities=new GLCapabilities(profile);
  glCapabilities.setStencilBits(1);
  glCapabilities.setDoubleBuffered(true);
  glCanvas=new GLCanvas(glCapabilities);
  GeneralManager.get().getViewManager().registerGLCanvasToAnimator(glCanvas);
}

Fixed version (ground truth):
protected void createGLCanvas(){
  GLProfile profile=GLProfile.get(GLProfile.GL2);
  final GLCapabilities glCapabilities=new GLCapabilities(profile);
  glCapabilities.setStencilBits(1);
  glCapabilities.setDoubleBuffered(true);
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        glCanvas=new GLCanvas(glCapabilities);
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
  GeneralManager.get().getViewManager().registerGLCanvasToAnimator(glCanvas);
}
Program: 57506
Project: 57506
Buggy source:
@Override public void focusLost(FocusEvent e){
}

Fixed version (ground truth):
@Override public void focusLost(FocusEvent e){
  Display.getDefault().syncExec(new Runnable(){
    public void run(){
      splash.forceActive();
    }
  }
);
}
Program: 57507
Project: 57507
Buggy source:
private void doEventLoop(){
  final Shell splash=getSplash();
  if (splash.getDisplay().readAndDispatch() == false) {
    splash.getDisplay().sleep();
  }
  splash.addFocusListener(new FocusListener(){
    @Override public void focusGained(    FocusEvent e){
    }
    @Override public void focusLost(    FocusEvent e){
    }
  }
);
}

Fixed version (ground truth):
private void doEventLoop(){
  final Shell splash=getSplash();
  if (splash.getDisplay().readAndDispatch() == false) {
    splash.getDisplay().sleep();
  }
  splash.addFocusListener(new FocusListener(){
    @Override public void focusGained(    FocusEvent e){
    }
    @Override public void focusLost(    FocusEvent e){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          splash.forceActive();
        }
      }
);
    }
  }
);
}
Program: 57508
Project: 57508
Buggy source:
protected void createGLCanvas(){
  GLProfile profile=GLProfile.get(GLProfile.GL2);
  final GLCapabilities glCapabilities=new GLCapabilities(profile);
  glCapabilities.setStencilBits(1);
  glCapabilities.setDoubleBuffered(true);
  try {
    SwingUtilities.invokeAndWait(new Runnable(){
      @Override public void run(){
        glCanvas=new GLCanvas(glCapabilities);
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
  GeneralManager.get().getViewManager().registerGLCanvasToAnimator(glCanvas);
}

Fixed version (ground truth):
protected void createGLCanvas(){
  GLProfile profile=GLProfile.get(GLProfile.GL2);
  GLCapabilities glCapabilities=new GLCapabilities(profile);
  glCapabilities.setStencilBits(1);
  glCapabilities.setDoubleBuffered(true);
  glCanvas=new GLCanvas(glCapabilities);
  GeneralManager.get().getViewManager().registerGLCanvasToAnimator(glCanvas);
}
Program: 57509
Project: 57509
Buggy source:
/** 
 * Calculates the min and max of the container and sets them to the fMin and fMax class variables
 */
private void calculateMinMax(){
  min=Float.MAX_VALUE;
  fMax=Float.MIN_VALUE;
  for (  float fCurrent : container) {
    if (Float.isNaN(fCurrent)) {
      continue;
    }
    if (fCurrent < min) {
      min=fCurrent;
      continue;
    }
    if (fCurrent > fMax) {
      fMax=fCurrent;
    }
  }
  return;
}

Fixed version (ground truth):
/** 
 * Calculates the min and max of the container and sets them to the fMin and fMax class variables
 */
private void calculateMinMax(){
  min=Float.MAX_VALUE;
  max=Float.MIN_VALUE;
  for (  float current : container) {
    if (Float.isNaN(current)) {
      continue;
    }
    if (current < min) {
      min=current;
      continue;
    }
    if (current > max) {
      max=current;
    }
  }
  if (min == Float.MAX_VALUE)   min=Float.NaN;
  if (max == Float.MIN_VALUE)   max=Float.NaN;
  return;
}
Program: 57510
Project: 57510
Buggy source:
@Override public FloatCContainer log(int base){
  float[] fArTarget=new float[container.length];
  float fTmp;
  for (int index=0; index < container.length; index++) {
    fTmp=container[index];
    fArTarget[index]=(float)Math.log(fTmp) / (float)Math.log(base);
    if (fArTarget[index] == Float.NEGATIVE_INFINITY) {
      fArTarget[index]=0;
    }
  }
  return new FloatCContainer(fArTarget);
}

Fixed version (ground truth):
@Override public FloatCContainer log(int base){
  float[] target=new float[container.length];
  float tmp;
  for (int index=0; index < container.length; index++) {
    tmp=container[index];
    target[index]=(float)Math.log(tmp) / (float)Math.log(base);
    if (target[index] == Float.NEGATIVE_INFINITY) {
      target[index]=0;
    }
  }
  return new FloatCContainer(target);
}
Program: 57511
Project: 57511
Buggy source:
@Override public double getMax(){
  if (Float.isNaN(fMax)) {
    calculateMinMax();
  }
  return fMax;
}

Fixed version (ground truth):
@Override public double getMax(){
  if (Float.isNaN(max)) {
    calculateMinMax();
  }
  return max;
}
Program: 57512
Project: 57512
Buggy source:
@Override public FloatCContainer normalizeWithExternalExtrema(final double dMin,final double dMax){
  if (dMin >= dMax)   throw new IllegalArgumentException("String_Node_Str");
  return new FloatCContainer(ConversionTools.normalize(container,(float)dMin,(float)dMax));
}

Fixed version (ground truth):
@Override public FloatCContainer normalizeWithExternalExtrema(final double min,final double max){
  if (min >= max)   throw new IllegalArgumentException("String_Node_Str");
  return new FloatCContainer(ConversionTools.normalize(container,(float)min,(float)max));
}
Program: 57513
Project: 57513
Buggy source:
/** 
 * Creates a   {@link ColumnDescription} for the specified column.
 * @param columnIndex Index of the column in the file.
 * @return The ColumnDescription.
 */
private ColumnDescription createColumnDescription(int columnIndex){
  String dataType="String_Node_Str";
  try {
    int testSize=page.previewTable.getItemCount() - 1;
    for (int rowIndex=dataSetDescription.getNumberOfHeaderLines(); rowIndex < testSize; rowIndex++) {
      if (rowIndex != dataSetDescription.getRowOfColumnIDs()) {
        String testString=dataMatrix.get(rowIndex).get(columnIndex);
        if (!testString.isEmpty())         Float.parseFloat(testString);
      }
    }
  }
 catch (  NumberFormatException nfe) {
    dataType="String_Node_Str";
  }
  return new ColumnDescription(columnIndex,dataType,ColumnDescription.CONTINUOUS);
}

Fixed version (ground truth):
/** 
 * Creates a   {@link ColumnDescription} for the specified column.
 * @param columnIndex Index of the column in the file.
 * @return The ColumnDescription.
 */
private ColumnDescription createColumnDescription(int columnIndex){
  int testSize=page.previewTable.getItemCount() - 1;
  for (int rowIndex=dataSetDescription.getNumberOfHeaderLines(); rowIndex < testSize; rowIndex++) {
    if (rowIndex != dataSetDescription.getRowOfColumnIDs()) {
      String testString=dataMatrix.get(rowIndex).get(columnIndex);
      try {
        if (!testString.isEmpty()) {
          Float.parseFloat(testString);
          return new ColumnDescription(columnIndex,"String_Node_Str",ColumnDescription.CONTINUOUS);
        }
      }
 catch (      NumberFormatException nfe) {
      }
    }
  }
  return new ColumnDescription(columnIndex,"String_Node_Str",ColumnDescription.CONTINUOUS);
}
Program: 57515
Project: 57515
Buggy source:
public void open(final AGLView view){
  if (view.isRenderedRemote())   this.view=(AGLView)view.getRemoteRenderingGLView();
 else   this.view=view;
  this.parent=view.getParentComposite();
  final ContextMenuCreator menuCreator=this;
  parent.getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      final JPopupMenu popup=menuCreator.create();
      int cursorLocationX=MouseInfo.getPointerInfo().getLocation().x - view.getParentGLCanvas().getLocationOnScreen().x;
      int cursorLocationY=MouseInfo.getPointerInfo().getLocation().y - view.getParentGLCanvas().getLocationOnScreen().y;
      popup.show(view.getParentGLCanvas().getParent(),cursorLocationX,cursorLocationY);
    }
  }
);
}

Fixed version (ground truth):
public void open(final AGLView view){
  if (view.isRenderedRemote())   this.view=(AGLView)view.getRemoteRenderingGLView();
 else   this.view=view;
  this.parent=view.getParentComposite();
  final ContextMenuCreator menuCreator=this;
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      final JPopupMenu popup=menuCreator.create();
      int cursorLocationX=MouseInfo.getPointerInfo().getLocation().x - view.getParentGLCanvas().getLocationOnScreen().x;
      int cursorLocationY=MouseInfo.getPointerInfo().getLocation().y - view.getParentGLCanvas().getLocationOnScreen().y;
      popup.show(view.getParentGLCanvas().getParent(),cursorLocationX,cursorLocationY);
    }
  }
);
}
Program: 57516
Project: 57516
Buggy source:
private void triggerToolTipCreation(){
  if (toolTipThread != null)   return;
  toolTipThread=new ToolTipThread();
  Runnable runnable=new Runnable(){
    @Override public void run(){
      view.getParentComposite().getDisplay().asyncExec(toolTipThread);
    }
  }
;
  Thread timerThread=new Thread(runnable);
  timerThread.start();
}

Fixed version (ground truth):
private void triggerToolTipCreation(){
  if (toolTipThread != null)   return;
  toolTipThread=new ToolTipThread();
  Runnable runnable=new Runnable(){
    @Override public void run(){
      SwingUtilities.invokeLater(toolTipThread);
    }
  }
;
  Thread timerThread=new Thread(runnable);
  timerThread.start();
}
Program: 57517
Project: 57517
Buggy source:
private void triggerToolTipHide(){
  view.getParentComposite().getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      hideToolTip();
    }
  }
);
}

Fixed version (ground truth):
private void triggerToolTipHide(){
  SwingUtilities.invokeLater(new Runnable(){
    @Override public void run(){
      hideToolTip();
    }
  }
);
}
Program: 57520
Project: 57520
Buggy source:
public void loadWorkbenchData(String dirName){
  try {
    FileOperations.deleteDirectory(ProjectSaver.WORKBENCH_MEMENTO_FOLDER + ProjectSaver.WORKBENCH_MEMENTO_FILE);
    File workbenchFile=new File(dirName + ProjectSaver.WORKBENCH_MEMENTO_FILE);
    if (!workbenchFile.exists()) {
      Logger.log(new Status(Status.INFO,this.toString(),"String_Node_Str" + workbenchFile));
      return;
    }
    File f=new File(ProjectSaver.WORKBENCH_MEMENTO_FOLDER);
    if (f.exists() == false) {
      f.mkdirs();
    }
    FileOperations.copyFolder(new File(dirName + ProjectSaver.WORKBENCH_MEMENTO_FILE),new File(ProjectSaver.WORKBENCH_MEMENTO_FOLDER + ProjectSaver.WORKBENCH_MEMENTO_FILE));
  }
 catch (  IOException e) {
    Logger.log(new Status(Status.INFO,this.toString(),"String_Node_Str" + dirName,e));
  }
}

Fixed version (ground truth):
public void loadWorkbenchData(String dirName){
  try {
    IPath path=WorkbenchPlugin.getDefault().getDataLocation();
    path=path.append(ProjectSaver.WORKBENCH_MEMENTO_FILE);
    FileOperations.deleteDirectory(path.toOSString());
    File workbenchFile=new File(dirName + ProjectSaver.WORKBENCH_MEMENTO_FILE);
    if (!workbenchFile.exists()) {
      Logger.log(new Status(Status.INFO,this.toString(),"String_Node_Str" + workbenchFile));
      return;
    }
    File f=new File(ProjectSaver.WORKBENCH_MEMENTO_FOLDER);
    if (f.exists() == false) {
      f.mkdirs();
    }
    FileOperations.copyFolder(new File(dirName + ProjectSaver.WORKBENCH_MEMENTO_FILE),new File(path.toOSString()));
  }
 catch (  IOException e) {
    Logger.log(new Status(Status.INFO,this.toString(),"String_Node_Str" + dirName,e));
  }
}
Program: 57521
Project: 57521
Buggy source:
@Override public void execute(){
  super.execute();
  DataImportWizard dataImportWizard;
  if (loadSampleData) {
    DataSetDescription dataSetDescription=new DataSetDescription();
    dataSetDescription.setDataSourcePath(REAL_DATA_SAMPLE_FILE.replace("String_Node_Str",File.separator));
    dataSetDescription.setMathFilterMode(EDataTransformation.LOG2.getHumanReadableRep());
    dataImportWizard=new DataImportWizard(dataSetDescription);
  }
 else {
    dataImportWizard=new DataImportWizard();
  }
  HelpButtonWizardDialog dialog=new HelpButtonWizardDialog(StartupProcessor.get().getDisplay().getActiveShell(),dataImportWizard);
  if (Window.CANCEL == dialog.open())   StartupProcessor.get().shutdown();
}

Fixed version (ground truth):
@Override public void execute(){
  super.execute();
  DataImportWizard dataImportWizard;
  if (loadSampleData) {
    DataSetDescription dataSetDescription=new DataSetDescription();
    dataSetDescription.setDataSourcePath(REAL_DATA_SAMPLE_FILE.replace("String_Node_Str",File.separator));
    dataSetDescription.setMathFilterMode(EDataTransformation.LOG2.getHumanReadableRep());
    dataImportWizard=new DataImportWizard(dataSetDescription);
  }
 else {
    dataImportWizard=new DataImportWizard();
  }
  IPath path=WorkbenchPlugin.getDefault().getDataLocation();
  path=path.append(ProjectSaver.WORKBENCH_MEMENTO_FILE);
  FileOperations.deleteDirectory(path.toOSString());
  HelpButtonWizardDialog dialog=new HelpButtonWizardDialog(StartupProcessor.get().getDisplay().getActiveShell(),dataImportWizard);
  if (Window.CANCEL == dialog.open())   StartupProcessor.get().shutdown();
}
Program: 57523
Project: 57523
Buggy source:
@Override public void handleSelectionUpdate(SelectionDelta selectionDelta){
  IDType recordIDType=dataDomain.getRecordIDType();
  if (selectionDelta.getIDType().getIDCategory().equals(recordIDType.getIDCategory())) {
    if (selectionDelta.getIDType() != recordIDType) {
      selectionDelta=DeltaConverter.convertDelta(dataDomain.getRecordIDMappingManager(),recordIDType,selectionDelta);
    }
    recordSelectionManager.setDelta(selectionDelta);
    updateTree(true,recordSelectionManager,contentTree);
  }
  if (selectionDelta.getIDType() == recordSelectionManager.getIDType()) {
  }
 else   if (selectionDelta.getIDType() == dimensionSelectionManager.getIDType()) {
    dimensionSelectionManager.setDelta(selectionDelta);
    updateTree(false,dimensionSelectionManager,dimensionTree);
  }
}

Fixed version (ground truth):
@Override public void handleSelectionUpdate(SelectionDelta selectionDelta){
  IDType recordIDType=dataDomain.getRecordIDType();
  if (selectionDelta.getIDType().getIDCategory().equals(recordIDType.getIDCategory())) {
    recordSelectionManager.setDelta(selectionDelta);
    updateTree(true,recordSelectionManager,contentTree);
  }
 else   if (selectionDelta.getIDType().getIDCategory().equals(dimensionSelectionManager.getIDType().getIDCategory())) {
    dimensionSelectionManager.setDelta(selectionDelta);
    updateTree(false,dimensionSelectionManager,dimensionTree);
  }
}
Program: 57524
Project: 57524
Buggy source:
/** 
 * Initializes the   {@link IDType}s and   {@link IDCategory}s associated with this dataset, loads the dataset, groupings and does the processing of the data as defined in the   {@link DataSetDescription}
 */
public static ATableBasedDataDomain loadData(DataSetDescription dataSetDescription) throws FileNotFoundException, IOException {
  IDTypeInitializer.initIDs(dataSetDescription);
  ATableBasedDataDomain dataDomain=loadDataSet(dataSetDescription);
  loadGroupings(dataDomain,dataSetDescription);
  runDataProcessing(dataDomain,dataSetDescription);
  return dataDomain;
}

Fixed version (ground truth):
/** 
 * Creates a   {@link ATableBasedDataDomain} and loads the dataset andgroupings into it. Also does the processing of the data.
 * @param dataSetDescription The information for how to create everything
 */
public static ATableBasedDataDomain loadData(DataSetDescription dataSetDescription) throws FileNotFoundException, IOException {
  IDTypeInitializer.initIDs(dataSetDescription);
  ATableBasedDataDomain dataDomain=loadDataSet(dataSetDescription);
  loadGroupings(dataDomain,dataSetDescription);
  runDataProcessing(dataDomain,dataSetDescription);
  return dataDomain;
}
Program: 57526
Project: 57526
Buggy source:
/** 
 * @param dataDomain
 * @param recordPerspective
 * @param dimensionPerspective
 */
public DataContainer(ATableBasedDataDomain dataDomain,RecordPerspective recordPerspective,DimensionPerspective dimensionPerspective){
  this.dataDomain=dataDomain;
  this.recordPerspective=recordPerspective;
  recordPerspectiveID=recordPerspective.getPerspectiveID();
  this.dimensionPerspective=dimensionPerspective;
  dimensionPerspectiveID=dimensionPerspective.getPerspectiveID();
  createKey();
}

Fixed version (ground truth):
/** 
 * @param dataDomain
 * @param recordPerspective
 * @param dimensionPerspective
 */
public DataContainer(ATableBasedDataDomain dataDomain,RecordPerspective recordPerspective,DimensionPerspective dimensionPerspective){
  this.dataDomain=dataDomain;
  this.dataDomainID=dataDomain.getDataDomainID();
  this.recordPerspective=recordPerspective;
  recordPerspectiveID=recordPerspective.getPerspectiveID();
  this.dimensionPerspective=dimensionPerspective;
  dimensionPerspectiveID=dimensionPerspective.getPerspectiveID();
  createKey();
}
Program: 57527
Project: 57527
Buggy source:
/** 
 * This should be called after the rest of the data, specifically the perspectives are sucessfully deserialized. Sets the perspectives based on the serialized perspective IDs.
 */
public void postDesirialize(){
  recordPerspective=dataDomain.getTable().getRecordPerspective(recordPerspectiveID);
  dimensionPerspective=dataDomain.getTable().getDimensionPerspective(dimensionPerspectiveID);
  createKey();
}

Fixed version (ground truth):
/** 
 * This should be called after the rest of the data, specifically the perspectives are sucessfully deserialized. Sets the perspectives based on the serialized perspective IDs.
 */
public void postDesirialize(){
  dataDomain=(ATableBasedDataDomain)DataDomainManager.get().getDataDomainByID(dataDomainID);
  recordPerspective=dataDomain.getTable().getRecordPerspective(recordPerspectiveID);
  dimensionPerspective=dataDomain.getTable().getDimensionPerspective(dimensionPerspectiveID);
  createKey();
}
Program: 57528
Project: 57528
Buggy source:
public void setDataDomain(ATableBasedDataDomain dataDomain){
  this.dataDomain=dataDomain;
}

Fixed version (ground truth):
public void setDataDomain(ATableBasedDataDomain dataDomain){
  this.dataDomainID=dataDomain.getDataDomainID();
  this.dataDomain=dataDomain;
}
Program: 57529
Project: 57529
Buggy source:
@Override @XmlID public String getDataDomainID(){
  return dataDomainID;
}

Fixed version (ground truth):
@Override public String getDataDomainID(){
  return dataDomainID;
}
Program: 57534
Project: 57534
Buggy source:
protected void updateWidgetsAccordingToTableChanges(){
  columnOfRowIDSpinner.setMaximum(totalNumberOfColumns);
  numHeaderRowsSpinner.setMaximum(totalNumberOfRows);
  showAllColumnsButton.setEnabled(true);
  tableInfoLabel.setText((previewTable.getColumnCount() - 1) + "String_Node_Str" + totalNumberOfColumns+ "String_Node_Str");
}

Fixed version (ground truth):
protected void updateWidgetsAccordingToTableChanges(){
  columnOfRowIDSpinner.setMaximum(totalNumberOfColumns);
  numHeaderRowsSpinner.setMaximum(totalNumberOfRows);
  showAllColumnsButton.setEnabled(true);
  tableInfoLabel.setText((previewTable.getColumnCount() - 1) + "String_Node_Str" + totalNumberOfColumns+ "String_Node_Str");
  tableInfoLabel.pack();
  tableInfoLabel.getParent().pack(true);
  parentComposite.pack(true);
  parentComposite.layout(true);
}
Program: 57536
Project: 57536
Buggy source:
protected void updateWidgetsAccordingToTableChanges(){
  columnOfRowIDSpinner.setMaximum(totalNumberOfColumns);
  rowOfColumnIDSpinner.setMaximum(totalNumberOfRows);
  numHeaderRowsSpinner.setMaximum(totalNumberOfRows);
  showAllColumnsButton.setEnabled(true);
  tableInfoLabel.setText((previewTable.getColumnCount() - 1) + "String_Node_Str" + totalNumberOfColumns+ "String_Node_Str");
}

Fixed version (ground truth):
protected void updateWidgetsAccordingToTableChanges(){
  columnOfRowIDSpinner.setMaximum(totalNumberOfColumns);
  rowOfColumnIDSpinner.setMaximum(totalNumberOfRows);
  numHeaderRowsSpinner.setMaximum(totalNumberOfRows);
  showAllColumnsButton.setEnabled(true);
  tableInfoLabel.setText((previewTable.getColumnCount() - 1) + "String_Node_Str" + totalNumberOfColumns+ "String_Node_Str");
  tableInfoLabel.pack();
  tableInfoLabel.getParent().pack(true);
  parentComposite.pack(true);
  parentComposite.layout(true);
}
Program: 57539
Project: 57539
Buggy source:
/** 
 * Starts the plugin org.caleydo.plex, retrieves the deskotheque-manager from it and starts this application as a groupware-client.
 * @param serverAddress TODO should better be obtained from deskotheque
 * @return intiialization data retrieved from the groupware server to complete application startup
 */
public static SerializationData startPlexClient(String serverAddress){
  IGroupwareManager groupwareManager=GroupwareUtils.createDeskothequeManager();
  GeneralManager.get().setGroupwareManager(groupwareManager);
  groupwareManager.setServerAddress(serverAddress);
  groupwareManager.startClient();
  GeneralManager.get().getViewManager().getDisplayLoopExecution().executeMultiple(groupwareManager);
  return (groupwareManager.getSerializationData());
}

Fixed version (ground truth):
/** 
 * Starts the plugin org.caleydo.plex, retrieves the deskotheque-manager from it and starts this application as a groupware-client.
 * @param serverAddress TODO should better be obtained from deskotheque
 * @return initialization data retrieved from the groupware server to complete application startup
 */
public static SerializationData startPlexClient(String serverAddress){
  IGroupwareManager groupwareManager=GroupwareUtils.createDeskothequeManager();
  GeneralManager.get().setGroupwareManager(groupwareManager);
  groupwareManager.setServerAddress(serverAddress);
  groupwareManager.startClient();
  GeneralManager.get().getViewManager().getDisplayLoopExecution().executeMultiple(groupwareManager);
  return (groupwareManager.getSerializationData());
}
Program: 57540
Project: 57540
Buggy source:
public void shutdown(){
  GeneralManager generalManager=GeneralManager.get();
  try {
    Logger.log(new Status(IStatus.WARNING,this.toString(),"String_Node_Str"));
    generalManager.getPreferenceStore().save();
  }
 catch (  IOException ioException) {
    throw new IllegalStateException("String_Node_Str" + PreferenceManager.getPreferencePath(),ioException);
  }
  IGroupwareManager groupwareManager=generalManager.getGroupwareManager();
  if (groupwareManager != null) {
    groupwareManager.stop();
    generalManager.setGroupwareManager(null);
  }
  generalManager.getViewManager().stopAnimator();
  Logger.log(new Status(IStatus.INFO,this.toString(),"String_Node_Str"));
  System.exit(0);
}

Fixed version (ground truth):
public void shutdown(){
  GeneralManager generalManager=GeneralManager.get();
  try {
    Logger.log(new Status(IStatus.WARNING,this.toString(),"String_Node_Str"));
    generalManager.getPreferenceStore().save();
  }
 catch (  IOException ioException) {
    throw new IllegalStateException("String_Node_Str" + PreferenceManager.getPreferencePath(),ioException);
  }
  IGroupwareManager groupwareManager=generalManager.getGroupwareManager();
  if (groupwareManager != null) {
    groupwareManager.stop();
    generalManager.setGroupwareManager(null);
  }
  generalManager.getViewManager().stopAnimator();
  System.out.println(jogamp.nativewindow.x11.X11Util.getPendingDisplayConnectionNumber());
  jogamp.nativewindow.x11.X11Util.closeDisplay(jogamp.nativewindow.x11.X11Util.getPendingDisplayConnectionNumber());
  Logger.log(new Status(IStatus.INFO,this.toString(),"String_Node_Str"));
  System.exit(0);
}
Program: 57541
Project: 57541
Buggy source:
/** 
 * Handle view exceptions.
 * @param exception
 */
public void handleViewException(RuntimeException exception,final AGLView glEventListener){
  Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str" + exception.getMessage(),exception));
  Display.getDefault().asyncExec(new Runnable(){
    @Override public void run(){
      IViewPart viewToClose=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(glEventListener.getViewType());
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(viewToClose);
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Handle view exceptions.
 * @param exception
 */
public void handleViewException(RuntimeException exception,final AGLView glEventListener){
  Logger.log(new Status(IStatus.ERROR,this.toString(),"String_Node_Str" + exception.getMessage(),exception));
  GeneralManager.get().getViewManager().unregisterGLCanvas(glEventListener.getParentGLCanvas());
  PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable(){
    @Override public void run(){
      CaleydoRCPViewPart viewToClose=ViewManager.get().getViewPartFromView(glEventListener);
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(viewToClose);
      MessageBox messageBox=new MessageBox(new Shell(),SWT.OK);
      messageBox.setText("String_Node_Str");
      messageBox.setMessage("String_Node_Str" + glEventListener.getViewName() + "String_Node_Str");
      messageBox.open();
    }
  }
);
}
Program: 57542
Project: 57542
Buggy source:
@Override public void run(){
  IViewPart viewToClose=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(glEventListener.getViewType());
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(viewToClose);
}

Fixed version (ground truth):
@Override public void run(){
  CaleydoRCPViewPart viewToClose=ViewManager.get().getViewPartFromView(glEventListener);
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().hideView(viewToClose);
  MessageBox messageBox=new MessageBox(new Shell(),SWT.OK);
  messageBox.setText("String_Node_Str");
  messageBox.setMessage("String_Node_Str" + glEventListener.getViewName() + "String_Node_Str");
  messageBox.open();
}
Program: 57543
Project: 57543
Buggy source:
/** 
 * Constructor. If the glCanvas object is null - then the view is rendered remote.
 * @param viewType TODO
 * @param viewName TODO
 */
protected AGLView(GLCanvas glCanvas,final Composite parentComposite,final ViewFrustum viewFrustum,String viewType,String viewName){
  super(GeneralManager.get().getIDCreator().createID(ManagedObjectType.GL_VIEW),parentComposite,viewType,viewName);
  GeneralManager.get().getViewManager().registerGLView(this);
  parentGLCanvas=glCanvas;
  glMouseListener=new GLMouseListener();
  glMouseListener.setNavigationModes(false,false,false);
  glCanvas.addMouseListener(glMouseListener);
  glCanvas.addMouseMotionListener(glMouseListener);
  glCanvas.addMouseWheelListener(glMouseListener);
  glCanvas.addFocusListener(new FocusListener(){
    @Override public void focusLost(    FocusEvent e){
    }
    @Override public void focusGained(    FocusEvent e){
      focusGained=true;
    }
  }
);
  idPickingListeners=new HashMap<String,HashMap<Integer,Set<IPickingListener>>>();
  typePickingListeners=new HashMap<String,Set<IPickingListener>>();
  this.viewFrustum=viewFrustum;
  viewCamera=new ViewCameraBase(uniqueID);
  pickingManager=generalManager.getViewManager().getPickingManager();
  textureManager=new TextureManager();
  glMouseWheelListener=new GLMouseWheelListener(this);
  pixelGLConverter=new PixelGLConverter(viewFrustum,parentGLCanvas);
  mouseWheelListeners=new HashSet<IMouseWheelHandler>();
}

Fixed version (ground truth):
/** 
 * Constructor. If the glCanvas object is null - then the view is rendered remote.
 * @param viewType TODO
 * @param viewName TODO
 */
protected AGLView(GLCanvas glCanvas,final Composite parentComposite,final ViewFrustum viewFrustum,String viewType,String viewName){
  super(GeneralManager.get().getIDCreator().createID(ManagedObjectType.GL_VIEW),parentComposite,viewType,viewName);
  parentGLCanvas=glCanvas;
  glMouseListener=new GLMouseListener();
  glMouseListener.setNavigationModes(false,false,false);
  glCanvas.addMouseListener(glMouseListener);
  glCanvas.addMouseMotionListener(glMouseListener);
  glCanvas.addMouseWheelListener(glMouseListener);
  glCanvas.addFocusListener(new FocusListener(){
    @Override public void focusLost(    FocusEvent e){
    }
    @Override public void focusGained(    FocusEvent e){
      focusGained=true;
    }
  }
);
  idPickingListeners=new HashMap<String,HashMap<Integer,Set<IPickingListener>>>();
  typePickingListeners=new HashMap<String,Set<IPickingListener>>();
  this.viewFrustum=viewFrustum;
  viewCamera=new ViewCameraBase(uniqueID);
  pickingManager=generalManager.getViewManager().getPickingManager();
  textureManager=new TextureManager();
  glMouseWheelListener=new GLMouseWheelListener(this);
  pixelGLConverter=new PixelGLConverter(viewFrustum,parentGLCanvas);
  mouseWheelListeners=new HashSet<IMouseWheelHandler>();
}
Program: 57544
Project: 57544
Buggy source:
@Override public void initialize(){
  registerEventListeners();
  if (glRemoteRenderingView == null)   GeneralManager.get().getViewManager().registerGLEventListenerByGLCanvas(parentGLCanvas,this);
}

Fixed version (ground truth):
@Override public void initialize(){
  GeneralManager.get().getViewManager().registerGLView(this);
  registerEventListeners();
  if (glRemoteRenderingView == null)   GeneralManager.get().getViewManager().registerGLEventListenerByGLCanvas(parentGLCanvas,this);
}
Program: 57545
Project: 57545
Buggy source:
@Override public Set<IDataDomain> getDataDomains(){
  Set<IDataDomain> dataDomains=new HashSet<IDataDomain>();
  for (  DataContainer dataContainer : dataContainers) {
    if (dataContainer instanceof PathwayDataContainer) {
      dataDomains.add(((PathwayDataContainer)dataContainer).getPathwayDataDomain());
    }
 else {
      dataDomains.add(dataContainer.getDataDomain());
    }
  }
  return dataDomains;
}

Fixed version (ground truth):
@Override public Set<IDataDomain> getDataDomains(){
  Set<IDataDomain> dataDomains=new HashSet<IDataDomain>();
  if (dataContainers == null) {
    System.out.println("String_Node_Str");
    return dataDomains;
  }
  for (  DataContainer dataContainer : dataContainers) {
    if (dataContainer instanceof PathwayDataContainer) {
      dataDomains.add(((PathwayDataContainer)dataContainer).getPathwayDataDomain());
    }
 else {
      dataDomains.add(dataContainer.getDataDomain());
    }
  }
  return dataDomains;
}
Program: 57546
Project: 57546
Buggy source:
public static String convertID(String sourceID,IDTypeParsingRules idTypeParsingRules){
  if (idTypeParsingRules == null)   return sourceID;
  if (idTypeParsingRules.getReplacingExpression() != null) {
    sourceID=sourceID.replaceAll(idTypeParsingRules.getReplacingExpression(),idTypeParsingRules.getReplacementString());
  }
  if (idTypeParsingRules.getSubStringExpression() != null) {
    String[] splitID=sourceID.split(idTypeParsingRules.getSubStringExpression());
    for (    String result : splitID) {
      if (!result.isEmpty()) {
        sourceID=result;
        break;
      }
    }
  }
  return sourceID;
}

Fixed version (ground truth):
/** 
 * Converts a sourceID based on the   {@link IDTypeParsingRules} specified andreturns a new string with the converted ID
 * @param sourceID
 * @param idTypeParsingRules
 * @return a new String with the converted ID
 */
public static String convertID(String sourceID,IDTypeParsingRules idTypeParsingRules){
  if (idTypeParsingRules == null)   return sourceID;
  if (idTypeParsingRules.getReplacingExpression() != null) {
    sourceID=sourceID.replaceAll(idTypeParsingRules.getReplacingExpression(),idTypeParsingRules.getReplacementString());
  }
  if (idTypeParsingRules.getSubStringExpression() != null) {
    String[] splitID=sourceID.split(idTypeParsingRules.getSubStringExpression());
    for (    String result : splitID) {
      if (!result.isEmpty()) {
        sourceID=result;
        break;
      }
    }
  }
  return sourceID;
}
Program: 57548
Project: 57548
Buggy source:
public static void main(String[] args){
  String inputString="String_Node_Str";
  IDTypeParsingRules idTypeParsingRules=new IDTypeParsingRules();
  idTypeParsingRules.setSubStringExpression("String_Node_Str");
  String outputString=TabularDataParser.convertID(inputString,idTypeParsingRules);
  System.out.println("String_Node_Str" + outputString);
}

Fixed version (ground truth):
public static void main(String[] args){
  String inputString="String_Node_Str";
  IDTypeParsingRules idTypeParsingRules=new IDTypeParsingRules();
  idTypeParsingRules.setSubStringExpression(TCGATestDataXMLGenerator.TCGA_ID_SUBSTRING_REGEX);
  String outputString=TabularDataParser.convertID(inputString,idTypeParsingRules);
  System.out.println("String_Node_Str" + outputString);
}
Program: 57549
Project: 57549
Buggy source:
@Override public int getDataAmount(){
  if (table == null)   return 0;
  return table.getMetaData().size() * table.getMetaData().depth();
}

Fixed version (ground truth):
@Override public int getDataAmount(){
  if (table == null)   return 0;
  try {
    return table.getMetaData().size() * table.getMetaData().depth();
  }
 catch (  NoSuchElementException e) {
    return 0;
  }
}