aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
diff options
context:
space:
mode:
authorLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-12-16 12:53:28 +0000
committerLyubomir Marinov <lyubomir.marinov@jitsi.org>2008-12-16 12:53:28 +0000
commitd02eba788a62f9a5e12c0a3e5324c9024b1606c7 (patch)
tree2328fc9b722d8cdf6bcdaa24294839f85067d8b2 /src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
parent6df051d5c9aca787c36696a6e4537635db6f6e75 (diff)
downloadjitsi-d02eba788a62f9a5e12c0a3e5324c9024b1606c7.zip
jitsi-d02eba788a62f9a5e12c0a3e5324c9024b1606c7.tar.gz
jitsi-d02eba788a62f9a5e12c0a3e5324c9024b1606c7.tar.bz2
- Reduces garbage created when working with AccoutID.getAccountProperties() which creates a copy of the internal Hashtable by introducing getAccountProperty(), getAccountPropertyString(), getAccountPropertyBoolean() and getAccountPropertyInt(). The last two also carry out the conversions between Object and boolean/int without additional allocations in contrast to most of the previous uses which would perform allocations.
- Modifies SimpleStatusMenu to load its necessary image once instead of three times and to spare a ImageIcon instance.
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java44
1 files changed, 17 insertions, 27 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java b/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
index 22bccff..4fea981 100644
--- a/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/irc/ProtocolProviderServiceIrcImpl.java
@@ -152,14 +152,16 @@ public class ProtocolProviderServiceIrcImpl
public void register(SecurityAuthority authority)
throws OperationFailedException
{
- Map accountProperties = getAccountID().getAccountProperties();
-
- String serverAddress = (String) accountProperties
- .get(ProtocolProviderFactory.SERVER_ADDRESS);
-
- String serverPort = (String) accountProperties
- .get(ProtocolProviderFactory.SERVER_PORT);
-
+ AccountID accountID = getAccountID();
+
+ String serverAddress =
+ accountID
+ .getAccountPropertyString(ProtocolProviderFactory.SERVER_ADDRESS);
+
+ String serverPort =
+ accountID
+ .getAccountPropertyString(ProtocolProviderFactory.SERVER_PORT);
+
if(serverPort == null || serverPort.equals(""))
{
serverPort = "6667";
@@ -169,25 +171,13 @@ public class ProtocolProviderServiceIrcImpl
String serverPassword = IrcActivator.
getProtocolProviderFactory().loadPassword(getAccountID());
- boolean autoNickChange = true;
-
- boolean passwordRequired = true;
-
- if(accountProperties
- .get(ProtocolProviderFactory.AUTO_CHANGE_USER_NAME) != null)
- {
- autoNickChange = new Boolean((String)accountProperties
- .get(ProtocolProviderFactory.AUTO_CHANGE_USER_NAME))
- .booleanValue();
- }
-
- if(accountProperties
- .get(ProtocolProviderFactory.NO_PASSWORD_REQUIRED) != null)
- {
- passwordRequired = new Boolean((String) accountProperties
- .get(ProtocolProviderFactory.NO_PASSWORD_REQUIRED))
- .booleanValue();
- }
+ boolean autoNickChange =
+ accountID.getAccountPropertyBoolean(
+ ProtocolProviderFactory.AUTO_CHANGE_USER_NAME, true);
+
+ boolean passwordRequired =
+ accountID.getAccountPropertyBoolean(
+ ProtocolProviderFactory.NO_PASSWORD_REQUIRED, true);
//if we don't - retrieve it from the user through the security authority
if (serverPassword == null && passwordRequired)