From 5c417f85eb309197419c381ca59bab26788e7536 Mon Sep 17 00:00:00 2001 From: Yana Stamcheva Date: Tue, 2 Aug 2011 04:37:45 +0000 Subject: Fixes ambiguous properties with "sip" prefix in configuration file. --- .../communicator/service/protocol/AccountManager.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/net') diff --git a/src/net/java/sip/communicator/service/protocol/AccountManager.java b/src/net/java/sip/communicator/service/protocol/AccountManager.java index ce34e82..b3ba69c 100644 --- a/src/net/java/sip/communicator/service/protocol/AccountManager.java +++ b/src/net/java/sip/communicator/service/protocol/AccountManager.java @@ -69,6 +69,11 @@ public class AccountManager private Vector storedAccounts = new Vector(); /** + * The prefix of the account unique identifier. + */ + private static final String ACCOUNT_UID_PREFIX = "acc"; + + /** * Initializes a new AccountManagerImpl instance loaded in a * specific BundleContext (in which the caller will usually * later register it). @@ -129,7 +134,8 @@ public class AccountManager // If the property is not related to an account we skip it. int dotIndex = storedAccount.lastIndexOf("."); - if (!storedAccount.substring(dotIndex + 1).startsWith("acc")) + if (!storedAccount.substring(dotIndex + 1) + .startsWith(ACCOUNT_UID_PREFIX)) continue; if (logger.isDebugEnabled()) @@ -548,6 +554,13 @@ public class AccountManager storedAccountIter.hasNext();) { String storedAccount = storedAccountIter.next(); + + // If the property is not related to an account we skip it. + int dotIndex = storedAccount.lastIndexOf("."); + if (!storedAccount.substring(dotIndex + 1) + .startsWith(ACCOUNT_UID_PREFIX)) + continue; + String storedAccountUID = configurationService.getString(storedAccount + "." + ProtocolProviderFactory.ACCOUNT_UID); @@ -563,7 +576,8 @@ public class AccountManager // this account's properties. if (accountNodeName == null) { - accountNodeName = "acc" + Long.toString(System.currentTimeMillis()); + accountNodeName + = ACCOUNT_UID_PREFIX + Long.toString(System.currentTimeMillis()); // set a value for the persistent node so that we could later // retrieve it as a property -- cgit v1.1