aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/net/java/sip/communicator/impl')
-rw-r--r--src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java
index 8d0a34f..2d4f002 100644
--- a/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java
+++ b/src/net/java/sip/communicator/impl/protocol/jabber/ProtocolProviderFactoryJabberImpl.java
@@ -33,11 +33,26 @@ public class ProtocolProviderFactoryJabberImpl
static
{
- ProviderManager.setInstance(new ProviderManagerExt());
-
- providerManager = ProviderManager.getInstance();
+ try
+ {
+ ProviderManager.setInstance(new ProviderManagerExt());
+ }
+ catch(Throwable t)
+ {
+ // once loaded if we try to set instance second time
+ // IllegalStateException is thrown
+ }
+ finally
+ {
+ providerManager = ProviderManager.getInstance();
+ }
- if (!(providerManager instanceof ProviderManagerExt))
+ // checks class names, not using instanceof
+ // tests do unloading and loading the protocol bundle and
+ // ProviderManagerExt class get loaded two times from different
+ // classloaders
+ if (!(providerManager.getClass().getName()
+ .equals(ProviderManagerExt.class.getName())))
{
throw new RuntimeException(
"ProviderManager set to the default one");