Applies the patch contributed by Dai Zhiwei which fixes the throwing of NullPointerException with details on the parameter being the cause in the Gibberish and Icq ProtocolProviderFactory implementations.

cusax-fix
Lyubomir Marinov 18 years ago
parent f0c46adb22
commit 843778525a

@ -144,6 +144,14 @@ public AccountID installAccount( String userIDStr,
public void modifyAccount( ProtocolProviderService protocolProvider,
Map accountProperties)
{
// Make sure the specified arguments are valid.
if (protocolProvider == null)
throw new NullPointerException(
"The specified Protocol Provider was null");
if (accountProperties == null)
throw new NullPointerException(
"The specified property map was null");
BundleContext context
= GibberishActivator.getBundleContext();
@ -151,10 +159,6 @@ public void modifyAccount( ProtocolProviderService protocolProvider,
throw new NullPointerException(
"The specified BundleContext was null");
if (protocolProvider == null)
throw new NullPointerException(
"The specified Protocol Provider was null");
GibberishAccountID accountID
= (GibberishAccountID) protocolProvider.getAccountID();
@ -172,10 +176,6 @@ public void modifyAccount( ProtocolProviderService protocolProvider,
accountProperties.put(USER_ID, accountID.getUserID());
if (accountProperties == null)
throw new NullPointerException(
"The specified property map was null");
if (!accountProperties.containsKey(PROTOCOL))
accountProperties.put(PROTOCOL, ProtocolNames.GIBBERISH);

@ -313,6 +313,14 @@ public void modifyAccount( ProtocolProviderService protocolProvider,
Map accountProperties)
throws NullPointerException
{
// Make sure the specified arguments are valid.
if (protocolProvider == null)
throw new NullPointerException(
"The specified Protocol Provider was null");
if (accountProperties == null)
throw new NullPointerException(
"The specified property map was null");
BundleContext context
= IcqActivator.getBundleContext();
@ -320,10 +328,6 @@ public void modifyAccount( ProtocolProviderService protocolProvider,
throw new NullPointerException(
"The specified BundleContext was null");
if (protocolProvider == null)
throw new NullPointerException(
"The specified Protocol Provider was null");
IcqAccountID accountID = (IcqAccountID) protocolProvider.getAccountID();
// If the given accountID doesn't correspond to an existing account
@ -340,10 +344,6 @@ public void modifyAccount( ProtocolProviderService protocolProvider,
accountProperties.put(USER_ID, accountID.getUserID());
if (accountProperties == null)
throw new NullPointerException(
"The specified property map was null");
if (!accountProperties.containsKey(PROTOCOL))
accountProperties.put(PROTOCOL, ProtocolNames.ICQ);

Loading…
Cancel
Save