nus-yam/ex-repair huggingface dataset:
Program: 94789
Project: 94789
Buggy source:
/** 
 * Invites the user with the specified email to this chat session.
 * @param email the user's email address
 * @throws IOException If an I/O error occurs while attempting to send the invitation to the user
 */
public void invite(String email) throws IOException {
synchronized (contacts) {
    for (int i=0; i < contacts.size(); i++) {
      if (((Contact)contacts.get(i)).getEmail().equals(email)) {
        return;
      }
    }
  }
  write("String_Node_Str",email);
  while (!joined)   ;
  joined=false;
}

Fixed version (ground truth):
/** 
 * Invites the user with the specified email to this chat session.
 * @param email the user's email address
 * @throws IOException If an I/O error occurs while attempting to send the invitation to the user
 */
public void invite(String email) throws IOException {
synchronized (contacts) {
    for (int i=0; i < contacts.size(); i++) {
      if (((Contact)contacts.get(i)).getEmail().equals(email)) {
        return;
      }
    }
  }
  write("String_Node_Str",email);
}
Program: 94790
Project: 94790
Buggy source:
private void retrieveBuddyList() throws IOException {
  write("String_Node_Str","String_Node_Str");
  BufferedReader reader=new BufferedReader(new InputStreamReader(getInputStream()));
  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);
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: 94791
Project: 94791
Buggy source:
/** 
 * Reads data from the channel and returns it as a String.
 * @return the contents that have been read, or <code>null</code> ifnothing is currently available
 * @throws IOException If an I/O error occurred while reading from the channel.
 */
String read() throws IOException {
  int read=is.read(buffer);
  if (read < 1) {
    return null;
  }
 else {
    return new String(buffer,0,read).trim();
  }
}

Fixed version (ground truth):
/** 
 * Reads data from the channel and returns it as a String.
 * @return the contents that have been read, or <code>null</code> ifnothing is currently available
 * @throws IOException If an I/O error occurred while reading from the channel.
 */
String read() throws IOException {
  int read=is.read(buffer);
  if (read < 1) {
    return null;
  }
  return new String(buffer,0,read,"String_Node_Str").trim();
}
Program: 94792
Project: 94792
Buggy source:
public void stop(BundleContext context) throws Exception {
  if (containerManagerTracker != null) {
    containerManagerTracker.close();
    containerManagerTracker=null;
  }
  plugin=null;
  context=null;
  super.stop(context);
}

Fixed version (ground truth):
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  if (containerManagerTracker != null) {
    containerManagerTracker.close();
    containerManagerTracker=null;
  }
  plugin=null;
  this.context=null;
}
Program: 94793
Project: 94793
Buggy source:
public void sendPresenceUpdate(ID toID,IPresence presence) throws ECFException {
  if (presence == null || client == null) {
    throw new ECFException();
  }
  IPresence.Mode mode=presence.getMode();
  try {
    if (presence.getType() == IPresence.Type.UNAVAILABLE) {
      disconnect();
    }
 else     if (mode == IPresence.Mode.AVAILABLE || mode == IPresence.Mode.CHAT) {
      client.setStatus(Status.ONLINE);
    }
 else     if (mode == IPresence.Mode.AWAY || mode == IPresence.Mode.EXTENDED_AWAY) {
      client.setStatus(Status.AWAY);
    }
 else     if (mode == IPresence.Mode.DND) {
      client.setStatus(Status.BUSY);
    }
 else {
      client.setStatus(Status.APPEAR_OFFLINE);
    }
    client.setPersonalMessage(presence.getStatus());
  }
 catch (  IOException e) {
    throw new ECFException(e);
  }
}

Fixed version (ground truth):
public void sendPresenceUpdate(ID toID,IPresence presence) throws ECFException {
  if (presence == null || client == null) {
    throw new ECFException();
  }
  IPresence.Mode mode=presence.getMode();
  try {
    client.setPersonalMessage(presence.getStatus());
    if (presence.getType() == IPresence.Type.UNAVAILABLE) {
      disconnect();
    }
 else     if (mode == IPresence.Mode.AVAILABLE || mode == IPresence.Mode.CHAT) {
      client.setStatus(Status.ONLINE);
    }
 else     if (mode == IPresence.Mode.AWAY || mode == IPresence.Mode.EXTENDED_AWAY) {
      client.setStatus(Status.AWAY);
    }
 else     if (mode == IPresence.Mode.DND) {
      client.setStatus(Status.BUSY);
    }
 else {
      client.setStatus(Status.APPEAR_OFFLINE);
    }
  }
 catch (  IOException e) {
    throw new ECFException(e);
  }
}
Program: 94794
Project: 94794
Buggy source:
/** 
 * Notifies attached   {@link ChatSessionListeners} that this session has nowtimed out.
 */
private void fireSessionTimedOutEvent(){
synchronized (listeners) {
    for (int i=0; i < listeners.size(); i++) {
      ((IChatSessionListener)listeners.get(i)).sessionTimedOut();
    }
  }
}

Fixed version (ground truth):
/** 
 * Notifies attached   {@link IChatSessionListener} that this session has nowtimed out.
 */
private void fireSessionTimedOutEvent(){
synchronized (listeners) {
    for (int i=0; i < listeners.size(); i++) {
      ((IChatSessionListener)listeners.get(i)).sessionTimedOut();
    }
  }
}
Program: 94795
Project: 94795
Buggy source:
/** 
 * Invokes the   {@link IContactListener#nameChanged(Status)} method on everylistener within  {@link #listeners}. This method is automatically invoked when   {@link #setDisplayName(String)} is called.
 * @param name the new name of this contact
 */
private void fireNameChanged(String name){
synchronized (listeners) {
    for (int i=0; i < listeners.size(); i++) {
      ((IContactListener)listeners.get(i)).nameChanged(name);
    }
  }
}

Fixed version (ground truth):
/** 
 * Invokes the   {@link IContactListener#nameChanged(String)} method on everylistener within  {@link #listeners}. This method is automatically invoked when   {@link #setDisplayName(String)} is called.
 * @param name1 the new name of this contact
 */
private void fireNameChanged(String name1){
synchronized (listeners) {
    for (int i=0; i < listeners.size(); i++) {
      ((IContactListener)listeners.get(i)).nameChanged(name1);
    }
  }
}
Program: 94796
Project: 94796
Buggy source:
/** 
 * Sets the user name of this contact with the given name. Developers are highly discouraged from calling this method since if the value of <code>newName</code> differs from the current name, the  {@link IContactListener#nameChanged(Status)} method will be invoked onall the listeners attached to this contact.
 * @param newName the new user name of this Contact
 */
void setDisplayName(String newName){
  newName=URLDecoder.decode(newName);
  if (!newName.equals(name)) {
    this.name=newName;
    fireNameChanged(newName);
  }
}

Fixed version (ground truth):
/** 
 * Sets the user name of this contact with the given name. Developers are highly discouraged from calling this method since if the value of <code>newName</code> differs from the current name, the  {@link IContactListener#nameChanged(String)} method will be invoked onall the listeners attached to this contact.
 * @param newName the new user name of this Contact
 */
void setDisplayName(String newName){
  newName=URLDecoder.decode(newName);
  if (!newName.equals(name)) {
    this.name=newName;
    fireNameChanged(newName);
  }
}
Program: 94797
Project: 94797
Buggy source:
/** 
 * Sets this contact's status to the given status. Developers are highly discouraged from calling this method since if the user's status actually did change, the   {@link IContactListener#nameChanged(Status)} method willbe invoked on all the listeners attached to this contact.
 * @param status the status that this contact is now in
 */
void setStatus(Status status){
  if (this.status != status) {
    this.status=status;
    fireStatusChanged(status);
  }
}

Fixed version (ground truth):
/** 
 * Sets this contact's status to the given status. Developers are highly discouraged from calling this method since if the user's status actually did change, the   {@link IContactListener#nameChanged(String)} method willbe invoked on all the listeners attached to this contact.
 * @param status the status that this contact is now in
 */
void setStatus(Status status){
  if (this.status != status) {
    this.status=status;
    fireStatusChanged(status);
  }
}
Program: 94798
Project: 94798
Buggy source:
/** 
 * Invokes the   {@link IContactListener#statusChanged(Status)} method onevery listener within  {@link #listeners}. This method is automatically invoked when   {@link #setStatus(int)} is called.
 * @param status the status that this contact has now switched to
 */
private void fireStatusChanged(Status status){
synchronized (listeners) {
    for (int i=0; i < listeners.size(); i++) {
      ((IContactListener)listeners.get(i)).statusChanged(status);
    }
  }
}

Fixed version (ground truth):
/** 
 * Invokes the   {@link IContactListener#statusChanged(Status)} method onevery listener within  {@link #listeners}. This method is automatically invoked when   {@link #setStatus(Status)} is called.
 * @param status1 the status that this contact has now switched to
 */
private void fireStatusChanged(Status status1){
synchronized (listeners) {
    for (int i=0; i < listeners.size(); i++) {
      ((IContactListener)listeners.get(i)).statusChanged(status1);
    }
  }
}
Program: 94799
Project: 94799
Buggy source:
/** 
 * Creates a new DispatchSocket to connect to the given hostname and port.
 * @param hostname the host to be connected to
 * @param port the corresponding port number
 * @param client the client that that invoked this dispatch session
 * @throws IOException If an I/O error occurs while attempting to open the SocketChannel
 */
DispatchSession(String hostname,int port) throws IOException {
  super(hostname,port,null);
}

Fixed version (ground truth):
/** 
 * Creates a new DispatchSocket to connect to the given hostname and port.
 * @param hostname the host to be connected to
 * @param port the corresponding port number
 * @throws IOException If an I/O error occurs while attempting to open the SocketChannel
 */
DispatchSession(String hostname,int port) throws IOException {
  super(hostname,port,null);
}
Program: 94800
Project: 94800
Buggy source:
/** 
 * Retrieves information from   {@link #PASSPORT_NEXUS} and stores it in{@link #passportInfo}.
 * @return <code>true</code> if the retrieval process completedsuccessfully
 * @throws IOException If an I/O error occurs while attempting to connect to the Passport Nexus page
 */
private boolean getLoginServerAddress() throws IOException {
  request=(HttpURLConnection)new URL(PASSPORT_NEXUS).openConnection();
  if (request.getResponseCode() == HttpURLConnection.HTTP_OK) {
    daLoginURL=StringUtils.splitSubstring(request.getHeaderField("String_Node_Str"),"String_Node_Str",1);
    daLoginURL="String_Node_Str" + daLoginURL.substring(daLoginURL.indexOf('=') + 1);
    request.disconnect();
    return true;
  }
  request.disconnect();
  return false;
}

Fixed version (ground truth):
/** 
 * Retrieves information from   {@link #PASSPORT_NEXUS} and stores it in{@link #daLoginURL}.
 * @return <code>true</code> if the retrieval process completedsuccessfully
 * @throws IOException If an I/O error occurs while attempting to connect to the Passport Nexus page
 */
private boolean getLoginServerAddress() throws IOException {
  request=(HttpURLConnection)new URL(PASSPORT_NEXUS).openConnection();
  if (request.getResponseCode() == HttpURLConnection.HTTP_OK) {
    daLoginURL=StringUtils.splitSubstring(request.getHeaderField("String_Node_Str"),"String_Node_Str",1);
    daLoginURL="String_Node_Str" + daLoginURL.substring(daLoginURL.indexOf('=') + 1);
    request.disconnect();
    return true;
  }
  request.disconnect();
  return false;
}
Program: 94801
Project: 94801
Buggy source:
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param urlString
 */
public BitTorrentHyperlink(IRegion region,URI uri){
  super(region,uri);
}

Fixed version (ground truth):
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param uri
 */
public BitTorrentHyperlink(IRegion region,URI uri){
  super(region,uri);
}
Program: 94802
Project: 94802
Buggy source:
/** 
 * @return
 */
public IContainerManager getContainerManager(){
  if (containerManagerTracker == null) {
    containerManagerTracker=new ServiceTracker(context,IContainerManager.class.getName(),null);
    containerManagerTracker.open();
  }
  return (IContainerManager)containerManagerTracker.getService();
}

Fixed version (ground truth):
/** 
 * @return container manager.
 */
public IContainerManager getContainerManager(){
  if (containerManagerTracker == null) {
    containerManagerTracker=new ServiceTracker(context,IContainerManager.class.getName(),null);
    containerManagerTracker.open();
  }
  return (IContainerManager)containerManagerTracker.getService();
}
Program: 94803
Project: 94803
Buggy source:
protected IContainer[] getContainers(){
  IContainerManager manager=Activator.getDefault().getContainerManager();
  if (manager == null)   return EMPTY;
  List results=new ArrayList();
  IContainer[] containers=manager.getAllContainers();
  for (int i=0; i < containers.length; i++) {
    ID connectedID=containers[i].getConnectedID();
    if (connectedID != null && ((isXMPPS && containers[i] instanceof XMPPSContainer) || (!isXMPPS && containers[i] instanceof XMPPContainer)))     results.add(containers[i]);
  }
  return (IContainer[])results.toArray(EMPTY);
}

Fixed version (ground truth):
protected IContainer[] getContainers(){
  final IContainerManager manager=Activator.getDefault().getContainerManager();
  if (manager == null)   return EMPTY;
  final List results=new ArrayList();
  final IContainer[] containers=manager.getAllContainers();
  for (int i=0; i < containers.length; i++) {
    final ID connectedID=containers[i].getConnectedID();
    if (connectedID != null && ((isXMPPS && containers[i] instanceof XMPPSContainer) || (!isXMPPS && containers[i] instanceof XMPPContainer)))     results.add(containers[i]);
  }
  return (IContainer[])results.toArray(EMPTY);
}
Program: 94804
Project: 94804
Buggy source:
private void openMessagesView(IChatManager chatManager,ID localID,ID targetID) throws PartInitException {
  IChatMessageSender icms=chatManager.getChatMessageSender();
  ITypingMessageSender itms=chatManager.getTypingMessageSender();
  IWorkbenchWindow ww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  MessagesView view=(MessagesView)ww.getActivePage().showView(MessagesView.VIEW_ID);
  view.selectTab(icms,itms,localID,targetID);
}

Fixed version (ground truth):
private void openMessagesView(IChatManager chatManager,ID localID,ID targetID) throws PartInitException {
  final IChatMessageSender icms=chatManager.getChatMessageSender();
  final ITypingMessageSender itms=chatManager.getTypingMessageSender();
  final IWorkbenchWindow ww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
  final MessagesView view=(MessagesView)ww.getActivePage().showView(MessagesView.VIEW_ID);
  view.selectTab(icms,itms,localID,targetID);
}
Program: 94805
Project: 94805
Buggy source:
public String getText(Object element){
  IRosterManager manager=((IPresenceContainerAdapter)element).getRosterManager();
  if (manager == null)   return null;
  return manager.getRoster().getUser().getID().getName();
}

Fixed version (ground truth):
public String getText(Object element){
  final IRosterManager manager=((IPresenceContainerAdapter)element).getRosterManager();
  if (manager == null)   return null;
  return manager.getRoster().getUser().getID().getName();
}
Program: 94806
Project: 94806
Buggy source:
protected IConnectWizard createConnectWizard(){
  String auth=getURI().getAuthority();
  if (isXMPPS)   return new XMPPSConnectWizard(auth);
 else   return new XMPPConnectWizard(auth);
}

Fixed version (ground truth):
protected IConnectWizard createConnectWizard(){
  final String auth=getURI().getAuthority();
  if (isXMPPS)   return new XMPPSConnectWizard(auth);
 else   return new XMPPConnectWizard(auth);
}
Program: 94808
Project: 94808
Buggy source:
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param urlString
 */
public XMPPHyperlink(IRegion region,URI uri){
  super(region,uri);
  isXMPPS=getURI().getScheme().equalsIgnoreCase(XMPPHyperlinkDetector.XMPPS_PROTOCOL);
}

Fixed version (ground truth):
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param uri
 */
public XMPPHyperlink(IRegion region,URI uri){
  super(region,uri);
  isXMPPS=getURI().getScheme().equalsIgnoreCase(XMPPHyperlinkDetector.XMPPS_PROTOCOL);
}
Program: 94810
Project: 94810
Buggy source:
public void open(){
  IContainer[] containers=getContainers();
  if (containers.length > 0) {
    chooseAccount(containers);
  }
 else {
    if (MessageDialog.openQuestion(null,Messages.XMPPHyperlink_CONNECT_ACCOUNT_DIALOG_TITLE,NLS.bind(Messages.XMPPHyperlink_CONNECT_ACCOUNT_DIALOG_MESSAGE,getURI().getAuthority()))) {
      super.open();
    }
  }
}

Fixed version (ground truth):
public void open(){
  final IContainer[] containers=getContainers();
  if (containers.length > 0) {
    chooseAccount(containers);
  }
 else {
    if (MessageDialog.openQuestion(null,Messages.XMPPHyperlink_CONNECT_ACCOUNT_DIALOG_TITLE,NLS.bind(Messages.XMPPHyperlink_CONNECT_ACCOUNT_DIALOG_MESSAGE,getURI().getAuthority()))) {
      super.open();
    }
  }
}
Program: 94811
Project: 94811
Buggy source:
/** 
 */
public IContainer[] getContainers(){
  ServiceTracker tracker=new ServiceTracker(context,IContainerManager.class.getName(),null);
  tracker.open();
  return (IContainer[])((IContainerManager)tracker.getService()).getAllContainers();
}

Fixed version (ground truth):
/** 
 * @return array of containers.
 */
public IContainer[] getContainers(){
  final ServiceTracker tracker=new ServiceTracker(context,IContainerManager.class.getName(),null);
  tracker.open();
  return ((IContainerManager)tracker.getService()).getAllContainers();
}
Program: 94812
Project: 94812
Buggy source:
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param urlString
 */
public MSNHyperlink(IRegion region,URI uri){
  super(region,uri);
}

Fixed version (ground truth):
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param uri
 */
public MSNHyperlink(IRegion region,URI uri){
  super(region,uri);
}
Program: 94813
Project: 94813
Buggy source:
/** 
 * This method is called when the plug-in is stopped
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  plugin=null;
}

Fixed version (ground truth):
/** 
 * This method is called when the plug-in is stopped
 * @param context 
 * @throws Exception 
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  plugin=null;
}
Program: 94814
Project: 94814
Buggy source:
/** 
 * This method is called upon plug-in activation
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  ClientPreferencePage p=new ClientPreferencePage();
  p.initializeDefaults();
  sessionNames=new ArrayList();
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation
 * @param context 
 * @throws Exception 
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  final ClientPreferencePage p=new ClientPreferencePage();
  p.initializeDefaults();
  sessionNames=new ArrayList();
}
Program: 94815
Project: 94815
Buggy source:
public void addSession(String channelID,String sessionName){
  sessionNames.add(new SessionInstance(channelID,sessionName,getPreferenceStore().getString(ClientPreferencePage.LOCAL_NAME),Calendar.getInstance().getTime()));
  if (presenceChannel != null) {
    try {
      presenceChannel.sendMessage((new SharedEditorSessionList(sessionNames)).toByteArray());
    }
 catch (    ECFException e) {
      e.printStackTrace();
    }
catch (    IOException e) {
      e.printStackTrace();
    }
  }
}

Fixed version (ground truth):
public void addSession(String channelID,String sessionName){
  sessionNames.add(new SessionInstance(channelID,sessionName,getPreferenceStore().getString(ClientPreferencePage.LOCAL_NAME),Calendar.getInstance().getTime()));
  if (presenceChannel != null) {
    try {
      presenceChannel.sendMessage((new SharedEditorSessionList(sessionNames)).toByteArray());
    }
 catch (    final ECFException e) {
      e.printStackTrace();
    }
catch (    final IOException e) {
      e.printStackTrace();
    }
  }
}
Program: 94816
Project: 94816
Buggy source:
public IChannel intializePresenceSession(IChannelListener clistener) throws ECFException {
  presenceContainer=ContainerFactory.getDefault().createContainer(Activator.getDefault().getPreferenceStore().getString(ClientPreferencePage.CONTAINER_TYPE));
  IChannelContainerAdapter channelContainer=(IChannelContainerAdapter)presenceContainer.getAdapter(IChannelContainerAdapter.class);
  final ID channelID=IDFactory.getDefault().createID(channelContainer.getChannelNamespace(),Activator.getDefault().getPreferenceStore().getString(ClientPreferencePage.CHANNEL_ID) + "String_Node_Str");
  presenceChannel=channelContainer.createChannel(channelID,clistener,new HashMap());
  this.presenceChannelListener=clistener;
  presenceContainer.connect(IDFactory.getDefault().createID(presenceContainer.getConnectNamespace(),Activator.getDefault().getPreferenceStore().getString(ClientPreferencePage.TARGET_SERVER)),null);
  return presenceChannel;
}

Fixed version (ground truth):
public IChannel intializePresenceSession(IChannelListener clistener) throws ECFException {
  presenceContainer=ContainerFactory.getDefault().createContainer(Activator.getDefault().getPreferenceStore().getString(ClientPreferencePage.CONTAINER_TYPE));
  final IChannelContainerAdapter channelContainer=(IChannelContainerAdapter)presenceContainer.getAdapter(IChannelContainerAdapter.class);
  final ID channelID=IDFactory.getDefault().createID(channelContainer.getChannelNamespace(),Activator.getDefault().getPreferenceStore().getString(ClientPreferencePage.CHANNEL_ID) + "String_Node_Str");
  presenceChannel=channelContainer.createChannel(channelID,clistener,new HashMap());
  this.presenceChannelListener=clistener;
  presenceContainer.connect(IDFactory.getDefault().createID(presenceContainer.getConnectNamespace(),Activator.getDefault().getPreferenceStore().getString(ClientPreferencePage.TARGET_SERVER)),null);
  return presenceChannel;
}
Program: 94817
Project: 94817
Buggy source:
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param urlString
 */
public IRCHyperlink(IRegion region,URI uri){
  super(region,uri);
}

Fixed version (ground truth):
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param uri
 */
public IRCHyperlink(IRegion region,URI uri){
  super(region,uri);
}
Program: 94818
Project: 94818
Buggy source:
protected IConnectWizard createConnectWizard(){
  URI uri=getURI();
  String authAndPath=uri.getSchemeSpecificPart();
  while (authAndPath.startsWith("String_Node_Str"))   authAndPath=authAndPath.substring(1);
  String fragment=uri.getFragment();
  if (fragment != null) {
    StringBuffer buf=new StringBuffer(authAndPath);
    buf.append("String_Node_Str").append(fragment);
    authAndPath=buf.toString();
  }
  return new IRCConnectWizard(authAndPath);
}

Fixed version (ground truth):
protected IConnectWizard createConnectWizard(){
  final URI uri=getURI();
  String authAndPath=uri.getSchemeSpecificPart();
  while (authAndPath.startsWith("String_Node_Str"))   authAndPath=authAndPath.substring(1);
  final String fragment=uri.getFragment();
  if (fragment != null) {
    final StringBuffer buf=new StringBuffer(authAndPath);
    buf.append("String_Node_Str").append(fragment);
    authAndPath=buf.toString();
  }
  return new IRCConnectWizard(authAndPath);
}
Program: 94819
Project: 94819
Buggy source:
private long getLastModifiedTimeFromHeader() throws IOException {
  Header lastModifiedHeader=getMethod.getResponseHeader(LAST_MODIFIED_HEADER);
  if (lastModifiedHeader == null)   throw new IOException(Messages.HttpClientRetrieveFileTransfer_INVALID_LAST_MODIFIED_TIME);
  String lastModifiedString=lastModifiedHeader.getValue();
  long lastModified=0;
  if (lastModifiedString != null) {
    try {
      lastModified=new SimpleDateFormat("String_Node_Str").parse(lastModifiedString).getTime();
    }
 catch (    Exception e) {
      throw new IOException(Messages.HttpClientRetrieveFileTransfer_EXCEPITION_INVALID_LAST_MODIFIED_FROM_SERVER);
    }
  }
  return lastModified;
}

Fixed version (ground truth):
private long getLastModifiedTimeFromHeader() throws IOException {
  Header lastModifiedHeader=getMethod.getResponseHeader(LAST_MODIFIED_HEADER);
  if (lastModifiedHeader == null)   throw new IOException(Messages.HttpClientRetrieveFileTransfer_INVALID_LAST_MODIFIED_TIME);
  String lastModifiedString=lastModifiedHeader.getValue();
  long lastModified=0;
  if (lastModifiedString != null) {
    try {
      lastModified=RFC1123.parse(lastModifiedString).getTime();
    }
 catch (    Exception e) {
      throw new IOException(Messages.HttpClientRetrieveFileTransfer_EXCEPITION_INVALID_LAST_MODIFIED_FROM_SERVER);
    }
  }
  return lastModified;
}
Program: 94820
Project: 94820
Buggy source:
/** 
 * @return
 */
public ID[] getChatRoomParticipants(){
  return (ID[])chatRoomContainerParticipants.toArray(new ID[]{});
}

Fixed version (ground truth):
/** 
 * @return array of IDs of chat room participants.
 */
public ID[] getChatRoomParticipants(){
  return (ID[])chatRoomContainerParticipants.toArray(new ID[]{});
}
Program: 94821
Project: 94821
Buggy source:
/** 
 * The action has been activated. The argument of the method represents the 'real' action sitting in the workbench UI.
 * @see IWorkbenchWindowActionDelegate#run
 */
public void run(){
  try {
    makeCall();
  }
 catch (  Exception e) {
    if (exceptionHandler != null)     exceptionHandler.handleException(e);
 else     Activator.getDefault().getLog().log(new Status(IStatus.ERROR,Activator.PLUGIN_ID,IStatus.ERROR,Messages.CallAction_Exception_CallAction_Run,e));
  }
}

Fixed version (ground truth):
/** 
 * The action has been activated. The argument of the method represents the 'real' action sitting in the workbench UI.
 */
public void run(){
  try {
    makeCall();
  }
 catch (  Exception e) {
    if (exceptionHandler != null)     exceptionHandler.handleException(e);
 else     Activator.getDefault().getLog().log(new Status(IStatus.ERROR,Activator.PLUGIN_ID,IStatus.ERROR,Messages.CallAction_Exception_CallAction_Run,e));
  }
}
Program: 94822
Project: 94822
Buggy source:
public void init(ISharedObjectConfig config) throws SharedObjectInitException {
  super.init(config);
  Map props=config.getProperties();
  Object[] args=(Object[])props.get(ARGS_PROPERTY_NAME);
  if (args != null && args.length == 2) {
    transferParams=(FileTransferParams)args[0];
    sharedObjectID=(ID)args[1];
    progressListener=this;
  }
  if (args != null && args.length == 5) {
    senderUI=(FileSenderUI)args[0];
    targetReceiver=(ID)args[1];
    setInputStream((InputStream)args[2]);
    transferParams=(FileTransferParams)args[3];
    sharedObjectID=(ID)args[4];
    progressListener=this;
  }
}

Fixed version (ground truth):
public void init(ISharedObjectConfig config) throws SharedObjectInitException {
  super.init(config);
  final Map props=config.getProperties();
  final Object[] args=(Object[])props.get(ARGS_PROPERTY_NAME);
  if (args != null && args.length == 2) {
    transferParams=(FileTransferParams)args[0];
    sharedObjectID=(ID)args[1];
    progressListener=this;
  }
  if (args != null && args.length == 5) {
    senderUI=(FileSenderUI)args[0];
    targetReceiver=(ID)args[1];
    setInputStream((InputStream)args[2]);
    transferParams=(FileTransferParams)args[3];
    sharedObjectID=(ID)args[4];
    progressListener=this;
  }
}
Program: 94823
Project: 94823
Buggy source:
public void run(){
  if (ClientPlugin.getDefault().getPluginPreferences().getBoolean(ClientPlugin.PREF_CONFIRM_FILE_RECEIVE)) {
    MessageDialog dialog=new MessageDialog(ClientPlugin.getDefault().getActiveShell(),"String_Node_Str",null,"String_Node_Str",MessageDialog.QUESTION,null,0);
    dialog.setBlockOnOpen(true);
    int response=dialog.open();
    if (response == MessageDialog.CANCEL)     return;
  }
  receiver=(EclipseCollabSharedObject)getContext().getSharedObjectManager().getSharedObject(sharedObjectID);
  receiverUI=receiver.getFileReceiverUI(EclipseFileTransfer.this,transferParams);
  localFile=createPath(receiver,getContext().isGroupManager(),aFile,length,rate);
  transferParams.setRemoteFile(localFile);
  if (receiverUI != null)   receiverUI.receiveStart(getHomeContainerID(),localFile,length,rate);
}

Fixed version (ground truth):
public void run(){
  if (ClientPlugin.getDefault().getPluginPreferences().getBoolean(ClientPlugin.PREF_CONFIRM_FILE_RECEIVE)) {
    final MessageDialog dialog=new MessageDialog(ClientPlugin.getDefault().getActiveShell(),"String_Node_Str",null,"String_Node_Str",MessageDialog.QUESTION,null,0);
    dialog.setBlockOnOpen(true);
    final int response=dialog.open();
    if (response == MessageDialog.CANCEL)     return;
  }
  receiver=(EclipseCollabSharedObject)getContext().getSharedObjectManager().getSharedObject(sharedObjectID);
  receiverUI=receiver.getFileReceiverUI(EclipseFileTransfer.this,transferParams);
  localFile=createPath(receiver,getContext().isGroupManager(),aFile,length,rate);
  transferParams.setRemoteFile(localFile);
  if (receiverUI != null)   receiverUI.receiveStart(getHomeContainerID(),localFile,length,rate);
}
Program: 94824
Project: 94824
Buggy source:
protected ReplicaSharedObjectDescription getReplicaDescription(ID remoteMember){
  HashMap map=new HashMap();
  map.put(ARGS_PROPERTY_NAME,new Object[]{transferParams,sharedObjectID});
  return new ReplicaSharedObjectDescription(getClass(),getID(),getConfig().getHomeContainerID(),map,getNextReplicateID());
}

Fixed version (ground truth):
protected ReplicaSharedObjectDescription getReplicaDescription(ID remoteMember){
  final HashMap map=new HashMap();
  map.put(ARGS_PROPERTY_NAME,new Object[]{transferParams,sharedObjectID});
  return new ReplicaSharedObjectDescription(getClass(),getID(),getConfig().getHomeContainerID(),map,getNextReplicateID());
}
Program: 94825
Project: 94825
Buggy source:
protected void addRemoteParticipants(ID ids[]){
  ID groupID=getContext().getConnectedID();
  if (ids != null && participantIDs != null) {
    for (int i=0; i < ids.length; i++) {
      if (groupID != null && groupID.equals(ids[i]))       continue;
      if (targetReceiver == null) {
        if (!getHomeContainerID().equals(ids[i]))         participantIDs.add(ids[i]);
      }
 else {
        if (targetReceiver.equals(ids[i]))         participantIDs.add(ids[i]);
      }
    }
  }
}

Fixed version (ground truth):
protected void addRemoteParticipants(ID ids[]){
  final ID groupID=getContext().getConnectedID();
  if (ids != null && participantIDs != null) {
    for (int i=0; i < ids.length; i++) {
      if (groupID != null && groupID.equals(ids[i]))       continue;
      if (targetReceiver == null) {
        if (!getHomeContainerID().equals(ids[i]))         participantIDs.add(ids[i]);
      }
 else {
        if (targetReceiver.equals(ids[i]))         participantIDs.add(ids[i]);
      }
    }
  }
}
Program: 94826
Project: 94826
Buggy source:
protected File createPath(EclipseCollabSharedObject sharedObject,boolean server,File file,long length,float rate){
  File downloadDir=new File(sharedObject.getLocalFullDownloadPath());
  downloadDir.mkdirs();
  File retFile=new File(downloadDir,file.getName());
  return retFile;
}

Fixed version (ground truth):
protected File createPath(EclipseCollabSharedObject sharedObject,boolean server,File file,long length,float rate){
  final File downloadDir=new File(sharedObject.getLocalFullDownloadPath());
  downloadDir.mkdirs();
  final File retFile=new File(downloadDir,file.getName());
  return retFile;
}
Program: 94827
Project: 94827
Buggy source:
/** 
 * Send a message with data to remote replica(s). This method is called by the SharedObjectOutputStream when sends some data via the replicated object. The replicated object that implements this interface should send a message to one or all remote replicas that contains the information contained in this method signature. Remote replicas should then turn around and call the 'add' method on their SharedObjectInputStream to receive the data.
 * @param bytesSentCount the length of the data (assuming data are compressed)
 * @param data the actual data to send
 */
public void sendDataMsg(int currentCount,byte[] data);

Fixed version (ground truth):
/** 
 * Send a message with data to remote replica(s). This method is called by the SharedObjectOutputStream when sends some data via the replicated object. The replicated object that implements this interface should send a message to one or all remote replicas that contains the information contained in this method signature. Remote replicas should then turn around and call the 'add' method on their SharedObjectInputStream to receive the data.
 * @param currentCount the length of the data (assuming data are compressed)
 * @param data the actual data to send
 */
public void sendDataMsg(int currentCount,byte[] data);
Program: 94828
Project: 94828
Buggy source:
protected ImageRegistry createImageRegistry(){
  ImageRegistry registry=super.createImageRegistry();
  registry.put(ClientPluginConstants.DECORATION_DEFAULT_PROVIDER,AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID,"String_Node_Str").createImage());
  return registry;
}

Fixed version (ground truth):
protected ImageRegistry createImageRegistry(){
  final ImageRegistry registry=super.createImageRegistry();
  registry.put(ClientPluginConstants.DECORATION_DEFAULT_PROVIDER,AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID,"String_Node_Str").createImage());
  return registry;
}
Program: 94829
Project: 94829
Buggy source:
/** 
 * This method is called upon plug-in activation
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  setPreferenceDefaults();
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation
 * @param context 
 * @throws Exception 
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
  setPreferenceDefaults();
}
Program: 94830
Project: 94830
Buggy source:
public IDiscoveryController getDiscoveryController(){
  return new IDiscoveryController(){
    public void connectToService(    IServiceInfo service){
synchronized (ClientPlugin.this) {
        if (discoveryStartup == null)         return;
        discoveryStartup.connectToServiceFromInfo(service);
      }
    }
    public void startDiscovery(){
      try {
        getDefault().initDiscovery();
      }
 catch (      Exception e) {
        ClientPlugin.log("String_Node_Str",e);
      }
    }
    public void stopDiscovery(){
      getDefault().disposeDiscovery();
    }
    public IDiscoveryContainerAdapter getDiscoveryContainer(){
synchronized (ClientPlugin.this) {
        if (discoveryStartup == null)         return null;
        return discoveryStartup.getDiscoveryContainer();
      }
    }
    public IContainer getContainer(){
synchronized (ClientPlugin.this) {
        if (discoveryStartup == null)         return null;
        return discoveryStartup.getContainer();
      }
    }
    public String[] getServiceTypes(){
      return serviceTypes;
    }
    public boolean isDiscoveryStarted(){
      return getDefault().isDiscoveryActive();
    }
  }
;
}

Fixed version (ground truth):
public IDiscoveryController getDiscoveryController(){
  return new IDiscoveryController(){
    public void connectToService(    IServiceInfo service){
synchronized (ClientPlugin.this) {
        if (discoveryStartup == null)         return;
        discoveryStartup.connectToServiceFromInfo(service);
      }
    }
    public void startDiscovery(){
      try {
        getDefault().initDiscovery();
      }
 catch (      final Exception e) {
        ClientPlugin.log("String_Node_Str",e);
      }
    }
    public void stopDiscovery(){
      getDefault().disposeDiscovery();
    }
    public IDiscoveryContainerAdapter getDiscoveryContainer(){
synchronized (ClientPlugin.this) {
        if (discoveryStartup == null)         return null;
        return discoveryStartup.getDiscoveryContainer();
      }
    }
    public IContainer getContainer(){
synchronized (ClientPlugin.this) {
        if (discoveryStartup == null)         return null;
        return discoveryStartup.getContainer();
      }
    }
    public String[] getServiceTypes(){
      return serviceTypes;
    }
    public boolean isDiscoveryStarted(){
      return getDefault().isDiscoveryActive();
    }
  }
;
}
Program: 94831
Project: 94831
Buggy source:
public void startDiscovery(){
  try {
    getDefault().initDiscovery();
  }
 catch (  Exception e) {
    ClientPlugin.log("String_Node_Str",e);
  }
}

Fixed version (ground truth):
public void startDiscovery(){
  try {
    getDefault().initDiscovery();
  }
 catch (  final Exception e) {
    ClientPlugin.log("String_Node_Str",e);
  }
}
Program: 94832
Project: 94832
Buggy source:
/** 
 * Returns the shared instance.
 */
public static ClientPlugin getDefault(){
  return plugin;
}

Fixed version (ground truth):
/** 
 * Returns the shared instance.
 * @return default client plugin
 */
public static ClientPlugin getDefault(){
  return plugin;
}
Program: 94833
Project: 94833
Buggy source:
/** 
 * This method is called when the plug-in is stopped
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  plugin=null;
  disposeServer();
  disposeDiscovery();
}

Fixed version (ground truth):
/** 
 * This method is called when the plug-in is stopped
 * @param context 
 * @throws Exception 
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  plugin=null;
  disposeServer();
  disposeDiscovery();
}
Program: 94834
Project: 94834
Buggy source:
/** 
 * Gets a string from the resource bundle and formats it with arguments
 */
public static String getFormattedString(String key,Object[] args){
  return MessageFormat.format(getString(key),args);
}

Fixed version (ground truth):
/** 
 * Gets a string from the resource bundle and formats it with arguments
 * @param key 
 * @param args 
 * @return formatted string.
 */
public static String getFormattedString(String key,Object[] args){
  return MessageFormat.format(getString(key),args);
}
Program: 94835
Project: 94835
Buggy source:
public static String getString(String key){
  try {
    return fgResourceBundle.getString(key);
  }
 catch (  MissingResourceException e) {
    return '!' + key + '!';
  }
}

Fixed version (ground truth):
public static String getString(String key){
  try {
    return fgResourceBundle.getString(key);
  }
 catch (  final MissingResourceException e) {
    return '!' + key + '!';
  }
}
Program: 94836
Project: 94836
Buggy source:
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param urlString
 */
public ECFGenericHyperlink(IRegion region,URI uri){
  super(region,uri);
}

Fixed version (ground truth):
/** 
 * Creates a new URL hyperlink.
 * @param region
 * @param uri
 */
public ECFGenericHyperlink(IRegion region,URI uri){
  super(region,uri);
}
Program: 94837
Project: 94837
Buggy source:
/** 
 * This method is called when the plug-in is stopped
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  instance=null;
}

Fixed version (ground truth):
/** 
 * This method is called when the plug-in is stopped
 * @param context 
 * @throws Exception 
 */
public void stop(BundleContext context) throws Exception {
  super.stop(context);
  instance=null;
}
Program: 94838
Project: 94838
Buggy source:
/** 
 * This method is called upon plug-in activation
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation
 * @param context 
 * @throws Exception 
 */
public void start(BundleContext context) throws Exception {
  super.start(context);
}
Program: 94839
Project: 94839
Buggy source:
/** 
 * @param fileToSend
 * @return
 */
private IFileTransferInfo createFileTransferInfoFromFile(final File fileToSend){
  return new FileTransferInfo(fileToSend);
}

Fixed version (ground truth):
/** 
 * @param fileToSend
 * @return file transfer info for given file.
 */
private IFileTransferInfo createFileTransferInfoFromFile(final File fileToSend){
  return new FileTransferInfo(fileToSend);
}
Program: 94840
Project: 94840
Buggy source:
/** 
 */
public BundleContext getContext(){
  return context;
}

Fixed version (ground truth):
/** 
 * @return context.
 */
public BundleContext getContext(){
  return context;
}
Program: 94841
Project: 94841
Buggy source:
/** 
 * Start ECF client or server.
 * @return IStatus the status of the start
 * @throws ECFStartException if some exception thrown during start
 */
public IStatus startup(IProgressMonitor monitor);

Fixed version (ground truth):
/** 
 * Start ECF client or server.
 * @return IStatus the status of the start
 */
public IStatus startup(IProgressMonitor monitor);
Program: 94842
Project: 94842
Buggy source:
/** 
 * Get the InvocationTargetException that occured during invocation. If null, no exception was thrown
 * @return InvocationTargetException if an exception occurred (available via{@link InvocationTargetException#getCause()}. Null if no exception has occurred
 */
public abstract InvocationTargetException getException();

Fixed version (ground truth):
/** 
 * Get the InvocationTargetException that occured during invocation. If null, no exception was thrown
 * @return InvocationTargetException if an exception occurred. <code>Null</code> if noexception has occurred
 */
public abstract InvocationTargetException getException();
Program: 94843
Project: 94843
Buggy source:
/** 
 * Handle reception of an IChannelEvent.  
 * @param event the IChannelEvent received.  This implementation detects instances of  {@link IChannelMessageEvent} andcalls  {@link #handleMessage(ID,byte[])} if found.  All otherchannel events are ignored.  Subclasses may override to detect and respond to other channel events as desired.
 */
protected void handleChannelEvent(IChannelEvent event){
  if (event instanceof IChannelMessageEvent) {
    IChannelMessageEvent cme=(IChannelMessageEvent)event;
    handleMessage(cme.getFromContainerID(),cme.getData());
  }
 else   if (event instanceof IChannelConnectEvent) {
    IChannelConnectEvent cce=(IChannelConnectEvent)event;
    handleConnectEvent(cce);
  }
 else   if (event instanceof IChannelDisconnectEvent) {
    IChannelDisconnectEvent cde=(IChannelDisconnectEvent)event;
    handleDisconnectEvent(cde);
  }
}

Fixed version (ground truth):
/** 
 * Handle reception of an IChannelEvent.  
 * @param event the IChannelEvent received.  This implementation detects instances of  {@link IChannelMessageEvent} andcalls  {@link #handleMessage(ID,byte[])} if found.  All otherchannel events are ignored.  Subclasses may override to detect and respond to other channel events as desired.
 */
protected void handleChannelEvent(IChannelEvent event){
  if (event instanceof IChannelMessageEvent) {
    final IChannelMessageEvent cme=(IChannelMessageEvent)event;
    handleMessage(cme.getFromContainerID(),cme.getData());
  }
 else   if (event instanceof IChannelConnectEvent) {
    final IChannelConnectEvent cce=(IChannelConnectEvent)event;
    handleConnectEvent(cce);
  }
 else   if (event instanceof IChannelDisconnectEvent) {
    final IChannelDisconnectEvent cde=(IChannelDisconnectEvent)event;
    handleDisconnectEvent(cde);
  }
}
Program: 94844
Project: 94844
Buggy source:
/** 
 */
public IDiscoveryService getDiscoveryService(){
  return (IDiscoveryService)tracker.getService();
}

Fixed version (ground truth):
/** 
 * @return discovery service
 */
public IDiscoveryService getDiscoveryService(){
  return (IDiscoveryService)tracker.getService();
}
Program: 94845
Project: 94845
Buggy source:
public void start(BundleContext context) throws Exception {
  plugin=this;
  IContainer container=ContainerFactory.getDefault().createContainer("String_Node_Str");
  container.connect(null,null);
  discoveryRegistration=context.registerService(IDiscoveryService.class.getName(),container,null);
  tracker=new ServiceTracker(context,IDiscoveryService.class.getName(),null);
  tracker.open();
}

Fixed version (ground truth):
public void start(BundleContext context) throws Exception {
  plugin=this;
  final IContainer container=ContainerFactory.getDefault().createContainer("String_Node_Str");
  container.connect(null,null);
  discoveryRegistration=context.registerService(IDiscoveryService.class.getName(),container,null);
  tracker=new ServiceTracker(context,IDiscoveryService.class.getName(),null);
  tracker.open();
}
Program: 94846
Project: 94846
Buggy source:
/** 
 * This method is called when the plug-in is stopped
 */
public void stop(BundleContext context) throws Exception {
  plugin=null;
}

Fixed version (ground truth):
/** 
 * This method is called when the plug-in is stopped
 * @param context 
 * @throws Exception 
 */
public void stop(BundleContext context) throws Exception {
  plugin=null;
}
Program: 94847
Project: 94847
Buggy source:
/** 
 * This method is called upon plug-in activation
 */
public void start(BundleContext context) throws Exception {
}

Fixed version (ground truth):
/** 
 * This method is called upon plug-in activation
 * @param context 
 * @throws Exception 
 */
public void start(BundleContext context) throws Exception {
}
Program: 94848
Project: 94848
Buggy source:
/** 
 * Returns the shared instance.
 */
public synchronized static DiscoveryPlugin getDefault(){
  if (plugin == null) {
    plugin=new DiscoveryPlugin();
  }
  return plugin;
}

Fixed version (ground truth):
/** 
 * Returns the shared instance.
 * @return default discovery plugin instance.
 */
public synchronized static DiscoveryPlugin getDefault(){
  if (plugin == null) {
    plugin=new DiscoveryPlugin();
  }
  return plugin;
}