nus-yam/ex-repair huggingface dataset:
Program: 96358
Project: 96358
Buggy source:
/** 
 * Add the "Add", "Delete" and "Insert" buttons
 * @param parent the parent composite
 */
private void createButtons(Composite parent){
  setAddButton(new Button(parent,SWT.PUSH | SWT.CENTER));
  getAddButton().setData(WIDGET_NAME_KEY,"String_Node_Str");
  getAddButton().setText(Messages.JubulaDataSetViewAppend);
  GridData gridData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gridData.widthHint=80;
  getAddButton().setLayoutData(gridData);
  getAddButton().setEnabled(false);
  getControlEnabler().addControl(getAddButton());
  setInsertButton(new Button(parent,SWT.PUSH | SWT.CENTER));
  getInsertButton().setData(WIDGET_NAME_KEY,"String_Node_Str");
  getInsertButton().setText(Messages.GDDataSetViewInsert);
  gridData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gridData.widthHint=80;
  getInsertButton().setLayoutData(gridData);
  getInsertButton().setEnabled(false);
  getControlEnabler().addControl(getInsertButton());
  setDeleteButton(new Button(parent,SWT.PUSH | SWT.CENTER));
  getDeleteButton().setData(WIDGET_NAME_KEY,"String_Node_Str");
  getDeleteButton().setText(Messages.JubulaDataSetViewDelete);
  gridData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gridData.widthHint=80;
  getDeleteButton().setLayoutData(gridData);
  getDeleteButton().setEnabled(false);
  getControlEnabler().addControl(getDeleteButton());
  addListenerToButtons();
}

Fixed version (ground truth):
/** 
 * Add the "Add", "Delete" and "Insert" buttons
 * @param parent the parent composite
 */
private void createButtons(Composite parent){
  setAddButton(new Button(parent,SWT.PUSH | SWT.CENTER));
  getAddButton().setData(SwtAUTHierarchyConstants.WIDGET_NAME,"String_Node_Str");
  getAddButton().setText(Messages.JubulaDataSetViewAppend);
  GridData gridData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gridData.widthHint=80;
  getAddButton().setLayoutData(gridData);
  getAddButton().setEnabled(false);
  getControlEnabler().addControl(getAddButton());
  setInsertButton(new Button(parent,SWT.PUSH | SWT.CENTER));
  getInsertButton().setData(SwtAUTHierarchyConstants.WIDGET_NAME,"String_Node_Str");
  getInsertButton().setText(Messages.GDDataSetViewInsert);
  gridData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gridData.widthHint=80;
  getInsertButton().setLayoutData(gridData);
  getInsertButton().setEnabled(false);
  getControlEnabler().addControl(getInsertButton());
  setDeleteButton(new Button(parent,SWT.PUSH | SWT.CENTER));
  getDeleteButton().setData(SwtAUTHierarchyConstants.WIDGET_NAME,"String_Node_Str");
  getDeleteButton().setText(Messages.JubulaDataSetViewDelete);
  gridData=new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
  gridData.widthHint=80;
  getDeleteButton().setLayoutData(gridData);
  getDeleteButton().setEnabled(false);
  getControlEnabler().addControl(getDeleteButton());
  addListenerToButtons();
}
Program: 96361
Project: 96361
Buggy source:
/** 
 * Attaches name data to the given page appropriate.
 * @param selectedPage The page to which we will try to attach the name data.
 */
private void addNameDataToPrefPage(Object selectedPage){
  if (selectedPage == null) {
    return;
  }
  PreferenceManager prefMan=PlatformUI.getWorkbench().getPreferenceManager();
  Iterator iter=prefMan.getElements(PreferenceManager.PRE_ORDER).iterator();
  while (iter.hasNext()) {
    IPreferenceNode prefNode=(IPreferenceNode)iter.next();
    if (selectedPage.equals(prefNode.getPage())) {
      Control pageControl=prefNode.getPage().getControl();
      String prefNodeId=prefNode.getId();
      if (pageControl != null && !pageControl.isDisposed() && pageControl.getData(Startup.GD_RCP_DATA_KEY) == null && prefNodeId != null && prefNodeId.trim().length() > 0) {
        pageControl.setData(Startup.GD_RCP_DATA_KEY,prefNodeId);
        Shell prefShell=pageControl.getDisplay().getActiveShell();
        Event activateEvent=new Event();
        activateEvent.time=(int)System.currentTimeMillis();
        activateEvent.type=SWT.Activate;
        activateEvent.widget=prefShell;
        prefShell.notifyListeners(SWT.Activate,activateEvent);
      }
      break;
    }
  }
}

Fixed version (ground truth):
/** 
 * Attaches name data to the given page appropriate.
 * @param selectedPage The page to which we will try to attach the name data.
 */
private void addNameDataToPrefPage(Object selectedPage){
  if (selectedPage == null) {
    return;
  }
  PreferenceManager prefMan=PlatformUI.getWorkbench().getPreferenceManager();
  Iterator iter=prefMan.getElements(PreferenceManager.PRE_ORDER).iterator();
  while (iter.hasNext()) {
    IPreferenceNode prefNode=(IPreferenceNode)iter.next();
    if (selectedPage.equals(prefNode.getPage())) {
      Control pageControl=prefNode.getPage().getControl();
      String prefNodeId=prefNode.getId();
      if (pageControl != null && !pageControl.isDisposed() && pageControl.getData(Startup.TEST_RCP_DATA_KEY) == null && prefNodeId != null && prefNodeId.trim().length() > 0) {
        pageControl.setData(Startup.TEST_RCP_DATA_KEY,prefNodeId);
        Shell prefShell=pageControl.getDisplay().getActiveShell();
        Event activateEvent=new Event();
        activateEvent.time=(int)System.currentTimeMillis();
        activateEvent.type=SWT.Activate;
        activateEvent.widget=prefShell;
        prefShell.notifyListeners(SWT.Activate,activateEvent);
      }
      break;
    }
  }
}
Program: 96362
Project: 96362
Buggy source:
/** 
 * {@inheritDoc}
 */
public void partOpened(IWorkbenchPartReference partRef){
  if (partRef instanceof WorkbenchPartReference) {
    WorkbenchPartReference workbenchPartRef=(WorkbenchPartReference)partRef;
    Control partContent=workbenchPartRef.getPane().getControl();
    if (partContent != null && !partContent.isDisposed() && partContent.getData(GD_RCP_DATA_KEY) == null) {
      String partId=workbenchPartRef.getId();
      if (partRef instanceof IViewReference) {
        String secondaryId=((IViewReference)partRef).getSecondaryId();
        if (secondaryId != null) {
          partId+="String_Node_Str" + secondaryId;
        }
      }
      if (partId == null || partId.trim().length() == 0) {
        return;
      }
      partContent.setData(GD_RCP_DATA_KEY,partId);
      Control partToolbar=workbenchPartRef.getPane().getToolBar();
      if (partToolbar != null) {
        partToolbar.setData(GD_RCP_DATA_KEY,partId + TOOLBAR_ID_SUFFIX);
      }
      Shell shell=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
      Event activateEvent=new Event();
      activateEvent.time=(int)System.currentTimeMillis();
      activateEvent.type=SWT.Activate;
      activateEvent.widget=shell;
      shell.notifyListeners(SWT.Activate,activateEvent);
    }
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void partOpened(IWorkbenchPartReference partRef){
  if (partRef instanceof WorkbenchPartReference) {
    WorkbenchPartReference workbenchPartRef=(WorkbenchPartReference)partRef;
    Control partContent=workbenchPartRef.getPane().getControl();
    if (partContent != null && !partContent.isDisposed() && partContent.getData(TEST_RCP_DATA_KEY) == null) {
      String partId=workbenchPartRef.getId();
      if (partRef instanceof IViewReference) {
        String secondaryId=((IViewReference)partRef).getSecondaryId();
        if (secondaryId != null) {
          partId+="String_Node_Str" + secondaryId;
        }
      }
      if (partId == null || partId.trim().length() == 0) {
        return;
      }
      partContent.setData(TEST_RCP_DATA_KEY,partId);
      Control partToolbar=workbenchPartRef.getPane().getToolBar();
      if (partToolbar != null) {
        partToolbar.setData(TEST_RCP_DATA_KEY,partId + TOOLBAR_ID_SUFFIX);
      }
      Shell shell=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
      Event activateEvent=new Event();
      activateEvent.time=(int)System.currentTimeMillis();
      activateEvent.type=SWT.Activate;
      activateEvent.widget=shell;
      shell.notifyListeners(SWT.Activate,activateEvent);
    }
  }
}
Program: 96363
Project: 96363
Buggy source:
/** 
 * use this method to set a name on the given object
 * @param useObject the object
 * @param methodToInvoke the method to invoke
 * @param buttonID the button id
 * @param buttonName the button name
 */
private void invokeNameSetting(Object useObject,Method methodToInvoke,Integer buttonID,Object buttonName){
  Object ret=null;
  try {
    ret=methodToInvoke.invoke(useObject,new Object[]{buttonID});
  }
 catch (  IllegalArgumentException e) {
  }
catch (  IllegalAccessException e) {
  }
catch (  InvocationTargetException e) {
  }
  if (ret instanceof Button) {
    Button button=(Button)ret;
    if (button.getData(GD_RCP_DATA_KEY) == null) {
      button.setData(GD_RCP_DATA_KEY,buttonName);
    }
  }
}

Fixed version (ground truth):
/** 
 * use this method to set a name on the given object
 * @param useObject the object
 * @param methodToInvoke the method to invoke
 * @param buttonID the button id
 * @param buttonName the button name
 */
private void invokeNameSetting(Object useObject,Method methodToInvoke,Integer buttonID,Object buttonName){
  Object ret=null;
  try {
    ret=methodToInvoke.invoke(useObject,new Object[]{buttonID});
  }
 catch (  IllegalArgumentException e) {
  }
catch (  IllegalAccessException e) {
  }
catch (  InvocationTargetException e) {
  }
  if (ret instanceof Button) {
    Button button=(Button)ret;
    if (button.getData(TEST_RCP_DATA_KEY) == null) {
      button.setData(TEST_RCP_DATA_KEY,buttonName);
    }
  }
}
Program: 96364
Project: 96364
Buggy source:
/** 
 * {@inheritDoc}
 */
public void setComponent(final Object graphicsComponent){
  getEventThreadQueuer().invokeAndWait(getClass().getName() + "String_Node_Str",new IRunnable(){
    public Object run() throws StepExecutionException {
      FigureCanvas figureCanvas=(FigureCanvas)graphicsComponent;
      Composite parent=figureCanvas;
      while (parent != null && !(parent.getData(Startup.GD_GEF_VIEWER_DATA_KEY) instanceof GraphicalViewer)) {
        parent=parent.getParent();
      }
      if (parent != null) {
        m_composite=parent;
        m_viewer=(GraphicalViewer)parent.getData(Startup.GD_GEF_VIEWER_DATA_KEY);
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void setComponent(final Object graphicsComponent){
  getEventThreadQueuer().invokeAndWait(getClass().getName() + "String_Node_Str",new IRunnable(){
    public Object run() throws StepExecutionException {
      FigureCanvas figureCanvas=(FigureCanvas)graphicsComponent;
      Composite parent=figureCanvas;
      while (parent != null && !(parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY) instanceof GraphicalViewer)) {
        parent=parent.getParent();
      }
      if (parent != null) {
        m_composite=parent;
        m_viewer=(GraphicalViewer)parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY);
      }
      return null;
    }
  }
);
}
Program: 96366
Project: 96366
Buggy source:
/** 
 * Registers a   {@link GraphicalViewer} with the given {@link IWorkbenchPartReference}.
 * @param viewer The viewer to register.
 * @param partRef The reference to the part that (indirectly) contains theviewer.
 */
private void registerGraphicalViewer(GraphicalViewer viewer,IWorkbenchPartReference partRef){
  IWorkbenchPart part=partRef.getPart(false);
  if (part != null && partRef instanceof WorkbenchPartReference) {
    if (viewer != null) {
      Control partContent=((WorkbenchPartReference)partRef).getPane().getControl();
      if (partContent != null && !partContent.isDisposed()) {
        partContent.setData(Startup.GD_GEF_VIEWER_DATA_KEY,viewer);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Registers a   {@link GraphicalViewer} with the given {@link IWorkbenchPartReference}.
 * @param viewer The viewer to register.
 * @param partRef The reference to the part that (indirectly) contains theviewer.
 */
private void registerGraphicalViewer(GraphicalViewer viewer,IWorkbenchPartReference partRef){
  IWorkbenchPart part=partRef.getPart(false);
  if (part != null && partRef instanceof WorkbenchPartReference) {
    if (viewer != null) {
      Control partContent=((WorkbenchPartReference)partRef).getPane().getControl();
      if (partContent != null && !partContent.isDisposed()) {
        partContent.setData(Startup.TEST_GEF_VIEWER_DATA_KEY,viewer);
      }
    }
  }
}
Program: 96367
Project: 96367
Buggy source:
/** 
 * @param figureCanvas The canvas for which to find the viewer.
 * @return the graphical viewer associated with the given canvas, or<code>null</code> if no such viewer could be found.
 */
public static GraphicalViewer getViewer(FigureCanvas figureCanvas){
  Composite parent=figureCanvas;
  while (parent != null && !(parent.getData(Startup.GD_GEF_VIEWER_DATA_KEY) instanceof GraphicalViewer)) {
    parent=parent.getParent();
  }
  if (parent != null) {
    return (GraphicalViewer)parent.getData(Startup.GD_GEF_VIEWER_DATA_KEY);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param figureCanvas The canvas for which to find the viewer.
 * @return the graphical viewer associated with the given canvas, or<code>null</code> if no such viewer could be found.
 */
public static GraphicalViewer getViewer(FigureCanvas figureCanvas){
  Composite parent=figureCanvas;
  while (parent != null && !(parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY) instanceof GraphicalViewer)) {
    parent=parent.getParent();
  }
  if (parent != null) {
    return (GraphicalViewer)parent.getData(Startup.TEST_GEF_VIEWER_DATA_KEY);
  }
  return null;
}
Program: 96368
Project: 96368
Buggy source:
/** 
 * {@inheritDoc}
 */
protected String getCompName(Object currentComponent){
  return (String)((Widget)currentComponent).getData(SwtAUTHierarchyConstants.WIDGET_NAME);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
protected String getCompName(Object currentComponent){
  return getComponentName((Widget)currentComponent);
}
Program: 96370
Project: 96370
Buggy source:
/** 
 * Checks for uniqueness of <code>name</code> for the components in <code>parent</code>.<br> If parent is null every name is unique, a null name is NEVER unique. If both parameters are null, false is returned. <br>
 * @param parent the hierarchy container containing the components which are checked.
 * @param widget the widget that might receive the checked name
 * @param name the name to check
 * @return true if the name is treated as unique, false otherwise.
 */
private boolean isUniqueName(SwtHierarchyContainer parent,Widget widget,String name){
  if (name == null) {
    return false;
  }
  if (parent == null) {
    return true;
  }
  SwtHierarchyContainer[] compIDs=parent.getComponents();
  final int length=compIDs.length;
  for (int index=0; index < length; index++) {
    Widget childWidget=compIDs[index].getComponentID().getRealComponent();
    if (childWidget != null && !childWidget.isDisposed()) {
      Object childWidgetName=childWidget.getData(SwtAUTHierarchyConstants.WIDGET_NAME);
      if ((childWidget != widget) && name.equals(childWidgetName)) {
        return false;
      }
    }
  }
  for (int index=0; index < length; index++) {
    if (name.equals(compIDs[index].getName())) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Checks for uniqueness of <code>name</code> for the components in <code>parent</code>.<br> If parent is null every name is unique, a null name is NEVER unique. If both parameters are null, false is returned. <br>
 * @param parent the hierarchy container containing the components which are checked.
 * @param widget the widget that might receive the checked name
 * @param name the name to check
 * @return true if the name is treated as unique, false otherwise.
 */
private boolean isUniqueName(SwtHierarchyContainer parent,Widget widget,String name){
  if (name == null) {
    return false;
  }
  if (parent == null) {
    return true;
  }
  SwtHierarchyContainer[] compIDs=parent.getComponents();
  final int length=compIDs.length;
  for (int index=0; index < length; index++) {
    Widget childWidget=compIDs[index].getComponentID().getRealComponent();
    if (childWidget != null && !childWidget.isDisposed()) {
      String childWidgetName=FindSWTComponentBP.getComponentName(childWidget);
      if ((childWidget != widget) && name.equals(childWidgetName)) {
        return false;
      }
    }
  }
  for (int index=0; index < length; index++) {
    if (name.equals(compIDs[index].getName())) {
      return false;
    }
  }
  return true;
}
Program: 96371
Project: 96371
Buggy source:
/** 
 * creates logical name for CAP
 * @param w Widget
 * @param id IComponentIdentifier
 * @return logical Name
 */
protected String generateLogicalName(Widget w,IComponentIdentifier id){
  String logName=null;
  String logicalName=null;
  if (w.getData(SwtAUTHierarchyConstants.WIDGET_NAME) == null) {
    if (!(w instanceof TabFolder) && !(w instanceof CTabFolder)) {
      logName=getTextOfComponent(w);
    }
    if (logName == null || logName.equals(StringConstants.EMPTY)) {
      logName=minimizeCapName(id.getComponentName());
    }
  }
 else {
    logName=w.getData(SwtAUTHierarchyConstants.WIDGET_NAME).toString();
  }
  logicalName=logName + getAbbreviations(w);
  Widget parent=getWidgetParent(w);
  while (parent != null) {
    logName=getTextOfComponent(parent);
    if (logName == null) {
      logName=minimizeCapName(parent.getClass().getName());
    }
    if ((parent instanceof Shell || parent instanceof TabFolder || parent instanceof CTabFolder|| parent instanceof Group) && !(logName.equals(StringConstants.EMPTY))) {
      logicalName=logName + "String_Node_Str" + logicalName;
    }
    parent=getWidgetParent(parent);
  }
  return NameValidator.convertToValidLogicalName(logicalName);
}

Fixed version (ground truth):
/** 
 * creates logical name for CAP
 * @param w Widget
 * @param id IComponentIdentifier
 * @return logical Name
 */
protected String generateLogicalName(Widget w,IComponentIdentifier id){
  String logName=null;
  String logicalName=null;
  String compName=FindSWTComponentBP.getComponentName(w);
  if (compName == null) {
    if (!(w instanceof TabFolder) && !(w instanceof CTabFolder)) {
      logName=getTextOfComponent(w);
    }
    if (logName == null || logName.equals(StringConstants.EMPTY)) {
      logName=minimizeCapName(id.getComponentName());
    }
  }
 else {
    logName=compName;
  }
  logicalName=logName + getAbbreviations(w);
  Widget parent=getWidgetParent(w);
  while (parent != null) {
    logName=getTextOfComponent(parent);
    if (logName == null) {
      logName=minimizeCapName(parent.getClass().getName());
    }
    if ((parent instanceof Shell || parent instanceof TabFolder || parent instanceof CTabFolder|| parent instanceof Group) && !(logName.equals(StringConstants.EMPTY))) {
      logicalName=logName + "String_Node_Str" + logicalName;
    }
    parent=getWidgetParent(parent);
  }
  return NameValidator.convertToValidLogicalName(logicalName);
}
Program: 96372
Project: 96372
Buggy source:
/** 
 * Initializes all pre-defined variables for execution of the given  test suite.
 * @param varStore The place to store the variables.
 * @param testSuite The test suite that will be executed. Some variableshave values based on this test suite.
 */
private void storePredefinedVariables(TDVariableStore varStore,ITestSuitePO testSuite){
  varStore.store(TDVariableStore.VAR_LANG,m_executionLanguage.toString());
  varStore.store(TDVariableStore.VAR_TS,testSuite.getName());
  varStore.store(TDVariableStore.VAR_USERNAME,System.getProperty("String_Node_Str"));
  varStore.store(TDVariableStore.VAR_DBUSERNAME,Hibernator.instance().getCurrentDBUser());
  try {
    ServerConnection serverConn=ServerConnection.getInstance();
    varStore.store(TDVariableStore.VAR_AUTSTARTER,serverConn.getCommunicator().getHostName());
    varStore.store(TDVariableStore.VAR_PORT,String.valueOf(serverConn.getCommunicator().getPort()));
  }
 catch (  ConnectionException ce) {
  }
  varStore.store(TDVariableStore.VAR_AUT,testSuite.getAut().getName());
  if (m_autConfig != null) {
    varStore.store(TDVariableStore.VAR_AUTCONFIG,m_autConfig.getName());
  }
 else {
    varStore.store(TDVariableStore.VAR_AUTCONFIG,TestresultSummaryBP.AUTRUN);
  }
  varStore.store(TDVariableStore.VAR_CLIENTVERSION,(String)Platform.getBundle(CLIENT_TEST_PLUGIN_ID).getHeaders().get(Constants.BUNDLE_VERSION));
}

Fixed version (ground truth):
/** 
 * Initializes all pre-defined variables for execution of the given  test suite.
 * @param varStore The place to store the variables.
 * @param testSuite The test suite that will be executed. Some variableshave values based on this test suite.
 */
private void storePredefinedVariables(TDVariableStore varStore,ITestSuitePO testSuite){
  varStore.store(TDVariableStore.VAR_LANG,m_executionLanguage.toString());
  varStore.store(TDVariableStore.VAR_TS,testSuite.getName());
  varStore.store(TDVariableStore.VAR_USERNAME,System.getProperty("String_Node_Str"));
  varStore.store(TDVariableStore.VAR_DBUSERNAME,Hibernator.instance().getCurrentDBUser());
  try {
    ServerConnection serverConn=ServerConnection.getInstance();
    varStore.store(TDVariableStore.VAR_AUTAGENT,serverConn.getCommunicator().getHostName());
    varStore.store(TDVariableStore.VAR_PORT,String.valueOf(serverConn.getCommunicator().getPort()));
  }
 catch (  ConnectionException ce) {
  }
  varStore.store(TDVariableStore.VAR_AUT,testSuite.getAut().getName());
  if (m_autConfig != null) {
    varStore.store(TDVariableStore.VAR_AUTCONFIG,m_autConfig.getName());
  }
 else {
    varStore.store(TDVariableStore.VAR_AUTCONFIG,TestresultSummaryBP.AUTRUN);
  }
  varStore.store(TDVariableStore.VAR_CLIENTVERSION,(String)Platform.getBundle(CLIENT_TEST_PLUGIN_ID).getHeaders().get(Constants.BUNDLE_VERSION));
}
Program: 96375
Project: 96375
Buggy source:
/** 
 * @return The waiting time between mouse press and mouse release.
 */
private static final int getPostMouseDownDelay(){
  if (postMouseDown >= 0) {
    return postMouseDown;
  }
  int externalWait=getExternalWait(EXTERNAL_PROPERTY_NAME_POST_MOUSE_DOWN_DELAY);
  if (externalWait != NO_EXTERNAL_WAIT) {
    postMouseDown=externalWait;
    return postMouseDown;
  }
  postMouseDown=DEFAULT_DELAY_POST_MOUSE_DOWN;
  return postMouseDown;
}

Fixed version (ground truth):
/** 
 * @return The waiting time between mouse press and mouse release.
 */
private static final int getPostMouseDownDelay(){
  if (postMouseDown >= 0) {
    return postMouseDown;
  }
  int externalWait=getExternalWait(EXTERNAL_PROPERTY_NAME_PRE_MOUSE_UP_DELAY);
  if (externalWait != NO_EXTERNAL_WAIT) {
    postMouseDown=externalWait;
    return postMouseDown;
  }
  postMouseDown=DEFAULT_DELAY_POST_MOUSE_DOWN;
  return postMouseDown;
}
Program: 96378
Project: 96378
Buggy source:
/** 
 * clears the content of client
 * @param onlyUI true to clear the client UI part only
 */
public static void clearClient(boolean onlyUI){
  if (!onlyUI) {
    TestExecution.getInstance().stopExecution();
    GeneralStorage.getInstance().reset();
  }
  Plugin.getDisplay().syncExec(new Runnable(){
    public void run(){
      Plugin.setProjectNameInTitlebar(null,null,null);
      Plugin.closeAllOpenedJubulaEditors();
      if (Plugin.getView(Constants.TESTRE_ID) != null) {
        ((TestResultTreeView)Plugin.getView(Constants.TESTRE_ID)).clear();
      }
      if (Plugin.getView(Constants.TC_BROWSER_ID) != null) {
        ((TestCaseBrowser)Plugin.getView(Constants.TC_BROWSER_ID)).getTreeViewer().setInput(null);
      }
      if (Plugin.getView(Constants.TS_BROWSER_ID) != null) {
        ((TestSuiteBrowser)Plugin.getView(Constants.TS_BROWSER_ID)).getTreeViewer().setInput(null);
      }
      if (Plugin.getView(Constants.COMPNAMEBROWSER_ID) != null) {
        ((ComponentNameBrowser)Plugin.getView(Constants.COMPNAMEBROWSER_ID)).getTreeViewer().setInput(null);
      }
    }
  }
);
  DataEventDispatcher.getInstance().fireProjectLoadedListener(new NullProgressMonitor());
}

Fixed version (ground truth):
/** 
 * clears the content of client
 */
public static void clearClient(){
  final DataEventDispatcher ded=DataEventDispatcher.getInstance();
  TestExecution.getInstance().stopExecution();
  GeneralStorage gs=GeneralStorage.getInstance();
  if (gs != null && Hibernator.instance() != null) {
    IProjectPO currProj=gs.getProject();
    if (currProj != null) {
      gs.setProject(null);
      ded.fireDataChangedListener(currProj,DataState.Deleted,UpdateState.all);
    }
    gs.reset();
  }
  Plugin.getDisplay().syncExec(new Runnable(){
    public void run(){
      Plugin.setProjectNameInTitlebar(null,null,null);
      Plugin.closeAllOpenedJubulaEditors();
      ded.fireTestresultChanged(TestresultState.Refresh);
      setTreeViewerInputNull(Constants.TESTRE_ID);
      setTreeViewerInputNull(Constants.TC_BROWSER_ID);
      setTreeViewerInputNull(Constants.TS_BROWSER_ID);
      setTreeViewerInputNull(Constants.COMPNAMEBROWSER_ID);
    }
  }
);
  ded.fireProjectLoadedListener(new NullProgressMonitor());
}
Program: 96379
Project: 96379
Buggy source:
/** 
 * @param treeViewer the treeViewer to set
 */
public void setTreeViewer(TreeViewer treeViewer){
  m_treeViewer=treeViewer;
}

Fixed version (ground truth):
/** 
 * @param treeViewer the treeViewer to set
 */
private void setTreeViewer(TreeViewer treeViewer){
  m_treeViewer=treeViewer;
}
Program: 96380
Project: 96380
Buggy source:
/** 
 * refresh view
 */
public void refreshView(){
  m_tableViewer.getControl().getDisplay().syncExec(new Runnable(){
    public void run(){
      List<ITestResultSummaryPO> metaList;
      try {
        int maxNoOfDays=Plugin.getDefault().getPreferenceStore().getInt(Constants.MAX_NUMBER_OF_DAYS_KEY);
        Date startTime=DateUtils.addDays(new Date(),maxNoOfDays * -1);
        metaList=TestResultSummaryPM.findAllTestResultSummaries(startTime);
        if (Hibernator.instance() != null) {
          m_detailedSummaryIds=TestResultPM.computeTestresultIdsWithDetails(GeneralStorage.getInstance().getMasterSession());
        }
        if (metaList != null) {
          m_tableViewer.setInput(metaList.toArray());
        }
      }
 catch (      JBException e) {
        String msg=Messages.CantLoadMetadataFromDatabase;
        log.error(msg,e);
        showErrorDialog(msg);
      }
    }
  }
);
  ISelection s=m_tableViewer.getSelection();
  m_tableViewer.setSelection(null);
  m_tableViewer.setSelection(s);
}

Fixed version (ground truth):
/** 
 * refresh view
 */
public void refreshView(){
  m_tableViewer.getControl().getDisplay().syncExec(new Runnable(){
    public void run(){
      List<ITestResultSummaryPO> metaList;
      try {
        int maxNoOfDays=Plugin.getDefault().getPreferenceStore().getInt(Constants.MAX_NUMBER_OF_DAYS_KEY);
        Date startTime=DateUtils.addDays(new Date(),maxNoOfDays * -1);
        metaList=TestResultSummaryPM.findAllTestResultSummaries(startTime);
        if (Hibernator.instance() != null) {
          m_detailedSummaryIds=TestResultPM.computeTestresultIdsWithDetails(GeneralStorage.getInstance().getMasterSession());
        }
        if (metaList != null) {
          m_tableViewer.setInput(metaList.toArray());
        }
      }
 catch (      JBException e) {
        String msg=Messages.CantLoadMetadataFromDatabase;
        log.error(msg,e);
        showErrorDialog(msg);
      }
      ISelection s=m_tableViewer.getSelection();
      m_tableViewer.setSelection(null);
      m_tableViewer.setSelection(s);
    }
  }
);
}
Program: 96381
Project: 96381
Buggy source:
/** 
 * refresh view
 */
public void refreshView(){
  m_tableViewer.getControl().getDisplay().syncExec(new Runnable(){
    public void run(){
      List<ITestResultSummaryPO> metaList;
      try {
        int maxNoOfDays=Plugin.getDefault().getPreferenceStore().getInt(Constants.MAX_NUMBER_OF_DAYS_KEY);
        Date startTime=DateUtils.addDays(new Date(),maxNoOfDays * -1);
        metaList=TestResultSummaryPM.findAllTestResultSummaries(startTime);
        if (Hibernator.instance() != null) {
          m_detailedSummaryIds=TestResultPM.computeTestresultIdsWithDetails(GeneralStorage.getInstance().getMasterSession());
        }
        if (metaList != null) {
          m_tableViewer.setInput(metaList.toArray());
        }
      }
 catch (      JBException e) {
        String msg=Messages.CantLoadMetadataFromDatabase;
        log.error(msg,e);
        showErrorDialog(msg);
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * refresh view
 */
public void refreshView(){
  m_tableViewer.getControl().getDisplay().syncExec(new Runnable(){
    public void run(){
      List<ITestResultSummaryPO> metaList;
      try {
        int maxNoOfDays=Plugin.getDefault().getPreferenceStore().getInt(Constants.MAX_NUMBER_OF_DAYS_KEY);
        Date startTime=DateUtils.addDays(new Date(),maxNoOfDays * -1);
        metaList=TestResultSummaryPM.findAllTestResultSummaries(startTime);
        if (Hibernator.instance() != null) {
          m_detailedSummaryIds=TestResultPM.computeTestresultIdsWithDetails(GeneralStorage.getInstance().getMasterSession());
        }
        if (metaList != null) {
          m_tableViewer.setInput(metaList.toArray());
        }
      }
 catch (      JBException e) {
        String msg=Messages.CantLoadMetadataFromDatabase;
        log.error(msg,e);
        showErrorDialog(msg);
      }
    }
  }
);
  ISelection s=m_tableViewer.getSelection();
  m_tableViewer.setSelection(null);
  m_tableViewer.setSelection(s);
}
Program: 96382
Project: 96382
Buggy source:
/** 
 * execute delete-test-result of summary without commit
 * @param session Session
 * @param resultId id of testresult-summary-entry, or <code>null</code> if all test results should be deleted.
 */
@SuppressWarnings("String_Node_Str") public static final void executeDeleteTestresultOfSummary(EntityManager session,Long resultId){
  boolean isDeleteAll=resultId == null;
  List<Number> paramIdList=null;
  if (!isDeleteAll) {
    Query paramIdQuery=session.createNativeQuery("String_Node_Str" + "String_Node_Str");
    paramIdQuery.setParameter("String_Node_Str",resultId);
    paramIdList=paramIdQuery.getResultList();
  }
  StringBuilder paramListQueryBuilder=new StringBuilder();
  paramListQueryBuilder.append("String_Node_Str");
  if (!isDeleteAll) {
    paramListQueryBuilder.append("String_Node_Str" + "String_Node_Str");
  }
  Query paramListQuery=session.createNativeQuery(paramListQueryBuilder.toString());
  if (!isDeleteAll) {
    paramListQuery.setParameter("String_Node_Str",resultId);
  }
  paramListQuery.executeUpdate();
  StringBuilder resultQueryBuilder=new StringBuilder();
  resultQueryBuilder.append("String_Node_Str");
  if (!isDeleteAll) {
    resultQueryBuilder.append("String_Node_Str");
  }
  Query resultQuery=session.createQuery(resultQueryBuilder.toString());
  if (!isDeleteAll) {
    resultQuery.setParameter("String_Node_Str",resultId);
  }
  resultQuery.executeUpdate();
  String paramQueryBaseString="String_Node_Str";
  if (isDeleteAll) {
    session.createQuery(paramQueryBaseString).executeUpdate();
  }
 else {
    if (paramIdList != null) {
      for (      Number paramId : paramIdList) {
        Query paramQuery=session.createQuery(paramQueryBaseString + "String_Node_Str");
        paramQuery.setParameter("String_Node_Str",paramId.longValue());
        paramQuery.executeUpdate();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * execute delete-test-result of summary without commit
 * @param session Session
 * @param resultId id of testresult-summary-entry, or <code>null</code> if all test results should be deleted.
 */
public static final void executeDeleteTestresultOfSummary(EntityManager session,Long resultId){
  boolean isDeleteAll=resultId == null;
  String paramQueryBaseString="String_Node_Str";
  if (isDeleteAll) {
    session.createNativeQuery(paramQueryBaseString).executeUpdate();
  }
 else {
    Query paramQuery=session.createNativeQuery(paramQueryBaseString + "String_Node_Str");
    paramQuery.setParameter("String_Node_Str",resultId);
    paramQuery.executeUpdate();
  }
  StringBuilder resultQueryBuilder=new StringBuilder();
  resultQueryBuilder.append("String_Node_Str");
  if (!isDeleteAll) {
    resultQueryBuilder.append("String_Node_Str");
  }
  Query resultQuery=session.createQuery(resultQueryBuilder.toString());
  if (!isDeleteAll) {
    resultQuery.setParameter("String_Node_Str",resultId);
  }
  resultQuery.executeUpdate();
}
Program: 96383
Project: 96383
Buggy source:
public void run(){
  NagDialog.runNagDialog(null,"String_Node_Str",ContextHelpIds.DATABASE_MIGRATION_ASSISTANT);
}

Fixed version (ground truth):
public void run(){
  NagDialog.runNagDialog(null,Messages.DatabaseMigrationAssistantFinalInfo,ContextHelpIds.DATABASE_MIGRATION_ASSISTANT);
}
Program: 96384
Project: 96384
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean performFinish(){
  try {
    getContainer().run(true,false,new IRunnableWithProgress(){
      @SuppressWarnings("String_Node_Str") public void run(      IProgressMonitor monitor) throws InterruptedException {
        monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
        try {
          Hibernator.migrateDatabaseStructure();
          m_wasMigrationSuccessful=true;
          ImportFileBP.getInstance().importProjects(m_importProjectsPage,monitor);
          Plugin.getDisplay().asyncExec(new Runnable(){
            public void run(){
              NagDialog.runNagDialog(null,"String_Node_Str",ContextHelpIds.DATABASE_MIGRATION_ASSISTANT);
            }
          }
);
        }
 catch (        JBFatalException e) {
          LOG.error(Messages.AnErrorOccurredDuringMigration + StringConstants.DOT,e);
        }
catch (        JBException e) {
          LOG.error(Messages.AnErrorOccurredDuringMigration + StringConstants.DOT,e);
        }
 finally {
          monitor.done();
        }
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    LOG.error(Messages.AnErrorOccurredDuringMigration + StringConstants.DOT,e);
  }
catch (  InterruptedException e) {
    LOG.error(Messages.AnErrorOccurredDuringMigration + StringConstants.DOT,e);
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean performFinish(){
  try {
    getContainer().run(true,false,new IRunnableWithProgress(){
      @SuppressWarnings("String_Node_Str") public void run(      IProgressMonitor monitor) throws InterruptedException {
        monitor.beginTask("String_Node_Str",IProgressMonitor.UNKNOWN);
        try {
          Hibernator.migrateDatabaseStructure();
          m_wasMigrationSuccessful=true;
          ImportFileBP.getInstance().importProjects(m_importProjectsPage,monitor);
          Plugin.getDisplay().asyncExec(new Runnable(){
            public void run(){
              NagDialog.runNagDialog(null,Messages.DatabaseMigrationAssistantFinalInfo,ContextHelpIds.DATABASE_MIGRATION_ASSISTANT);
            }
          }
);
        }
 catch (        JBFatalException e) {
          LOG.error(Messages.AnErrorOccurredDuringMigration + StringConstants.DOT,e);
        }
catch (        JBException e) {
          LOG.error(Messages.AnErrorOccurredDuringMigration + StringConstants.DOT,e);
        }
 finally {
          monitor.done();
        }
      }
    }
);
  }
 catch (  InvocationTargetException e) {
    LOG.error(Messages.AnErrorOccurredDuringMigration + StringConstants.DOT,e);
  }
catch (  InterruptedException e) {
    LOG.error(Messages.AnErrorOccurredDuringMigration + StringConstants.DOT,e);
  }
  return true;
}
Program: 96385
Project: 96385
Buggy source:
/** 
 * delete all database objects which not associated with project
 * @param s session to use for delete operation
 * @param p project, whose independent objects to be deleted
 * @throws PMException in case of failed delete operation
 * @throws ProjectDeletedException in case of already deleted exception
 */
private static void deleteProjectIndependentDBObjects(EntityManager s,IProjectPO p) throws PMException, ProjectDeletedException {
  UsedToolkitBP.getInstance().deleteToolkitsFromDB(s,p.getId(),false);
  ParamNamePM.deleteParamNames(s,p.getId(),false);
  for (  IAUTMainPO aut : p.getAutMainList()) {
    if (aut.getObjMap() != null) {
      for (      IObjectMappingAssoziationPO assoc : aut.getObjMap().getMappings()) {
        s.remove(assoc);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * delete all database objects which not associated with project
 * @param s session to use for delete operation
 * @param p project, whose independent objects to be deleted
 * @throws PMException in case of failed delete operation
 * @throws ProjectDeletedException in case of already deleted exception
 */
private static void deleteProjectIndependentDBObjects(EntityManager s,IProjectPO p) throws PMException, ProjectDeletedException {
  UsedToolkitBP.getInstance().deleteToolkitsFromDB(s,p.getId(),false);
  ParamNamePM.deleteParamNames(s,p.getId(),false);
}
Program: 96386
Project: 96386
Buggy source:
/** 
 * initializes the client
 * @return intExit Code
 */
public int doRun(){
  int exitCode=0;
  try {
    ExecutionController controller=ExecutionController.getInstance();
    if (isNoRun()) {
      controller.simulateJob();
    }
 else {
      if (!controller.executeJob()) {
        exitCode=1;
      }
    }
  }
 catch (  CommunicationException e) {
    log.error(e.getLocalizedMessage(),e);
    printConsoleError(e.getMessage());
  }
catch (  IllegalArgumentException e) {
    log.error(e);
    printConsoleError(e.getMessage());
  }
catch (  JBFatalException e) {
    log.error(e);
    printConsoleError(e.getMessage());
  }
catch (  Throwable t) {
    log.error(ClientStrings.ERR_UNEXPECTED,t);
    printConsoleError(t.getMessage());
  }
  shutdown();
  if (isErrorOccured()) {
    exitCode=1;
  }
  printConsoleLn(Messages.ClientExitCode + exitCode,true);
  return exitCode;
}

Fixed version (ground truth):
/** 
 * initializes the client
 * @return intExit Code
 */
public int doRun(){
  int exitCode=EXIT_CODE_OK;
  try {
    ExecutionController controller=ExecutionController.getInstance();
    if (isNoRun()) {
      controller.simulateJob();
    }
 else {
      if (!controller.executeJob()) {
        exitCode=EXIT_CODE_ERROR;
      }
    }
  }
 catch (  CommunicationException e) {
    log.error(e.getLocalizedMessage(),e);
    printlnConsoleError(e.getMessage());
  }
catch (  IllegalArgumentException e) {
    log.error(e);
    printlnConsoleError(e.getMessage());
  }
catch (  JBFatalException e) {
    log.error(e);
    printlnConsoleError(e.getMessage());
  }
catch (  Throwable t) {
    log.error(ClientStrings.ERR_UNEXPECTED,t);
    printlnConsoleError(t.getMessage());
  }
  shutdown();
  return exitCode;
}
Program: 96387
Project: 96387
Buggy source:
/** 
 * {@inheritDoc}
 */
public void start(BundleContext context) throws Exception {
  try {
    super.start(context);
  }
 catch (  IllegalArgumentException iae) {
    AbstractCmdlineClient.printConsoleError(iae.getMessage());
    throw iae;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void start(BundleContext context) throws Exception {
  try {
    super.start(context);
  }
 catch (  IllegalArgumentException iae) {
    AbstractCmdlineClient.printlnConsoleError(iae.getMessage());
    throw iae;
  }
}
Program: 96388
Project: 96388
Buggy source:
/** 
 * executes the complete test
 * @throws CommunicationException Error
 * @return boolean true if all testsuites completed successfully
 */
public boolean executeJob() throws CommunicationException {
  WatchdogTimer timer=null;
  if (m_job.getTimeout() > 0) {
    timer=new WatchdogTimer(m_job.getTimeout());
    timer.start();
  }
  IClientTest clientTest=ClientTestFactory.getClientTest();
  clientTest.connectToServer(m_job.getServer(),m_job.getPort());
  if (!ServerConnection.getInstance().isConnected()) {
    throw new CommunicationException(Messages.ConnectionToAUT_Agent,MessageIDs.E_COMMUNICATOR_CONNECTION);
  }
  clientTest.setRelevantFlag(m_job.isRelevant());
  prepareExecution();
  m_idle=true;
  if (m_shutdown) {
    AbstractCmdlineClient.printConsoleLn(Messages.ReceivedShutdownCommand,true);
    endTestExecution();
  }
  try {
    if (m_rmiBase != null) {
      doClcService();
    }
 else     if (m_job.getTestJob() != null) {
      ensureAutIsStarted(m_job.getActualTestSuite(),m_job.getAutConfig());
      doSingleJob();
    }
 else {
      ensureAutIsStarted(m_job.getActualTestSuite(),m_job.getAutConfig());
      doTestSuites();
    }
  }
 catch (  ToolkitPluginException e1) {
    AbstractCmdlineClient.printConsoleError(Messages.ExecutionControllerAUT + Messages.ErrorMessageAUT_TOOLKIT_NOT_AVAILABLE);
  }
  if (timer != null) {
    timer.abort();
  }
  return isNoErrorWhileExecution();
}

Fixed version (ground truth):
/** 
 * executes the complete test
 * @throws CommunicationException Error
 * @return boolean true if all testsuites completed successfully
 */
public boolean executeJob() throws CommunicationException {
  WatchdogTimer timer=null;
  if (m_job.getTimeout() > 0) {
    timer=new WatchdogTimer(m_job.getTimeout());
    timer.start();
  }
  IClientTest clientTest=ClientTestFactory.getClientTest();
  clientTest.connectToServer(m_job.getServer(),m_job.getPort());
  if (!ServerConnection.getInstance().isConnected()) {
    throw new CommunicationException(Messages.ConnectionToAUT_Agent,MessageIDs.E_COMMUNICATOR_CONNECTION);
  }
  clientTest.setRelevantFlag(m_job.isRelevant());
  prepareExecution();
  m_idle=true;
  if (m_shutdown) {
    AbstractCmdlineClient.printConsoleLn(Messages.ReceivedShutdownCommand,true);
    endTestExecution();
  }
  try {
    if (m_rmiBase != null) {
      doClcService();
    }
 else     if (m_job.getTestJob() != null) {
      ensureAutIsStarted(m_job.getActualTestSuite(),m_job.getAutConfig());
      doSingleJob();
    }
 else {
      ensureAutIsStarted(m_job.getActualTestSuite(),m_job.getAutConfig());
      doTestSuites();
    }
  }
 catch (  ToolkitPluginException e1) {
    AbstractCmdlineClient.printlnConsoleError(Messages.ExecutionControllerAUT + Messages.ErrorMessageAUT_TOOLKIT_NOT_AVAILABLE);
  }
  if (timer != null) {
    timer.abort();
  }
  return isNoErrorWhileExecution();
}
Program: 96389
Project: 96389
Buggy source:
/** 
 * {@inheritDoc}
 */
public void stateChanged(TestExecutionEvent event){
  if (event.getException() != null && event.getException() instanceof JBException) {
    String errorMsg=I18n.getString(event.getException().getMessage(),true);
    AbstractCmdlineClient.printConsoleError(errorMsg);
  }
switch (event.getState()) {
case TestExecutionEvent.TEST_EXEC_RESULT_TREE_READY:
    TestExecution.getInstance().getTrav().addExecStackModificationListener(m_progress);
  break;
case TestExecutionEvent.TEST_EXEC_START:
case TestExecutionEvent.TEST_EXEC_RESTART:
break;
case TestExecutionEvent.TEST_EXEC_FINISHED:
AbstractCmdlineClient.printConsoleLn(Messages.ExecutionControllerTestSuiteEnd,true);
m_job.getNextTestSuite();
m_clcServiceImpl.tsDone(isNoErrorWhileExecution() ? 0 : 1);
break;
case TestExecutionEvent.TEST_EXEC_PAUSED:
TestExecution.getInstance().pauseExecution(false);
break;
case TestExecutionEvent.TEST_EXEC_ERROR:
case TestExecutionEvent.TEST_EXEC_FAILED:
case TestExecutionEvent.TEST_EXEC_STOP:
m_job.getNextTestSuite();
break;
default :
break;
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void stateChanged(TestExecutionEvent event){
  if (event.getException() != null && event.getException() instanceof JBException) {
    String errorMsg=I18n.getString(event.getException().getMessage(),true);
    AbstractCmdlineClient.printlnConsoleError(errorMsg);
  }
switch (event.getState()) {
case TestExecutionEvent.TEST_EXEC_RESULT_TREE_READY:
    TestExecution.getInstance().getTrav().addExecStackModificationListener(m_progress);
  break;
case TestExecutionEvent.TEST_EXEC_START:
case TestExecutionEvent.TEST_EXEC_RESTART:
break;
case TestExecutionEvent.TEST_EXEC_FINISHED:
AbstractCmdlineClient.printConsoleLn(Messages.ExecutionControllerTestSuiteEnd,true);
m_job.getNextTestSuite();
m_clcServiceImpl.tsDone(isNoErrorWhileExecution() ? 0 : 1);
break;
case TestExecutionEvent.TEST_EXEC_PAUSED:
TestExecution.getInstance().pauseExecution(false);
break;
case TestExecutionEvent.TEST_EXEC_ERROR:
case TestExecutionEvent.TEST_EXEC_FAILED:
case TestExecutionEvent.TEST_EXEC_STOP:
m_job.getNextTestSuite();
break;
default :
break;
}
}
Program: 96390
Project: 96390
Buggy source:
/** 
 * {@inheritDoc}
 */
public void start(BundleContext context) throws Exception {
  plugin=this;
  try {
    super.start(context);
  }
 catch (  IllegalArgumentException iae) {
    AbstractCmdlineClient.printConsoleError(iae.getMessage());
    throw iae;
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void start(BundleContext context) throws Exception {
  plugin=this;
  try {
    super.start(context);
  }
 catch (  IllegalArgumentException iae) {
    AbstractCmdlineClient.printlnConsoleError(iae.getMessage());
    throw iae;
  }
}
Program: 96391
Project: 96391
Buggy source:
/** 
 * Import a project from an export file
 * @param fileName export file name
 * @param exportDir directory to use
 */
private void importProject(String fileName,String exportDir){
  File impFile=new File(fileName);
  if (!impFile.isAbsolute()) {
    impFile=new File(new File(exportDir),fileName);
  }
  try {
    FileStorageBP.importFiles(new String[]{impFile.getAbsolutePath()},new NullProgressMonitor(),this,false);
  }
 catch (  PMException pme) {
    System.err.println(pme.getLocalizedMessage());
  }
catch (  ProjectDeletedException gdpde) {
    System.err.println(gdpde.getLocalizedMessage());
  }
}

Fixed version (ground truth):
/** 
 * Import a project from an export file
 * @param fileName export file name
 * @param exportDir directory to use
 */
private void importProject(String fileName,String exportDir){
  File impFile=new File(fileName);
  if (!impFile.isAbsolute()) {
    impFile=new File(new File(exportDir),fileName);
  }
  try {
    FileStorageBP.importFiles(new String[]{impFile.getAbsolutePath()},new NullProgressMonitor(),this,false);
  }
 catch (  PMException pme) {
    writeErrorLine(pme.getLocalizedMessage());
  }
catch (  ProjectDeletedException gdpde) {
    writeErrorLine(gdpde.getLocalizedMessage());
  }
}
Program: 96392
Project: 96392
Buggy source:
/** 
 * Report a missing project
 * @param name project name
 * @param version illegal project version
 */
private void reportMissingProject(String name,String version){
  StringBuilder msg=new StringBuilder(Messages.DBToolMissingProject);
  msg.append(StringConstants.SPACE);
  msg.append(name);
  msg.append(StringConstants.SPACE + StringConstants.LEFT_BRACKET);
  msg.append(version);
  msg.append(StringConstants.RIGHT_BRACKET);
  printConsoleError(msg.toString());
}

Fixed version (ground truth):
/** 
 * Report a missing project
 * @param name project name
 * @param version illegal project version
 */
private void reportMissingProject(String name,String version){
  StringBuilder msg=new StringBuilder(Messages.DBToolMissingProject);
  msg.append(StringConstants.SPACE);
  msg.append(name);
  msg.append(StringConstants.SPACE + StringConstants.LEFT_BRACKET);
  msg.append(version);
  msg.append(StringConstants.RIGHT_BRACKET);
  printlnConsoleError(msg.toString());
}
Program: 96393
Project: 96393
Buggy source:
/** 
 * The deletion of the projct failed
 * @param name project name
 * @param version project version
 * @param e error condition
 */
private void reportDeleteFailed(String name,String version,Exception e){
  StringBuilder msg=new StringBuilder(Messages.DBToolDeleteFailed);
  msg.append(StringConstants.SPACE);
  msg.append(name);
  msg.append(StringConstants.SPACE + StringConstants.LEFT_BRACKET);
  msg.append(version);
  msg.append(StringConstants.RIGHT_BRACKET);
  msg.append(StringConstants.NEWLINE);
  msg.append(e.getLocalizedMessage());
  printConsoleError(msg.toString());
}

Fixed version (ground truth):
/** 
 * The deletion of the projct failed
 * @param name project name
 * @param version project version
 * @param e error condition
 */
private void reportDeleteFailed(String name,String version,Exception e){
  StringBuilder msg=new StringBuilder(Messages.DBToolDeleteFailed);
  msg.append(StringConstants.SPACE);
  msg.append(name);
  msg.append(StringConstants.SPACE + StringConstants.LEFT_BRACKET);
  msg.append(version);
  msg.append(StringConstants.RIGHT_BRACKET);
  msg.append(StringConstants.NEWLINE);
  msg.append(e.getLocalizedMessage());
  printlnConsoleError(msg.toString());
}