Program: 103124
Project: 103124
Buggy source:
/** 
 * Modify an existing account.
 * @param protocolProvider the <tt>ProtocolProviderService</tt> responsibleof the account
 * @param accountProperties modified properties to be set
 */
@Override public void modifyAccount(ProtocolProviderService protocolProvider,Map<String,String> accountProperties) throws NullPointerException {
  BundleContext context=JabberActivator.getBundleContext();
  if (context == null)   throw new NullPointerException("String_Node_Str");
  if (protocolProvider == null)   throw new NullPointerException("String_Node_Str");
  JabberAccountID accountID=(JabberAccountID)protocolProvider.getAccountID();
  if (!registeredAccounts.containsKey(accountID))   return;
  ServiceRegistration registration=registeredAccounts.get(accountID);
  if (registration != null) {
    try {
      if (protocolProvider.isRegistered()) {
        protocolProvider.unregister();
        protocolProvider.shutdown();
      }
    }
 catch (    Throwable e) {
    }
    registration.unregister();
  }
  if (accountProperties == null)   throw new NullPointerException("String_Node_Str");
  accountProperties.put(USER_ID,accountID.getUserID());
  String serverAddress=accountProperties.get(SERVER_ADDRESS);
  if (serverAddress == null)   throw new NullPointerException("String_Node_Str");
  if (accountProperties.get(SERVER_PORT) == null) {
    accountProperties.put(SERVER_PORT,"String_Node_Str");
  }
  if (!accountProperties.containsKey(PROTOCOL))   accountProperties.put(PROTOCOL,ProtocolNames.JABBER);
  accountID.setAccountProperties(accountProperties);
  this.storeAccount(accountID);
  Hashtable<String,String> properties=new Hashtable<String,String>();
  properties.put(PROTOCOL,ProtocolNames.JABBER);
  properties.put(USER_ID,accountID.getUserID());
  ((ProtocolProviderServiceJabberImpl)protocolProvider).initialize(accountID.getUserID(),accountID);
  this.storeAccount(accountID);
  registration=context.registerService(ProtocolProviderService.class.getName(),protocolProvider,properties);
  registeredAccounts.put(accountID,registration);
}

Fixed version (ground truth):
/** 
 * Modify an existing account.
 * @param protocolProvider the <tt>ProtocolProviderService</tt> responsibleof the account
 * @param accountProperties modified properties to be set
 */
@Override public void modifyAccount(ProtocolProviderService protocolProvider,Map<String,String> accountProperties) throws NullPointerException {
  BundleContext context=JabberActivator.getBundleContext();
  if (context == null)   throw new NullPointerException("String_Node_Str");
  if (protocolProvider == null)   throw new NullPointerException("String_Node_Str");
  JabberAccountID accountID=(JabberAccountID)protocolProvider.getAccountID();
  if (!registeredAccounts.containsKey(accountID))   return;
  ServiceRegistration registration=registeredAccounts.get(accountID);
  if (registration != null) {
    try {
      if (protocolProvider.isRegistered()) {
        protocolProvider.unregister();
        protocolProvider.shutdown();
      }
    }
 catch (    Throwable e) {
    }
    registration.unregister();
  }
  if (accountProperties == null)   throw new NullPointerException("String_Node_Str");
  accountProperties.put(USER_ID,accountID.getUserID());
  String serverAddress=accountProperties.get(SERVER_ADDRESS);
  if (serverAddress == null)   throw new NullPointerException("String_Node_Str");
  if (accountProperties.get(SERVER_PORT) == null) {
    accountProperties.put(SERVER_PORT,"String_Node_Str");
  }
  if (!accountProperties.containsKey(PROTOCOL))   accountProperties.put(PROTOCOL,ProtocolNames.JABBER);
  accountID.setAccountProperties(accountProperties);
  AccountManager accManager=getAccountManager();
  ConfigurationService configSrvc=JabberActivator.getConfigurationService();
  String accountNodeName=getAccountManager().getAccountNodeName(this,accountID);
  String factoryPackage=accManager.getFactoryImplPackageName(this);
  String accountPrefix=factoryPackage + "String_Node_Str" + accountNodeName;
  List<String> allProperties=configSrvc.getAllPropertyNames();
  String stunPrefix=accountPrefix + "String_Node_Str" + ProtocolProviderFactory.STUN_PREFIX;
  String jinglePrefix=accountPrefix + "String_Node_Str" + JingleNodeDescriptor.JN_PREFIX;
  for (  String property : allProperties) {
    if (property.startsWith(stunPrefix) || property.startsWith(jinglePrefix)) {
      configSrvc.removeProperty(property);
    }
  }
  this.storeAccount(accountID);
  Hashtable<String,String> properties=new Hashtable<String,String>();
  properties.put(PROTOCOL,ProtocolNames.JABBER);
  properties.put(USER_ID,accountID.getUserID());
  ((ProtocolProviderServiceJabberImpl)protocolProvider).initialize(accountID.getUserID(),accountID);
  this.storeAccount(accountID);
  registration=context.registerService(ProtocolProviderService.class.getName(),protocolProvider,properties);
  registeredAccounts.put(accountID,registration);
}