Skip navigation
308 Views 0 Replies Latest reply: Jan 12, 2012 6:42 PM by Gary Russell RSS
Gary Russell Bronze 1 posts since
Jan 12, 2012
Currently Being Moderated

Jan 12, 2012 6:42 PM

Duplicate Entries in SmackConfiguration.defaultMechs

Smack 3.2.1

 

If the current thread's context classloader is the same as the SmackConfiguration's classloader, we get 2 entries for each mechName element in defaultMechs.

 

While addSaslMech() protects against duplicates, the static initializer does not.

 

Further, if 2 or more smack-config.xml files with the same mechName are found on the classpath, the problem is multiplied. Consider calling addSaslMech() from the initializer.

 

$ svn diff

Index: source/org/jivesoftware/smack/SmackConfiguration.java

===================================================================

--- source/org/jivesoftware/smack/SmackConfiguration.java          (revision 12950)

+++ source/org/jivesoftware/smack/SmackConfiguration.java          (working copy)

@@ -92,7 +92,7 @@

                                     keepAliveInterval = parseIntProperty(parser, keepAliveInterval);

                                 }

                                 else if (parser.getName().equals("mechName")) {

-                                    defaultMechs.add(parser.nextText());

+                                    addSaslMech(parser.nextText());

                                 }

                                 else if (parser.getName().equals("localSocks5ProxyEnabled")) {

                                     localSocks5ProxyEnabled = Boolean.parseBoolean(parser.nextText());

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points