nus-yam/ex-repair huggingface dataset:
Program: 94686
Project: 94686
Buggy source:
public void handleEvent(IContainerEvent event){
  Activator activator=Activator.getDefault();
  if (activator == null)   return;
  final IContainerManager containerManager=activator.getContainerManager();
  if (containerManager == null)   return;
  IContainer container=containerManager.getContainer(event.getLocalContainerID());
  if (container == null)   return;
  if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent) {
    IChannelContainerAdapter cca=(IChannelContainerAdapter)container.getAdapter(IChannelContainerAdapter.class);
    if (cca == null)     return;
    ID containerID=container.getID();
    if (event instanceof IContainerConnectedEvent) {
      try {
        activator.addDocShare(containerID,cca);
      }
 catch (      ECFException e) {
        activator.getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ECFStart_ERROR_DOCUMENT_SHARE_NOT_CREATED,container.getID()),null));
      }
    }
 else     if (event instanceof IContainerDisconnectedEvent || event instanceof IContainerEjectedEvent) {
      DocShare docShare=Activator.getDefault().removeDocShare(containerID);
      if (docShare != null) {
        docShare.dispose();
      }
    }
  }
 else   if (event instanceof IContainerDisposeEvent) {
    containerManager.removeListener(containerManagerListener);
    container.removeListener(containerListener);
  }
}

Fixed version (ground truth):
public void handleEvent(IContainerEvent event){
  Activator activator=Activator.getDefault();
  if (activator == null)   return;
  final IContainerManager containerManager=activator.getContainerManager();
  if (containerManager == null)   return;
  IContainer container=containerManager.getContainer(event.getLocalContainerID());
  if (container == null)   return;
  if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent || event instanceof IContainerEjectedEvent) {
    IChannelContainerAdapter cca=(IChannelContainerAdapter)container.getAdapter(IChannelContainerAdapter.class);
    if (cca == null)     return;
    ID containerID=container.getID();
    if (event instanceof IContainerConnectedEvent) {
      try {
        activator.addDocShare(containerID,cca);
      }
 catch (      ECFException e) {
        activator.getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ECFStart_ERROR_DOCUMENT_SHARE_NOT_CREATED,container.getID()),null));
      }
    }
 else     if (event instanceof IContainerDisconnectedEvent || event instanceof IContainerEjectedEvent) {
      DocShare docShare=Activator.getDefault().removeDocShare(containerID);
      if (docShare != null) {
        docShare.dispose();
      }
    }
  }
 else   if (event instanceof IContainerDisposeEvent) {
    containerManager.removeListener(containerManagerListener);
    container.removeListener(containerListener);
  }
}
Program: 94688
Project: 94688
Buggy source:
public void testReceivePartialFile3() throws Exception {
  try {
    testReceiveHttp(10,5,HTTP_RETRIEVE);
    fail();
  }
 catch (  final Exception e) {
  }
}

Fixed version (ground truth):
public void testReceivePartialFile3() throws Exception {
  try {
    testReceiveHttp(10,5,HTTP_RETRIEVE);
    fail();
  }
 catch (  final IncomingFileTransferException e) {
    final Throwable t=e.getCause();
    if (t != null && t instanceof InvalidFileRangeSpecificationException)     return;
    fail();
  }
}
Program: 94689
Project: 94689
Buggy source:
public void handleTransferEvent(IFileTransferEvent event){
  if (event instanceof IIncomingFileTransferReceiveResumedEvent) {
    try {
      IIncomingFileTransferReceiveResumedEvent rse=(IIncomingFileTransferReceiveResumedEvent)event;
      session=rse.receive(outs);
    }
 catch (    Exception e) {
      fail(e.getLocalizedMessage());
    }
  }
 else   if (event instanceof IIncomingFileTransferReceiveStartEvent) {
    IIncomingFileTransferReceiveStartEvent rse=(IIncomingFileTransferReceiveStartEvent)event;
    try {
      outs=new FileOutputStream(FILENAME);
      session=rse.receive(outs);
      pausable=(IFileTransferPausable)session.getAdapter(IFileTransferPausable.class);
      if (pausable == null)       fail("String_Node_Str");
    }
 catch (    IOException e) {
      fail(e.getLocalizedMessage());
    }
  }
 else   if (event instanceof IIncomingFileTransferReceiveDataEvent) {
    System.out.println("String_Node_Str" + event);
  }
 else   if (event instanceof IIncomingFileTransferReceivePausedEvent) {
    System.out.println("String_Node_Str" + event);
  }
 else   if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
    closeOutputStream();
    System.out.println("String_Node_Str" + event);
synchronized (notify) {
      isDone=true;
      notify.notify();
    }
  }
}

Fixed version (ground truth):
public void handleTransferEvent(IFileTransferEvent event){
  if (event instanceof IIncomingFileTransferReceiveResumedEvent) {
    try {
      final IIncomingFileTransferReceiveResumedEvent rse=(IIncomingFileTransferReceiveResumedEvent)event;
      session=rse.receive(outs);
    }
 catch (    final Exception e) {
      fail(e.getLocalizedMessage());
    }
  }
 else   if (event instanceof IIncomingFileTransferReceiveStartEvent) {
    final IIncomingFileTransferReceiveStartEvent rse=(IIncomingFileTransferReceiveStartEvent)event;
    try {
      outs=new FileOutputStream(FILENAME);
      session=rse.receive(outs);
      pausable=(IFileTransferPausable)session.getAdapter(IFileTransferPausable.class);
      if (pausable == null)       fail("String_Node_Str");
    }
 catch (    final IOException e) {
      fail(e.getLocalizedMessage());
    }
  }
 else   if (event instanceof IIncomingFileTransferReceiveDataEvent) {
    System.out.println("String_Node_Str" + event);
  }
 else   if (event instanceof IIncomingFileTransferReceivePausedEvent) {
    System.out.println("String_Node_Str" + event);
  }
 else   if (event instanceof IIncomingFileTransferReceiveDoneEvent) {
    closeOutputStream();
    System.out.println("String_Node_Str" + event);
synchronized (notify) {
      isDone=true;
      notify.notify();
    }
  }
}
Program: 94690
Project: 94690
Buggy source:
public void disconnect(){
synchronized (getConnectLock()) {
    if (isConnected()) {
      final ID groupID=getConnectedID();
      fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (connection) {
        try {
          connection.sendSynch(groupID,serialize(ContainerMessage.createLeaveGroupMessage(getID(),groupID,getNextSequenceNumber(),getLeaveData(groupID))));
        }
 catch (        final Exception e) {
          ProviderPlugin.getDefault().log(new Status(IStatus.ERROR,ProviderPlugin.PLUGIN_ID,IStatus.ERROR,"String_Node_Str",e));
        }
synchronized (getGroupMembershipLock()) {
          handleLeave(groupID,connection);
        }
      }
      fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
    }
  }
}

Fixed version (ground truth):
protected void disconnect(Throwable exception){
synchronized (getConnectLock()) {
    if (isConnected()) {
      final ID groupID=getConnectedID();
      if (exception == null)       fireContainerEvent(new ContainerDisconnectingEvent(this.getID(),groupID));
synchronized (connection) {
        try {
          connection.sendSynch(groupID,serialize(ContainerMessage.createLeaveGroupMessage(getID(),groupID,getNextSequenceNumber(),getLeaveData(groupID))));
        }
 catch (        final Exception e) {
          ProviderPlugin.getDefault().log(new Status(IStatus.ERROR,ProviderPlugin.PLUGIN_ID,IStatus.ERROR,"String_Node_Str",e));
        }
synchronized (getGroupMembershipLock()) {
          handleLeave(groupID,connection);
        }
      }
      if (exception == null)       fireContainerEvent(new ContainerDisconnectedEvent(this.getID(),groupID));
 else       fireContainerEvent(new ContainerEjectedEvent(this.getID(),groupID,exception));
    }
  }
}
Program: 94691
Project: 94691
Buggy source:
protected void processDisconnect(DisconnectEvent evt){
  disconnect();
}

Fixed version (ground truth):
protected void processDisconnect(DisconnectEvent evt){
  disconnect(evt.getException());
}
Program: 94692
Project: 94692
Buggy source:
public void connectionClosed(){
  handleConnectionClosed(null);
}

Fixed version (ground truth):
public void connectionClosed(){
  handleConnectionClosed(new IOException("String_Node_Str"));
}
Program: 94693
Project: 94693
Buggy source:
public void disconnect() throws IOException {
  trace("String_Node_Str");
  if (socket != null) {
    socket.close();
    socket=null;
  }
}

Fixed version (ground truth):
public void disconnect(){
  trace("String_Node_Str");
  if (socket != null) {
    try {
      socket.close();
    }
 catch (    IOException e) {
    }
    socket=null;
  }
}
Program: 94694
Project: 94694
Buggy source:
public Object connect(ID remote,Object data,int timeout) throws IOException {
  trace("String_Node_Str" + remote + "String_Node_Str"+ data+ "String_Node_Str"+ timeout+ "String_Node_Str");
  if (socket != null) {
    throw new ConnectException("String_Node_Str" + getURL(null));
  }
  URL url=new URL(remote.getName());
  int port=url.getPort() != -1 ? url.getPort() : DEFAULT_PORT;
  socket=new Socket(url.getHost(),port);
  return null;
}

Fixed version (ground truth):
public Object connect(ID remote,Object data,int timeout) throws ECFException {
  try {
    trace("String_Node_Str" + remote + "String_Node_Str"+ data+ "String_Node_Str"+ timeout+ "String_Node_Str");
    if (socket != null) {
      throw new ECFException("String_Node_Str" + getURL(null));
    }
    URL url=new URL(remote.getName());
    int port=url.getPort() != -1 ? url.getPort() : DEFAULT_PORT;
    socket=new Socket(url.getHost(),port);
  }
 catch (  IOException e) {
    throw new ECFException(e);
  }
  return null;
}
Program: 94695
Project: 94695
Buggy source:
public void widgetSelected(SelectionEvent e){
  verifyEmail();
}

Fixed version (ground truth):
public void widgetSelected(SelectionEvent e){
  verify();
}
Program: 94696
Project: 94696
Buggy source:
public void widgetDefaultSelected(SelectionEvent e){
  verifyEmail();
}

Fixed version (ground truth):
public void widgetDefaultSelected(SelectionEvent e){
  verify();
}
Program: 94697
Project: 94697
Buggy source:
public void modifyText(ModifyEvent e){
  verifyPassword();
}

Fixed version (ground truth):
public void modifyText(ModifyEvent e){
  verify();
}
Program: 94698
Project: 94698
Buggy source:
private void addListeners(){
  emailText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      verifyEmail();
    }
  }
);
  emailText.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
      verifyEmail();
    }
    public void widgetSelected(    SelectionEvent e){
      verifyEmail();
    }
  }
);
  passwordText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      verifyPassword();
    }
  }
);
}

Fixed version (ground truth):
private void addListeners(){
  emailText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      verify();
    }
  }
);
  emailText.addSelectionListener(new SelectionListener(){
    public void widgetDefaultSelected(    SelectionEvent e){
      verify();
    }
    public void widgetSelected(    SelectionEvent e){
      verify();
    }
  }
);
  passwordText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      verify();
    }
  }
);
}
Program: 94699
Project: 94699
Buggy source:
public void createControl(Composite parent){
  parent=new Composite(parent,SWT.NONE);
  parent.setLayout(new GridLayout(2,false));
  GridData data=new GridData(SWT.FILL,SWT.CENTER,true,false);
  Label label=new Label(parent,SWT.LEFT);
  label.setText(Messages.MSNConnectWizardPage_EmailAddressLabel);
  emailText=new Combo(parent,SWT.SINGLE | SWT.BORDER | SWT.DROP_DOWN);
  emailText.setLayoutData(data);
  label=new Label(parent,SWT.LEFT);
  label.setText(Messages.MSNConnectWizardPage_PasswordLabel);
  passwordText=new Text(parent,SWT.SINGLE | SWT.PASSWORD | SWT.BORDER);
  passwordText.setLayoutData(data);
  addListeners();
  restoreCombo();
  if (username != null) {
    emailText.setText(username);
    restorePassword(username);
    passwordText.setFocus();
  }
  org.eclipse.jface.dialogs.Dialog.applyDialogFont(parent);
  setControl(parent);
}

Fixed version (ground truth):
public void createControl(Composite parent){
  parent=new Composite(parent,SWT.NONE);
  parent.setLayout(new GridLayout(2,false));
  GridData data=new GridData(SWT.FILL,SWT.CENTER,true,false);
  Label label=new Label(parent,SWT.LEFT);
  label.setText(Messages.MSNConnectWizardPage_EmailAddressLabel);
  emailText=new Combo(parent,SWT.SINGLE | SWT.BORDER | SWT.DROP_DOWN);
  emailText.setLayoutData(data);
  label=new Label(parent,SWT.LEFT);
  label.setText(Messages.MSNConnectWizardPage_PasswordLabel);
  passwordText=new Text(parent,SWT.SINGLE | SWT.PASSWORD | SWT.BORDER);
  passwordText.setLayoutData(data);
  restoreCombo();
  addListeners();
  if (username != null) {
    emailText.setText(username);
    restorePassword(username);
    passwordText.setFocus();
  }
  Dialog.applyDialogFont(parent);
  setControl(parent);
}
Program: 94700
Project: 94700
Buggy source:
public void dispose(){
  if (presenceHelper != null) {
    presenceHelperID=null;
    presenceHelper=null;
  }
  if (chatRoomManager != null)   chatRoomManager.dispose();
  chatRoomManager=null;
  if (accountManager != null)   accountManager.dispose();
  accountManager=null;
  if (outgoingFileTransferContainerAdapter != null)   outgoingFileTransferContainerAdapter.dispose();
  outgoingFileTransferContainerAdapter=null;
  super.dispose();
}

Fixed version (ground truth):
public void dispose(){
  chatRoomManager.dispose();
  accountManager.dispose();
  outgoingFileTransferContainerAdapter.dispose();
  super.dispose();
}
Program: 94701
Project: 94701
Buggy source:
public URLConnection openConnection(URL u) throws IOException {
  throw new IOException(NLS.bind(Messages.Activator_EXCEPTION_URLConnection_CANNOT_BE_CREATED,u.toExternalForm()));
}

Fixed version (ground truth):
public URLConnection openConnection(URL u) throws IOException {
  throw new IOException(NLS.bind("String_Node_Str",u.toExternalForm()));
}
Program: 94705
Project: 94705
Buggy source:
private int getPriority(IConfigurationElement configElement,String warning,String protocol){
  final String priorityString=configElement.getAttribute(PRIORITY_ATTR);
  int priority=DEFAULT_PRIORITY;
  if (priorityString != null) {
    try {
      priority=new Integer(priorityString).intValue();
      priority=(priority < 0) ? 0 : priority;
    }
 catch (    NumberFormatException e) {
      Activator.getDefault().log(new Status(IStatus.WARNING,PLUGIN_ID,IStatus.WARNING,NLS.bind(Messages.Activator_WARNING_PRIORITY_ERROR,new Object[]{warning,protocol,configElement.getDeclaringExtension().getContributor().getName(),priorityString,String.valueOf(DEFAULT_PRIORITY)}),null));
    }
  }
  return priority;
}

Fixed version (ground truth):
private int getPriority(IConfigurationElement configElement,String warning,String protocol){
  final String priorityString=configElement.getAttribute(PRIORITY_ATTR);
  int priority=DEFAULT_PRIORITY;
  if (priorityString != null) {
    try {
      priority=new Integer(priorityString).intValue();
      priority=(priority < 0) ? 0 : priority;
    }
 catch (    NumberFormatException e) {
      Activator.getDefault().log(new Status(IStatus.WARNING,PLUGIN_ID,IStatus.WARNING,NLS.bind("String_Node_Str",new Object[]{warning,protocol,configElement.getDeclaringExtension().getContributor().getName(),priorityString,String.valueOf(DEFAULT_PRIORITY)}),null));
    }
  }
  return priority;
}
Program: 94706
Project: 94706
Buggy source:
public FileTransferInfo(File file,Map properties,String description,String mimeType){
  Assert.isNotNull(file,Messages.BaseFileTransferInfo_File_Not_Null);
  this.file=file;
  this.properties=(properties == null) ? defaultProperties : properties;
  this.description=description;
  this.mimeType=mimeType;
}

Fixed version (ground truth):
public FileTransferInfo(File file,Map properties,String description,String mimeType){
  Assert.isNotNull(file,Messages.BaseFileTransferInfo_File_Not_Null);
  this.file=file;
  this.properties=(properties == null) ? new HashMap() : properties;
  this.description=description;
  this.mimeType=mimeType;
}
Program: 94707
Project: 94707
Buggy source:
public boolean addContainer(IContainer container){
  if (container == null)   return false;
  IPresenceContainerAdapter containerAdapter=(IPresenceContainerAdapter)container.getAdapter(IPresenceContainerAdapter.class);
  if (containerAdapter == null)   return false;
  MultiRosterAccount account=new MultiRosterAccount(this,container,containerAdapter);
  if (!addRosterAccount(account))   return false;
  IRosterManager manager=containerAdapter.getRosterManager();
  try {
    if (setAvailableAction.isChecked() || setOfflineAction.isChecked()) {
      manager.getPresenceSender().sendPresenceUpdate(null,new Presence(null,null,IPresence.Mode.AVAILABLE));
      setOfflineAction.setChecked(false);
      setAvailableAction.setChecked(true);
    }
 else     if (setAwayAction.isChecked()) {
      manager.getPresenceSender().sendPresenceUpdate(null,new Presence(null,null,IPresence.Mode.AWAY));
    }
 else     if (setDNDAction.isChecked()) {
      manager.getPresenceSender().sendPresenceUpdate(null,new Presence(null,null,IPresence.Mode.DND));
    }
 else     if (setInvisibleAction.isChecked()) {
      manager.getPresenceSender().sendPresenceUpdate(null,new Presence(null,null,IPresence.Mode.INVISIBLE));
    }
  }
 catch (  ECFException e) {
    Activator.getDefault().getLog().log(e.getStatus());
  }
  containerAdapter.getRosterManager().addPresenceListener(presenceListener);
  setStatusMenu.setVisible(true);
  getViewSite().getActionBars().getMenuManager().update(true);
  treeViewer.add(treeViewer.getInput(),account.getRoster());
  return true;
}

Fixed version (ground truth):
public boolean addContainer(IContainer container){
  if (container == null)   return false;
  IPresenceContainerAdapter containerAdapter=(IPresenceContainerAdapter)container.getAdapter(IPresenceContainerAdapter.class);
  if (containerAdapter == null)   return false;
  MultiRosterAccount account=new MultiRosterAccount(this,container,containerAdapter);
  if (!addRosterAccount(account)) {
    return false;
  }
  IRosterManager manager=containerAdapter.getRosterManager();
  try {
    if (setAvailableAction.isChecked() || setOfflineAction.isChecked()) {
      manager.getPresenceSender().sendPresenceUpdate(null,new Presence(null,null,IPresence.Mode.AVAILABLE));
      setOfflineAction.setChecked(false);
      setAvailableAction.setChecked(true);
    }
 else     if (setAwayAction.isChecked()) {
      manager.getPresenceSender().sendPresenceUpdate(null,new Presence(null,null,IPresence.Mode.AWAY));
    }
 else     if (setDNDAction.isChecked()) {
      manager.getPresenceSender().sendPresenceUpdate(null,new Presence(null,null,IPresence.Mode.DND));
    }
 else     if (setInvisibleAction.isChecked()) {
      manager.getPresenceSender().sendPresenceUpdate(null,new Presence(null,null,IPresence.Mode.INVISIBLE));
    }
  }
 catch (  ECFException e) {
    Activator.getDefault().getLog().log(e.getStatus());
  }
  containerAdapter.getRosterManager().addPresenceListener(presenceListener);
  setStatusMenu.setVisible(true);
  getViewSite().getActionBars().getMenuManager().update(true);
  treeViewer.add(treeViewer.getInput(),account.getRoster());
  return true;
}
Program: 94708
Project: 94708
Buggy source:
protected void getResponseHeaderValues() throws IOException {
  if (getResponseCode() == -1)   throw new IOException(Messages.HttpClientRetrieveFileTransfer_INVALID_SERVER_RESPONSE_TO_PARTIAL_RANGE_REQUEST);
  Header lastModifiedHeader=getMethod.getResponseHeader(LAST_MODIFIED_HEADER);
  if (lastModifiedHeader != null) {
    lastModifiedTime=getLastModifiedTimeFromHeader();
  }
  setFileLength(getMethod.getResponseContentLength());
  fileid=new FileTransferID(getRetrieveNamespace(),getRemoteFileURL());
  Header contentDispositionHeader=getMethod.getResponseHeader(HttpHelper.CONTENT_DISPOSITION_HEADER);
  if (contentDispositionHeader != null) {
    remoteFileName=HttpHelper.getRemoteFileNameFromContentDispositionHeader(contentDispositionHeader.getValue());
  }
  if (remoteFileName == null) {
    String pathStr=getMethod.getPath();
    if (pathStr != null && pathStr.length() > 0) {
      IPath path=Path.fromPortableString(pathStr);
      if (path.segmentCount() > 0)       remoteFileName=path.lastSegment();
    }
    if (remoteFileName == null)     remoteFileName=super.getRemoteFileName();
  }
}

Fixed version (ground truth):
protected void getResponseHeaderValues() throws IOException {
  if (getResponseCode() == -1)   throw new IOException(Messages.HttpClientRetrieveFileTransfer_INVALID_SERVER_RESPONSE_TO_PARTIAL_RANGE_REQUEST);
  Header lastModifiedHeader=getMethod.getResponseHeader(LAST_MODIFIED_HEADER);
  if (lastModifiedHeader != null) {
    setLastModifiedTime(getLastModifiedTimeFromHeader());
  }
  setFileLength(getMethod.getResponseContentLength());
  fileid=new FileTransferID(getRetrieveNamespace(),getRemoteFileURL());
  Header contentDispositionHeader=getMethod.getResponseHeader(HttpHelper.CONTENT_DISPOSITION_HEADER);
  if (contentDispositionHeader != null) {
    remoteFileName=HttpHelper.getRemoteFileNameFromContentDispositionHeader(contentDispositionHeader.getValue());
  }
  if (remoteFileName == null) {
    String pathStr=getMethod.getPath();
    if (pathStr != null && pathStr.length() > 0) {
      IPath path=Path.fromPortableString(pathStr);
      if (path.segmentCount() > 0)       remoteFileName=path.lastSegment();
    }
    if (remoteFileName == null)     remoteFileName=super.getRemoteFileName();
  }
}
Program: 94709
Project: 94709
Buggy source:
public void handleEvent(IContainerEvent event){
  Activator activator=Activator.getDefault();
  if (activator == null)   return;
  final IContainerManager containerManager=activator.getContainerManager();
  if (containerManager == null)   return;
  IContainer container=containerManager.getContainer(event.getLocalContainerID());
  if (container == null)   return;
  if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent) {
    IChannelContainerAdapter cca=(IChannelContainerAdapter)container.getAdapter(IChannelContainerAdapter.class);
    if (cca == null)     return;
    ID containerID=container.getID();
    if (event instanceof IContainerConnectedEvent) {
      try {
        activator.addDocShare(containerID,cca);
      }
 catch (      ECFException e) {
        activator.getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ECFStart_ERROR_DOCUMENT_SHARE_NOT_CREATED,container.getID()),null));
      }
    }
 else     if (event instanceof IContainerDisconnectedEvent) {
      Activator.getDefault().removeDocShare(containerID);
    }
  }
 else   if (event instanceof IContainerDisposeEvent) {
    containerManager.removeListener(containerManagerListener);
    container.removeListener(containerListener);
  }
}

Fixed version (ground truth):
public void handleEvent(IContainerEvent event){
  Activator activator=Activator.getDefault();
  if (activator == null)   return;
  final IContainerManager containerManager=activator.getContainerManager();
  if (containerManager == null)   return;
  IContainer container=containerManager.getContainer(event.getLocalContainerID());
  if (container == null)   return;
  if (event instanceof IContainerConnectedEvent || event instanceof IContainerDisconnectedEvent) {
    IChannelContainerAdapter cca=(IChannelContainerAdapter)container.getAdapter(IChannelContainerAdapter.class);
    if (cca == null)     return;
    ID containerID=container.getID();
    if (event instanceof IContainerConnectedEvent) {
      try {
        activator.addDocShare(containerID,cca);
      }
 catch (      ECFException e) {
        activator.getLog().log(new Status(IStatus.INFO,Activator.PLUGIN_ID,IStatus.INFO,NLS.bind(Messages.ECFStart_ERROR_DOCUMENT_SHARE_NOT_CREATED,container.getID()),null));
      }
    }
 else     if (event instanceof IContainerDisconnectedEvent || event instanceof IContainerEjectedEvent) {
      DocShare docShare=Activator.getDefault().removeDocShare(containerID);
      if (docShare != null) {
        docShare.dispose();
      }
    }
  }
 else   if (event instanceof IContainerDisposeEvent) {
    containerManager.removeListener(containerManagerListener);
    container.removeListener(containerListener);
  }
}
Program: 94710
Project: 94710
Buggy source:
public void dispose(){
  getRosterManager().removeRosterSubscriptionListener(subscriptionListener);
  getRosterManager().removeRosterListener(updateListener);
  container.removeListener(containerListener);
}

Fixed version (ground truth):
public void dispose(){
  getRosterManager().removeRosterSubscriptionListener(subscriptionListener);
  getRosterManager().removeRosterListener(updateListener);
  container.removeListener(containerListener);
  final IContainerManager containerManager=Activator.getDefault().getContainerManager();
  if (containerManager != null) {
    containerManager.removeContainer(container);
  }
  container.dispose();
}
Program: 94712
Project: 94712
Buggy source:
private void getOrCreateChannel(IChannelContainerAdapter containerAdapter,ID channelID,Map options) throws ECFException {
  if (channelID == null)   channelID=IDFactory.getDefault().createStringID(this.getClass().getName());
  channel=containerAdapter.getChannel(channelID);
  if (channel == null)   channel=containerAdapter.createChannel(channelID,listener,options);
}

Fixed version (ground truth):
private void getOrCreateChannel(IChannelContainerAdapter containerAdapter,ID channelID,Map options) throws ECFException {
  if (channelID == null)   channelID=IDFactory.getDefault().createStringID(this.getClass().getName());
  channel=containerAdapter.getChannel(channelID);
  if (channel == null)   channel=containerAdapter.createChannel(channelID,listener,options);
  adapter=containerAdapter;
}
Program: 94713
Project: 94713
Buggy source:
public synchronized void dispose(){
  if (channel != null) {
    channel.dispose();
    channel=null;
  }
}

Fixed version (ground truth):
public synchronized void dispose(){
  if (channel != null) {
    adapter.removeChannel(channel.getID());
    channel=null;
    adapter=null;
  }
}
Program: 94715
Project: 94715
Buggy source:
private void invokeRemoteEnvironmentInfo(final IRemoteCall remoteCall,IRemoteEnvironmentInfo proxy) throws Exception {
  Object result=null;
  if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getProperty((String)remoteCall.getParameters()[0]);
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getCommandLineArgs();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getFrameworkArgs();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getNL();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getNonFrameworkArgs();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getOS();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getOSArch();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getWS();
  }
 else {
    showException(new Exception("String_Node_Str"));
    return;
  }
  showResult(IRemoteEnvironmentInfo.class.getName(),remoteCall,result);
}

Fixed version (ground truth):
private void invokeRemoteEnvironmentInfo(final IRemoteCall remoteCall,IRemoteEnvironmentInfo proxy) throws Exception {
  Object result=null;
  if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getCommandLineArgs();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getFrameworkArgs();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getNL();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getNonFrameworkArgs();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getOS();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getOSArch();
  }
 else   if (remoteCall.getMethod().equals("String_Node_Str")) {
    result=proxy.getWS();
  }
 else {
    showException(new Exception("String_Node_Str"));
    return;
  }
  showResult(IRemoteEnvironmentInfo.class.getName(),remoteCall,result);
}
Program: 94716
Project: 94716
Buggy source:
protected void handleEnter(){
  Text inputText=getRootTextInput();
  if (inputText.getText().trim().length() > 0)   handleTextInput(inputText.getText());
  clearInput();
  scrollToEnd(getRootTextOutput());
  rootChannelTab.makeTabItemNormal();
}

Fixed version (ground truth):
protected void handleEnter(){
  Text inputText=getRootTextInput();
  if (inputText.getText().trim().length() > 0)   handleTextInput(inputText.getText());
  clearInput();
  scrollToEnd(getRootTextOutput());
  if (rootChannelTab != null)   rootChannelTab.makeTabItemNormal();
}
Program: 94717
Project: 94717
Buggy source:
public void handleMessage(final ID fromID,final String messageBody){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (rootDisposed)       return;
      appendText(rootChannelTab,getRootTextOutput(),new ChatLine(messageBody,new ChatRoomParticipant(fromID)));
      if (rootChannelTab != null)       rootChannelTab.makeTabItemBold();
    }
  }
);
}

Fixed version (ground truth):
public void handleMessage(final ID fromID,final String messageBody){
  Display.getDefault().asyncExec(new Runnable(){
    public void run(){
      if (rootDisposed)       return;
      if (rootChannelTab != null) {
        appendText(rootChannelTab,getRootTextOutput(),new ChatLine(messageBody,new ChatRoomParticipant(fromID)));
        rootChannelTab.makeTabItemBold();
      }
    }
  }
);
}
Program: 94719
Project: 94719
Buggy source:
public AbstractShare(IChannelContainerAdapter adapter,ID channelID,Map options) throws ECFException {
  Assert.isNotNull(adapter);
  Assert.isNotNull(channelID);
  channel=adapter.createChannel(channelID,listener,options);
}

Fixed version (ground truth):
public AbstractShare(IChannelContainerAdapter adapter,ID channelID,Map options) throws ECFException {
  Assert.isNotNull(adapter);
  Assert.isNotNull(channelID);
  getOrCreateChannel(adapter,channelID,options);
}
Program: 94722
Project: 94722
Buggy source:
protected void getResponseHeaderValues() throws IOException {
  if (!isConnected())   throw new ConnectException(Messages.UrlConnectionRetrieveFileTransfer_CONNECT_EXCEPTION_NOT_CONNECTED);
  if (getResponseCode() == -1)   throw new IOException(Messages.UrlConnectionRetrieveFileTransfer_EXCEPTION_INVALID_SERVER_RESPONSE);
  lastModifiedTime=urlConnection.getLastModified();
  setFileLength(urlConnection.getContentLength());
  String contentDispositionValue=urlConnection.getHeaderField(HttpHelper.CONTENT_DISPOSITION_HEADER);
  if (contentDispositionValue != null) {
    remoteFileName=HttpHelper.getRemoteFileNameFromContentDispositionHeader(contentDispositionValue);
  }
  if (remoteFileName == null) {
    remoteFileName=super.getRemoteFileName();
  }
}

Fixed version (ground truth):
protected void getResponseHeaderValues() throws IOException {
  if (!isConnected())   throw new ConnectException(Messages.UrlConnectionRetrieveFileTransfer_CONNECT_EXCEPTION_NOT_CONNECTED);
  if (getResponseCode() == -1)   throw new IOException(Messages.UrlConnectionRetrieveFileTransfer_EXCEPTION_INVALID_SERVER_RESPONSE);
  setLastModifiedTime(urlConnection.getLastModified());
  setFileLength(urlConnection.getContentLength());
  String contentDispositionValue=urlConnection.getHeaderField(HttpHelper.CONTENT_DISPOSITION_HEADER);
  if (contentDispositionValue != null) {
    remoteFileName=HttpHelper.getRemoteFileNameFromContentDispositionHeader(contentDispositionValue);
  }
  if (remoteFileName == null) {
    remoteFileName=super.getRemoteFileName();
  }
}
Program: 94723
Project: 94723
Buggy source:
protected Control createDialogArea(Composite parent){
  parent=(Composite)super.createDialogArea(parent);
  final Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  composite.setLayout(new FillLayout());
  composite.addPaintListener(new PaintListener(){
    public void paintControl(    PaintEvent e){
      e.gc.drawImage(image,0,0);
    }
  }
);
  return parent;
}

Fixed version (ground truth):
protected Control createDialogArea(Composite parent){
  final Composite composite=new Composite(parent,SWT.NONE);
  composite.setLayout(new GridLayout());
  composite.setLayoutData(new GridData(width,height));
  composite.addPaintListener(new PaintListener(){
    public void paintControl(    PaintEvent e){
      e.gc.drawImage(image,0,0);
    }
  }
);
  return composite;
}
Program: 94725
Project: 94725
Buggy source:
public void open(){
  shell.open();
}

Fixed version (ground truth):
public void open(){
  if (shell != null)   shell.open();
}
Program: 94726
Project: 94726
Buggy source:
public ShowImageShell(Display display,ID senderID,ImageWrapper imageWrapper,final DisposeListener disposeListener){
  this.shell=new Shell(display);
  this.senderID=senderID;
  this.imageWrapper=imageWrapper;
  this.shell.setBounds(0,0,imageWrapper.width,imageWrapper.height);
  this.imageData=new ArrayList();
  this.shell.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      disposeListener.widgetDisposed(e);
      ShowImageShell.this.senderID=null;
      ShowImageShell.this.imageWrapper=null;
      ShowImageShell.this.imageData=null;
    }
  }
);
}

Fixed version (ground truth):
public ShowImageShell(Display display,ID senderID,final DisposeListener disposeListener){
  this.shell=new Shell(display);
  this.senderID=senderID;
  this.shell.addDisposeListener(new DisposeListener(){
    public void widgetDisposed(    DisposeEvent e){
      disposeListener.widgetDisposed(e);
      ShowImageShell.this.senderID=null;
      ShowImageShell.this.imageWrapper=null;
      ShowImageShell.this.imageData=null;
    }
  }
);
}
Program: 94727
Project: 94727
Buggy source:
public IContributionItem[] getContributionsForService(IServiceInfo serviceInfo){
  IServiceID serviceID=serviceInfo.getServiceID();
  List serviceTypes=Arrays.asList(serviceID.getServiceTypeID().getServices());
  String protocol=null;
  if (serviceTypes.size() == 1 && serviceTypes.contains("String_Node_Str"))   protocol="String_Node_Str";
 else   if (serviceTypes.size() == 1 && serviceTypes.contains("String_Node_Str"))   protocol="String_Node_Str";
 else   if (serviceTypes.size() == 1 && serviceTypes.contains("String_Node_Str"))   protocol="String_Node_Str";
  if (protocol == null)   return EMPTY_CONTRIBUTION;
  URI location=serviceInfo.getLocation();
  StringBuffer buf=new StringBuffer(protocol);
  buf.append("String_Node_Str").append(location.getHost());
  if (location.getPort() != -1)   buf.append("String_Node_Str").append(location.getPort());
  IServiceProperties svcProps=serviceInfo.getServiceProperties();
  final String path=svcProps.getPropertyString(RFC2782_PATH);
  if (path != null) {
    if (path.startsWith("String_Node_Str"))     buf.append("String_Node_Str");
    buf.append(path);
  }
  final String urlString=buf.toString();
  Action action=new Action(){
    public void run(){
      openBrowser(urlString);
    }
  }
;
  action.setText(NLS.bind(Messages.HttpServiceAccessHandler_MENU_TEXT,urlString));
  return new IContributionItem[]{new ActionContributionItem(action)};
}

Fixed version (ground truth):
public IContributionItem[] getContributionsForService(IServiceInfo serviceInfo){
  IServiceID serviceID=serviceInfo.getServiceID();
  List serviceTypes=Arrays.asList(serviceID.getServiceTypeID().getServices());
  String protocol=null;
  if (serviceTypes.size() == 1 && serviceTypes.contains("String_Node_Str"))   protocol="String_Node_Str";
 else   if (serviceTypes.size() == 1 && serviceTypes.contains("String_Node_Str"))   protocol="String_Node_Str";
 else   if (serviceTypes.size() == 1 && serviceTypes.contains("String_Node_Str"))   protocol="String_Node_Str";
  if (protocol == null)   return EMPTY_CONTRIBUTION;
  URI location=serviceInfo.getLocation();
  StringBuffer buf=new StringBuffer(protocol);
  buf.append("String_Node_Str").append(location.getHost());
  if (location.getPort() != -1)   buf.append("String_Node_Str").append(location.getPort());
  IServiceProperties svcProps=serviceInfo.getServiceProperties();
  final String path=svcProps.getPropertyString(RFC2782_PATH);
  if (path != null) {
    if (!path.startsWith("String_Node_Str"))     buf.append("String_Node_Str");
    buf.append(path);
  }
  final String urlString=buf.toString();
  Action action=new Action(){
    public void run(){
      openBrowser(urlString);
    }
  }
;
  action.setText(NLS.bind(Messages.HttpServiceAccessHandler_MENU_TEXT,urlString));
  return new IContributionItem[]{new ActionContributionItem(action)};
}
Program: 94728
Project: 94728
Buggy source:
public void sendRosterRemove(ID userID) throws ECFException {
  try {
    if (!(userID instanceof XMPPID))     throw new ECFException("String_Node_Str");
    XMPPID xmppID=(XMPPID)userID;
    getConnectionOrThrowIfNull().sendRosterRemove(xmppID.getUsernameAtHost());
  }
 catch (  Exception e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void sendRosterRemove(ID userID) throws ECFException {
  try {
    if (!(userID instanceof XMPPID))     throw new ECFException("String_Node_Str");
    final XMPPID xmppID=(XMPPID)userID;
    getConnectionOrThrowIfNull().sendRosterRemove(xmppID.getUsernameAtHost());
  }
 catch (  final Exception e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}
Program: 94729
Project: 94729
Buggy source:
protected XMPPID createIDFromName(String uname){
  try {
    return new XMPPID(container.getConnectNamespace(),uname);
  }
 catch (  final Exception e) {
    traceStack("String_Node_Str",e);
    return null;
  }
}

Fixed version (ground truth):
protected XMPPID createIDFromName(String uname){
  try {
    if (uname.indexOf('@') == -1) {
      return new XMPPID(container.getConnectNamespace(),"String_Node_Str" + "String_Node_Str" + uname);
    }
    return new XMPPID(container.getConnectNamespace(),uname);
  }
 catch (  final Exception e) {
    traceStack("String_Node_Str",e);
    return null;
  }
}
Program: 94730
Project: 94730
Buggy source:
public void sendPresenceUpdate(ID toID,org.eclipse.ecf.presence.IPresence presence) throws ECFException {
  try {
    getConnectionOrThrowIfNull().sendPresenceUpdate(toID,createPresence(presence));
  }
 catch (  IOException e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void sendPresenceUpdate(ID toID,org.eclipse.ecf.presence.IPresence presence) throws ECFException {
  try {
    getConnectionOrThrowIfNull().sendPresenceUpdate(toID,createPresence(presence));
  }
 catch (  final IOException e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}
Program: 94731
Project: 94731
Buggy source:
public void sendRosterAdd(String user,String name,String[] groups) throws ECFException {
  try {
    getConnectionOrThrowIfNull().sendRosterAdd(user,name,groups);
  }
 catch (  Exception e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void sendRosterAdd(String user,String name,String[] groups) throws ECFException {
  try {
    getConnectionOrThrowIfNull().sendRosterAdd(user,name,groups);
  }
 catch (  final Exception e) {
    traceAndThrowECFException("String_Node_Str",e);
  }
}
Program: 94732
Project: 94732
Buggy source:
public void deactivated(){
  super.deactivated();
synchronized (this) {
    if (localGUI != null) {
      localGUI.disposeClient();
      localGUI=null;
    }
  }
  if (showImageShell != null) {
    showImageShell.close();
  }
  if (sharedObjectEventListener != null) {
    sharedObjectEventListener=null;
  }
  if (workbenchWindow != null) {
    workbenchWindow=null;
  }
  if (localResource != null) {
    localResource=null;
  }
}

Fixed version (ground truth):
public void deactivated(){
  super.deactivated();
synchronized (this) {
    if (localGUI != null) {
      localGUI.disposeClient();
      localGUI=null;
    }
  }
  shells.clear();
  if (sharedObjectEventListener != null) {
    sharedObjectEventListener=null;
  }
  if (workbenchWindow != null) {
    workbenchWindow=null;
  }
  if (localResource != null) {
    localResource=null;
  }
}
Program: 94733
Project: 94733
Buggy source:
protected void handleShowImageData(final ID id,final byte[] data,final Boolean done){
  final Display display=localGUI.getTextControl().getDisplay();
  display.asyncExec(new Runnable(){
    public void run(){
      if (showImageShell != null && showImageShell.getSenderID().equals(id)) {
        showImageShell.addData(data);
        if (done.booleanValue())         showImageShell.showImage();
      }
    }
  }
);
}

Fixed version (ground truth):
protected void handleShowImageData(final ID id,final byte[] data,final Boolean done){
  final ShowImageShell showImageShell=(ShowImageShell)shells.get(id);
  if (showImageShell != null) {
    final Display display=showImageShell.getDisplay();
    if (display != null) {
      display.asyncExec(new Runnable(){
        public void run(){
          showImageShell.addData(data);
          if (done.booleanValue())           showImageShell.showImage();
        }
      }
);
    }
  }
}
Program: 94734
Project: 94734
Buggy source:
public void widgetDisposed(DisposeEvent e){
  showImageShell=null;
}

Fixed version (ground truth):
public void widgetDisposed(DisposeEvent e){
  shells.remove(id);
}
Program: 94735
Project: 94735
Buggy source:
protected void handleShowImageStart(final ID id,final String fromUser,final ImageWrapper imageWrapper){
  final Display display=localGUI.getTextControl().getDisplay();
  display.asyncExec(new Runnable(){
    public void run(){
      if (showImageShell == null) {
        showImageShell=new ShowImageShell(display,id,imageWrapper,new DisposeListener(){
          public void widgetDisposed(          DisposeEvent e){
            showImageShell=null;
          }
        }
);
        showImageShell.setText(Messages.EclipseCollabSharedObject_SCREEN_CAPTURE_FROM + fromUser);
        showImageShell.open();
      }
    }
  }
);
}

Fixed version (ground truth):
protected void handleShowImageStart(final ID id,final String fromUser,final ImageWrapper imageWrapper){
  final Display display=localGUI.getTextControl().getDisplay();
  display.asyncExec(new Runnable(){
    public void run(){
      ShowImageShell showImageShell=(ShowImageShell)shells.get(id);
      if (showImageShell == null) {
        showImageShell=new ShowImageShell(display,id,new DisposeListener(){
          public void widgetDisposed(          DisposeEvent e){
            shells.remove(id);
          }
        }
);
        shells.put(id,showImageShell);
      }
      showImageShell.initialize(Messages.EclipseCollabSharedObject_SCREEN_CAPTURE_FROM + fromUser,imageWrapper);
      showImageShell.open();
    }
  }
);
}
Program: 94736
Project: 94736
Buggy source:
private void retrieveBuddyList() throws IOException {
  write("String_Node_Str","String_Node_Str");
  BufferedReader reader=new BufferedReader(new InputStreamReader(getInputStream(),"String_Node_Str"));
  String input=reader.readLine();
  while (input == null || !input.startsWith("String_Node_Str")) {
    input=reader.readLine();
  }
  String[] split=StringUtils.splitOnSpace(input);
  int contacts=Integer.parseInt(split[4]);
  while (!input.startsWith("String_Node_Str")) {
    if (input.startsWith("String_Node_Str")) {
      client.internalSetDisplayName(StringUtils.splitSubstring(input,"String_Node_Str",2));
    }
 else     if (input.startsWith("String_Node_Str")) {
      split=StringUtils.splitOnSpace(input);
      list.addGroup(split[2],new Group(URLDecoder.decode(split[1])));
    }
    input=reader.readLine();
  }
  int count=0;
  while (true) {
    if (input.startsWith("String_Node_Str")) {
      count++;
      String[] contact=StringUtils.splitOnSpace(input);
      String email=contact[1].substring(2);
switch (contact.length) {
case 3:
        list.internalAddContact(email,email);
      break;
case 5:
    list.addContact(email,email,contact[3].substring(2));
  break;
default :
list.addContact(contact[2].substring(2),email,contact[3].substring(2),contact[5]);
break;
}
if (count == contacts) {
break;
}
}
input=reader.readLine();
}
write("String_Node_Str",client.getStatus().getLiteral() + "String_Node_Str");
idle();
ping();
}

Fixed version (ground truth):
private void retrieveBuddyList() throws IOException {
  write("String_Node_Str","String_Node_Str");
  BufferedReader reader=new BufferedReader(new InputStreamReader(getInputStream(),"String_Node_Str"));
  String input=reader.readLine();
  while (input == null || !input.startsWith("String_Node_Str")) {
    input=reader.readLine();
  }
  String[] split=StringUtils.splitOnSpace(input);
  int contacts=Integer.parseInt(split[4]);
  while (!input.startsWith("String_Node_Str")) {
    if (input.startsWith("String_Node_Str")) {
      client.internalSetDisplayName(StringUtils.splitSubstring(input,"String_Node_Str",2));
    }
 else     if (input.startsWith("String_Node_Str")) {
      split=StringUtils.splitOnSpace(input);
      list.addGroup(split[2],new Group(URLDecoder.decode(split[1])));
    }
    input=reader.readLine();
  }
  int count=0;
  while (true) {
    if (input.startsWith("String_Node_Str")) {
      count++;
      String[] contact=StringUtils.splitOnSpace(input);
      String email=contact[1].substring(2);
      if (email.indexOf('@') != -1) {
switch (contact.length) {
case 3:
          list.internalAddContact(email,email);
        break;
case 5:
      list.addContact(email,email,contact[3].substring(2));
    break;
default :
  list.addContact(contact[2].substring(2),email,contact[3].substring(2),contact[5]);
break;
}
}
if (count == contacts) {
break;
}
}
input=reader.readLine();
}
write("String_Node_Str",client.getStatus().getLiteral() + "String_Node_Str");
idle();
ping();
}
Program: 94737
Project: 94737
Buggy source:
protected void buttonPressed(int buttonId){
  if (buttonId == IDialogConstants.OK_ID) {
    userid=useridText.getText();
    passwd=passwordText.getText();
    filename=fileLocation.getText();
    File f=new File(filename);
    if (f.exists()) {
      if (MessageDialog.openQuestion(getShell(),Messages.getString("String_Node_Str"),NLS.bind(Messages.getString("String_Node_Str"),filename))) {
        super.buttonPressed(buttonId);
      }
      fileLocation.setFocus();
      return;
    }
  }
  super.buttonPressed(buttonId);
}

Fixed version (ground truth):
protected void buttonPressed(int buttonId){
  if (buttonId == IDialogConstants.OK_ID) {
    userid=useridText.getText();
    passwd=passwordText.getText();
    filename=fileLocation.getText();
    File f=new File(filename);
    if (f.exists()) {
      if (MessageDialog.openQuestion(getShell(),Messages.getString("String_Node_Str"),NLS.bind(Messages.getString("String_Node_Str"),filename))) {
        super.buttonPressed(buttonId);
      }
 else       fileLocation.setFocus();
      return;
    }
  }
  super.buttonPressed(buttonId);
}
Program: 94738
Project: 94738
Buggy source:
private void verify(){
  String text=connectText.getText();
  passwordText.setText("String_Node_Str");
  if (text.equals("String_Node_Str")) {
    updateStatus(Messages.XMPPConnectWizardPage_WIZARD_STATUS);
  }
 else   if (text.indexOf('@') == -1) {
    updateStatus(Messages.XMPPConnectWizardPage_WIZARD_STATUS_INCOMPLETE);
  }
 else {
    updateStatus(null);
    restorePassword(text);
  }
}

Fixed version (ground truth):
private void verify(){
  String text=connectText.getText();
  if (text.equals("String_Node_Str")) {
    updateStatus(Messages.XMPPConnectWizardPage_WIZARD_STATUS);
  }
 else   if (text.indexOf('@') == -1) {
    updateStatus(Messages.XMPPConnectWizardPage_WIZARD_STATUS_INCOMPLETE);
  }
 else {
    updateStatus(null);
    restorePassword(text);
  }
}