Program: 103648
Project: 103648
Buggy source:
/** 
 * Stores an account represented in the form of an <code>AccountID</code> created by a specific <code>ProtocolProviderFactory</code>.
 * @param factory the <code>ProtocolProviderFactory</code> which created theaccount to be stored
 * @param accountID the account in the form of <code>AccountID</code> to bestored
 */
public void storeAccount(ProtocolProviderFactory factory,AccountID accountID){
  ConfigurationService configurationService=ProtocolProviderActivator.getConfigurationService();
  String factoryPackage=getFactoryImplPackageName(factory);
  List<String> storedAccounts=configurationService.getPropertyNamesByPrefix(factoryPackage,true);
  String accountUID=accountID.getAccountUniqueID();
  String accountNodeName=null;
  for (Iterator<String> storedAccountIter=storedAccounts.iterator(); storedAccountIter.hasNext(); ) {
    String storedAccount=storedAccountIter.next();
    String storedAccountUID=configurationService.getString(storedAccount + "String_Node_Str");
    if (storedAccountUID.equals(accountUID)) {
      accountNodeName=configurationService.getString(storedAccount);
    }
  }
  Map<String,Object> configurationProperties=new HashMap<String,Object>();
  if (accountNodeName == null) {
    accountNodeName="String_Node_Str" + Long.toString(System.currentTimeMillis());
    configurationProperties.put(factoryPackage + "String_Node_Str" + accountNodeName,accountNodeName);
    configurationProperties.put(factoryPackage + "String_Node_Str" + accountNodeName+ "String_Node_Str"+ ProtocolProviderFactory.ACCOUNT_UID,accountID.getAccountUniqueID());
  }
  Map<String,String> accountProperties=accountID.getAccountProperties();
  for (  Map.Entry<String,String> entry : accountProperties.entrySet()) {
    String property=entry.getKey();
    String value=entry.getValue();
    if (property.equals(ProtocolProviderFactory.PASSWORD))     value=new String(Base64.encode(value.getBytes()));
    configurationProperties.put(factoryPackage + "String_Node_Str" + accountNodeName+ "String_Node_Str"+ property,value);
  }
  if (configurationProperties.size() > 0)   configurationService.setProperties(configurationProperties);
  logger.debug("String_Node_Str" + accountID.getAccountUniqueID() + "String_Node_Str"+ factoryPackage);
}

Fixed version (ground truth):
/** 
 * Stores an account represented in the form of an <code>AccountID</code> created by a specific <code>ProtocolProviderFactory</code>.
 * @param factory the <code>ProtocolProviderFactory</code> which created theaccount to be stored
 * @param accountID the account in the form of <code>AccountID</code> to bestored
 */
public void storeAccount(ProtocolProviderFactory factory,AccountID accountID){
  ConfigurationService configurationService=ProtocolProviderActivator.getConfigurationService();
  String factoryPackage=getFactoryImplPackageName(factory);
  List<String> storedAccounts=configurationService.getPropertyNamesByPrefix(factoryPackage,true);
  String accountUID=accountID.getAccountUniqueID();
  String accountNodeName=null;
  for (Iterator<String> storedAccountIter=storedAccounts.iterator(); storedAccountIter.hasNext(); ) {
    String storedAccount=storedAccountIter.next();
    String storedAccountUID=configurationService.getString(storedAccount + "String_Node_Str");
    if (storedAccountUID.equals(accountUID)) {
      accountNodeName=configurationService.getString(storedAccount);
    }
  }
  Map<String,Object> configurationProperties=new HashMap<String,Object>();
  if (accountNodeName == null) {
    accountNodeName="String_Node_Str" + Long.toString(System.currentTimeMillis());
    configurationProperties.put(factoryPackage + "String_Node_Str" + accountNodeName,accountNodeName);
    configurationProperties.put(factoryPackage + "String_Node_Str" + accountNodeName+ "String_Node_Str"+ ProtocolProviderFactory.ACCOUNT_UID,accountID.getAccountUniqueID());
  }
  Map<String,String> accountProperties=accountID.getAccountProperties();
  for (  Map.Entry<String,String> entry : accountProperties.entrySet()) {
    String property=entry.getKey();
    String value=entry.getValue();
    if (property.equals(ProtocolProviderFactory.PASSWORD))     value=new String(Base64.encode(value.getBytes()));
    configurationProperties.put(factoryPackage + "String_Node_Str" + accountNodeName+ "String_Node_Str"+ property,value);
  }
  if (configurationProperties.size() > 0)   configurationService.setProperties(configurationProperties);
  if (logger.isDebugEnabled())   logger.debug("String_Node_Str" + accountID.getAccountUniqueID() + "String_Node_Str"+ factoryPackage);
}