Program: 103135
Project: 103135
Buggy source:
/** 
 * Process LDAP event.
 * @param evt LDAP event
 */
private void processLdapResponse(LdapEvent evt){
  if (evt.getCause() == LdapEvent.LdapEventCause.SEARCH_ACHIEVED || evt.getCause() == LdapEvent.LdapEventCause.SEARCH_CANCELLED) {
synchronized (objLock) {
      objLock.notify();
    }
  }
  if (evt.getCause() == LdapEvent.LdapEventCause.NEW_SEARCH_RESULT) {
    LdapPersonFound person=(LdapPersonFound)evt.getContent();
    String displayName=null;
    if (person == null) {
      return;
    }
    if (person.getDisplayName() != null) {
      displayName=person.getDisplayName();
    }
 else {
      displayName=person.getFirstName() + "String_Node_Str" + person.getSurname();
    }
    List<ContactDetail> contactDetails=getContactDetails(person);
    if (!contactDetails.isEmpty()) {
      GenericSourceContact sourceContact=new GenericSourceContact(getContactSource(),displayName,contactDetails);
      try {
        sourceContact.setImage(person.fetchPhoto());
      }
 catch (      OutOfMemoryError oome) {
      }
      if (person.getOrganization() != null) {
        sourceContact.setDisplayDetails(person.getOrganization());
      }
      addQueryResult(sourceContact);
    }
  }
 else   if (evt.getCause() == LdapEvent.LdapEventCause.SEARCH_AUTH_ERROR) {
synchronized (objLock) {
      objLock.notify();
    }
    new Thread(){
      public void run(){
        LdapDirectorySettingsImpl ldapSettings=(LdapDirectorySettingsImpl)getContactSource().getLdapDirectory().getSettings();
        AuthenticationWindow authWindow=new AuthenticationWindow(ldapSettings.getUserName(),ldapSettings.getPassword().toCharArray(),ldapSettings.getName(),false,LdapActivator.getResourceService().getImage("String_Node_Str"),LdapActivator.getResourceService().getI18NString("String_Node_Str",new String[]{ldapSettings.getName()}));
        authWindow.setVisible(true);
        if (!authWindow.isCanceled()) {
          LdapDirectorySettings newSettings=new LdapDirectorySettingsImpl(ldapSettings);
          LdapService ldapService=LdapActivator.getLdapService();
          LdapFactory factory=ldapService.getFactory();
          LdapDirectory ldapDir=getContactSource().getLdapDirectory();
          LdapActivator.unregisterContactSource(ldapDir);
          ldapService.getServerSet().removeServerWithName(ldapSettings.getName());
          newSettings.setPassword(new String(authWindow.getPassword()));
          ldapDir=factory.createServer(newSettings);
          ldapService.getServerSet().addServer(ldapDir);
          LdapActivator.registerContactSource(ldapDir);
        }
      }
    }
.start();
  }
}

Fixed version (ground truth):
/** 
 * Process LDAP event.
 * @param evt LDAP event
 */
private void processLdapResponse(LdapEvent evt){
  if (evt.getCause() == LdapEvent.LdapEventCause.SEARCH_ACHIEVED || evt.getCause() == LdapEvent.LdapEventCause.SEARCH_CANCELLED) {
synchronized (objLock) {
      objLock.notify();
    }
  }
  if (evt.getCause() == LdapEvent.LdapEventCause.SEARCH_ERROR) {
    setStatus(ContactQuery.QUERY_ERROR);
synchronized (objLock) {
      objLock.notify();
    }
  }
  if (evt.getCause() == LdapEvent.LdapEventCause.NEW_SEARCH_RESULT) {
    LdapPersonFound person=(LdapPersonFound)evt.getContent();
    String displayName=null;
    if (person == null) {
      return;
    }
    if (person.getDisplayName() != null) {
      displayName=person.getDisplayName();
    }
 else {
      displayName=person.getFirstName() + "String_Node_Str" + person.getSurname();
    }
    List<ContactDetail> contactDetails=getContactDetails(person);
    if (!contactDetails.isEmpty()) {
      GenericSourceContact sourceContact=new GenericSourceContact(getContactSource(),displayName,contactDetails);
      try {
        sourceContact.setImage(person.fetchPhoto());
      }
 catch (      OutOfMemoryError oome) {
      }
      if (person.getOrganization() != null) {
        sourceContact.setDisplayDetails(person.getOrganization());
      }
      addQueryResult(sourceContact);
    }
  }
 else   if (evt.getCause() == LdapEvent.LdapEventCause.SEARCH_AUTH_ERROR) {
synchronized (objLock) {
      objLock.notify();
    }
    new Thread(){
      public void run(){
        LdapDirectorySettingsImpl ldapSettings=(LdapDirectorySettingsImpl)getContactSource().getLdapDirectory().getSettings();
        AuthenticationWindow authWindow=new AuthenticationWindow(ldapSettings.getUserName(),ldapSettings.getPassword().toCharArray(),ldapSettings.getName(),false,LdapActivator.getResourceService().getImage("String_Node_Str"),LdapActivator.getResourceService().getI18NString("String_Node_Str",new String[]{ldapSettings.getName()}));
        authWindow.setVisible(true);
        if (!authWindow.isCanceled()) {
          LdapDirectorySettings newSettings=new LdapDirectorySettingsImpl(ldapSettings);
          LdapService ldapService=LdapActivator.getLdapService();
          LdapFactory factory=ldapService.getFactory();
          LdapDirectory ldapDir=getContactSource().getLdapDirectory();
          LdapActivator.unregisterContactSource(ldapDir);
          ldapService.getServerSet().removeServerWithName(ldapSettings.getName());
          newSettings.setPassword(new String(authWindow.getPassword()));
          ldapDir=factory.createServer(newSettings);
          ldapService.getServerSet().addServer(ldapDir);
          LdapActivator.registerContactSource(ldapDir);
        }
      }
    }
.start();
  }
}