Enable trailing whitespace checkstyle check

for all source code regions, including javadoc.
open
Florian Schmaus 4 years ago
parent 9d61a6de7d
commit e8923b9d16
  1. 18
      config/checkstyle.xml
  2. 2
      smack-bosh/src/main/java/org/jivesoftware/smack/bosh/BOSHConfiguration.java
  3. 14
      smack-bosh/src/main/java/org/jivesoftware/smack/bosh/XMPPBOSHConnection.java
  4. 4
      smack-compression-jzlib/src/main/java/org/jivesoftware/smack/compression/jzlib/JzlibInputOutputStream.java
  5. 2
      smack-core/src/integration-test/java/org/jivesoftware/smack/IQTest.java
  6. 2
      smack-core/src/integration-test/java/org/jivesoftware/smack/LoginTest.java
  7. 4
      smack-core/src/integration-test/java/org/jivesoftware/smack/MessageTest.java
  8. 2
      smack-core/src/integration-test/java/org/jivesoftware/smack/PrivacyClient.java
  9. 2
      smack-core/src/integration-test/java/org/jivesoftware/smack/ReconnectionTest.java
  10. 2
      smack-core/src/integration-test/java/org/jivesoftware/smack/RosterInitializedBeforeConnectTest.java
  11. 2
      smack-core/src/integration-test/java/org/jivesoftware/smack/RosterListenerTest.java
  12. 8
      smack-core/src/integration-test/java/org/jivesoftware/smack/RosterSmackTest.java
  13. 10
      smack-core/src/integration-test/java/org/jivesoftware/smack/packet/PrivacyProviderTest.java
  14. 4
      smack-core/src/integration-test/java/org/jivesoftware/smack/packet/PrivacyTest.java
  15. 82
      smack-core/src/integration-test/java/org/jivesoftware/smack/test/SmackTestCase.java
  16. 2
      smack-core/src/main/java/org/jivesoftware/smack/AbstractConnectionListener.java
  17. 52
      smack-core/src/main/java/org/jivesoftware/smack/AbstractXMPPConnection.java
  18. 30
      smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java
  19. 2
      smack-core/src/main/java/org/jivesoftware/smack/ConnectionCreationListener.java
  20. 2
      smack-core/src/main/java/org/jivesoftware/smack/ConnectionListener.java
  21. 14
      smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java
  22. 12
      smack-core/src/main/java/org/jivesoftware/smack/SASLAuthentication.java
  23. 24
      smack-core/src/main/java/org/jivesoftware/smack/SmackConfiguration.java
  24. 32
      smack-core/src/main/java/org/jivesoftware/smack/SmackException.java
  25. 20
      smack-core/src/main/java/org/jivesoftware/smack/StanzaCollector.java
  26. 4
      smack-core/src/main/java/org/jivesoftware/smack/StanzaListener.java
  27. 2
      smack-core/src/main/java/org/jivesoftware/smack/SynchronizationPoint.java
  28. 4
      smack-core/src/main/java/org/jivesoftware/smack/UnparseableStanza.java
  29. 88
      smack-core/src/main/java/org/jivesoftware/smack/XMPPConnection.java
  30. 6
      smack-core/src/main/java/org/jivesoftware/smack/XMPPConnectionRegistry.java
  31. 12
      smack-core/src/main/java/org/jivesoftware/smack/XMPPException.java
  32. 8
      smack-core/src/main/java/org/jivesoftware/smack/compression/Java7ZlibInputOutputStream.java
  33. 2
      smack-core/src/main/java/org/jivesoftware/smack/compression/XMPPInputOutputStream.java
  34. 14
      smack-core/src/main/java/org/jivesoftware/smack/debugger/SmackDebugger.java
  35. 4
      smack-core/src/main/java/org/jivesoftware/smack/filter/IQTypeFilter.java
  36. 4
      smack-core/src/main/java/org/jivesoftware/smack/filter/MessageTypeFilter.java
  37. 4
      smack-core/src/main/java/org/jivesoftware/smack/initializer/SmackInitializer.java
  38. 2
      smack-core/src/main/java/org/jivesoftware/smack/initializer/UrlInitializer.java
  39. 4
      smack-core/src/main/java/org/jivesoftware/smack/initializer/VmArgInitializer.java
  40. 6
      smack-core/src/main/java/org/jivesoftware/smack/packet/AbstractError.java
  41. 2
      smack-core/src/main/java/org/jivesoftware/smack/packet/Bind.java
  42. 2
      smack-core/src/main/java/org/jivesoftware/smack/packet/IQ.java
  43. 4
      smack-core/src/main/java/org/jivesoftware/smack/packet/Message.java
  44. 10
      smack-core/src/main/java/org/jivesoftware/smack/packet/Packet.java
  45. 8
      smack-core/src/main/java/org/jivesoftware/smack/packet/Presence.java
  46. 8
      smack-core/src/main/java/org/jivesoftware/smack/packet/Stanza.java
  47. 6
      smack-core/src/main/java/org/jivesoftware/smack/packet/StanzaError.java
  48. 4
      smack-core/src/main/java/org/jivesoftware/smack/parsing/ExceptionLoggingCallback.java
  49. 4
      smack-core/src/main/java/org/jivesoftware/smack/parsing/ExceptionThrowingCallback.java
  50. 6
      smack-core/src/main/java/org/jivesoftware/smack/parsing/ParsingExceptionCallback.java
  51. 28
      smack-core/src/main/java/org/jivesoftware/smack/provider/EmbeddedExtensionProvider.java
  52. 4
      smack-core/src/main/java/org/jivesoftware/smack/provider/ExtensionProviderInfo.java
  53. 4
      smack-core/src/main/java/org/jivesoftware/smack/provider/IQProviderInfo.java
  54. 2
      smack-core/src/main/java/org/jivesoftware/smack/provider/Provider.java
  55. 4
      smack-core/src/main/java/org/jivesoftware/smack/provider/ProviderFileLoader.java
  56. 4
      smack-core/src/main/java/org/jivesoftware/smack/provider/ProviderLoader.java
  57. 2
      smack-core/src/main/java/org/jivesoftware/smack/provider/StreamFeatureProviderInfo.java
  58. 4
      smack-core/src/main/java/org/jivesoftware/smack/proxy/HTTPProxySocketConnection.java
  59. 4
      smack-core/src/main/java/org/jivesoftware/smack/proxy/ProxyException.java
  60. 12
      smack-core/src/main/java/org/jivesoftware/smack/proxy/ProxyInfo.java
  61. 8
      smack-core/src/main/java/org/jivesoftware/smack/proxy/Socks4ProxySocketConnection.java
  62. 10
      smack-core/src/main/java/org/jivesoftware/smack/proxy/Socks5ProxySocketConnection.java
  63. 2
      smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLErrorException.java
  64. 36
      smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java
  65. 8
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/SASLXOauth2Mechanism.java
  66. 2
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/ScramHmac.java
  67. 10
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/ScramMechanism.java
  68. 2
      smack-core/src/main/java/org/jivesoftware/smack/sasl/core/ScramPlusMechanism.java
  69. 6
      smack-core/src/main/java/org/jivesoftware/smack/sasl/packet/SaslStreamElements.java
  70. 4
      smack-core/src/main/java/org/jivesoftware/smack/util/ArrayBlockingQueueWithShutdown.java
  71. 4
      smack-core/src/main/java/org/jivesoftware/smack/util/DNSUtil.java
  72. 2
      smack-core/src/main/java/org/jivesoftware/smack/util/FileUtils.java
  73. 2
      smack-core/src/main/java/org/jivesoftware/smack/util/ObservableReader.java
  74. 2
      smack-core/src/main/java/org/jivesoftware/smack/util/ObservableWriter.java
  75. 30
      smack-core/src/main/java/org/jivesoftware/smack/util/PacketParserUtils.java
  76. 2
      smack-core/src/main/java/org/jivesoftware/smack/util/ParserUtils.java
  77. 4
      smack-core/src/main/java/org/jivesoftware/smack/util/ReaderListener.java
  78. 2
      smack-core/src/main/java/org/jivesoftware/smack/util/StringUtils.java
  79. 8
      smack-core/src/main/java/org/jivesoftware/smack/util/TLSUtils.java
  80. 4
      smack-core/src/main/java/org/jivesoftware/smack/util/WriterListener.java
  81. 6
      smack-core/src/main/java/org/jivesoftware/smack/util/XmlStringBuilder.java
  82. 4
      smack-core/src/main/java/org/jivesoftware/smack/util/dns/HostAddress.java
  83. 4
      smack-core/src/main/java/org/jivesoftware/smack/util/dns/SRVRecord.java
  84. 2
      smack-core/src/main/java/org/jivesoftware/smack/util/stringencoder/Base32.java
  85. 4
      smack-core/src/main/java/org/jivesoftware/smack/util/stringencoder/StringEncoder.java
  86. 12
      smack-core/src/test/java/org/jivesoftware/smack/DummyConnection.java
  87. 2
      smack-core/src/test/java/org/jivesoftware/smack/StanzaCollectorTest.java
  88. 2
      smack-core/src/test/java/org/jivesoftware/smack/ThreadedDummyConnection.java
  89. 10
      smack-core/src/test/java/org/jivesoftware/smack/packet/IQResponseTest.java
  90. 70
      smack-core/src/test/java/org/jivesoftware/smack/packet/XMPPErrorTest.java
  91. 2
      smack-core/src/test/java/org/jivesoftware/smack/parsing/ParsingExceptionTest.java
  92. 2
      smack-core/src/test/java/org/jivesoftware/smack/util/PacketParserUtilsTest.java
  93. 4
      smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebugger.java
  94. 4
      smack-debug/src/main/java/org/jivesoftware/smackx/debugger/EnhancedDebuggerWindow.java
  95. 12
      smack-debug/src/main/java/org/jivesoftware/smackx/debugger/LiteDebugger.java
  96. 2
      smack-experimental/src/main/java/org/jivesoftware/smack/experimental/ExperimentalInitializer.java
  97. 34
      smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/CarbonManager.java
  98. 8
      smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/packet/CarbonExtension.java
  99. 2
      smack-experimental/src/main/java/org/jivesoftware/smackx/carbons/provider/CarbonManagerProvider.java
  100. 8
      smack-experimental/src/main/java/org/jivesoftware/smackx/chat_markers/ChatMarkersManager.java
  101. Some files were not shown because too many files have changed in this diff Show More

@ -44,21 +44,19 @@
<!--
Explaining the following Regex
^ \s* [\S && [^ \*/]]+ \s+ $
| | | | | +- End of Line (6)
| | | | +- At least one whitespace (5)
| | | +- At least one or more of the previous character class (4)
| | +- All non-whitespace characters except '*' and '/' (to exclude javadoc) (3)
| +- Zero or more space characters (2)
+- Start of Line (1)
\s+ $
| +- End of Line (2)
+- At least one whitespace (1)
Rationale:
Matches trailing whitespace (5) in lines containing at least one (4) non-whitespace character
that is not one of the characters used by javadoc (3).
Matches trailing whitespace (2) in lines containing at least one (1) non-whitespace character
-->
<property name="format" value="^\s*[\S&amp;&amp;[^\*/]]+\s+$"/>
<property name="format" value="\s+$"/>
<property name="message" value="Line containing trailing whitespace character(s)"/>
</module>
<!-- <module name="RegexpSingleline"> -->
<!-- <property name="format" value="fqdn"/> -->
<!-- </module> -->
<module name="RegexpSingleline">
<property name="format" value="^\s*//[^\s]"/>
<property name="message" value="Comment start ('//') followed by non-space character. You would not continue after a punctuation without a space, would you?"/>

@ -26,7 +26,7 @@ import org.jivesoftware.smack.proxy.ProxyInfo;
/**
* Configuration to use while establishing the connection to the XMPP server via
* HTTP binding.
*
*
* @see XMPPBOSHConnection
* @author Guenther Niess
*/

@ -64,7 +64,7 @@ import org.xmlpull.v1.XmlPullParserFactory;
/**
* Creates a connection to an XMPP server via HTTP binding.
* This is specified in the XEP-0206: XMPP Over BOSH.
*
*
* @see XMPPConnection
* @author Guenther Niess
*/
@ -109,7 +109,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
/**
* Create a HTTP Binding connection to an XMPP server.
*
*
* @param username the username to use.
* @param password the password to use.
* @param https true if you want to use SSL
@ -131,7 +131,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
/**
* Create a HTTP Binding connection to an XMPP server.
*
*
* @param config The configuration which is used for this connection.
*/
public XMPPBOSHConnection(BOSHConfiguration config) {
@ -191,7 +191,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
// If there is no feedback, throw an remote server timeout error
if (!connected && !done) {
done = true;
String errorMessage = "Timeout reached for the connection to "
String errorMessage = "Timeout reached for the connection to "
+ getHost() + ":" + getPort() + ".";
throw new SmackException(errorMessage);
}
@ -246,7 +246,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
}
/**
* Closes the connection by setting presence to unavailable and closing the
* Closes the connection by setting presence to unavailable and closing the
* HTTP client. The shutdown logic will be used during a planned disconnection or when
* dealing with an unexpected disconnection. Unlike {@link #disconnect()} the connection's
* BOSH stanza reader will not be removed; thus connection's state is kept.
@ -289,7 +289,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
/**
* Send a HTTP request to the connection manager with the provided body element.
*
*
* @param body the body which will be sent.
* @throws BOSHException
*/
@ -405,7 +405,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
/**
* A listener class which listen for a successfully established connection
* and connection errors and notifies the BOSHConnection.
*
*
* @author Guenther Niess
*/
private class BOSHConnectionListener implements BOSHClientConnListener {

@ -28,10 +28,10 @@ import com.jcraft.jzlib.InflaterInputStream;
/**
* This class provides XMPP "zlib" compression with the help of JZLib.
*
*
* @author Florian Schmaus
* @see <a href="http://www.jcraft.com/jzlib/">JZLib</a>
*
*
*/
public class JzlibInputOutputStream extends XMPPInputOutputStream {

@ -72,7 +72,7 @@ public class IQTest extends SmackTestCase {
/**
* Check that sending an IQ to a full JID that is offline returns an IQ ERROR instead
* of being route to some other resource of the same user.
* of being route to some other resource of the same user.
*/
public void testFullJIDToOfflineUser() {
// Request the version from the server.

@ -21,7 +21,7 @@ import org.jivesoftware.smack.test.SmackTestCase;
import org.jivesoftware.smack.util.StringUtils;
/**
* Includes set of login tests.
* Includes set of login tests.
*
* @author Gaston Dombiak
*/

@ -213,7 +213,7 @@ public class MessageTest extends SmackTestCase {
StanzaCollector collector = getConnection(0).createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
StanzaCollector coll3 = conn3.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
// User1 sends a message to the bare JID of User0
// User1 sends a message to the bare JID of User0
Chat chat = getConnection(1).getChatManager().createChat(getBareJID(0), null);
chat.sendMessage("Test 1");
chat.sendMessage("Test 2");
@ -325,7 +325,7 @@ public class MessageTest extends SmackTestCase {
StanzaCollector coll3 = conn3.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
StanzaCollector coll4 = conn4.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
// Send a message from this resource to indicate most recent activity
// Send a message from this resource to indicate most recent activity
conn3.sendStanza(new Message("admin@" + getXMPPServiceDomain()));
// User1 sends a message to the bare JID of User0

@ -22,7 +22,7 @@ import org.jivesoftware.smack.packet.PrivacyItem;
/**
* This class supports automated tests about privacy communication from the
* server to the client.
*
*
* @author Francisco Vives
*/

@ -208,7 +208,7 @@ public class ReconnectionTest extends SmackTestCase {
private CountDownLatch countDownLatch;
private XMPPTCPConnectionTestListener(CountDownLatch latch) {
countDownLatch = latch;
countDownLatch = latch;
}
private XMPPTCPConnectionTestListener() {

@ -17,7 +17,7 @@ package org.jivesoftware.smack;
/**
* Run all tests defined in RosterTest but initialize the roster before connection is logged in and
* authenticated.
*
*
* @author Henning Staib
*/
public class RosterInitializedBeforeConnectTest extends RosterSmackTest {

@ -24,7 +24,7 @@ import org.jivesoftware.smack.test.SmackTestCase;
/**
* Test cases for adding the {@link RosterListener} in different connection states.
*
*
* @author Henning Staib
*/
public class RosterListenerTest extends SmackTestCase {

@ -78,7 +78,7 @@ public class RosterSmackTest extends SmackTestCase {
@Override
public void entriesAdded(Collection<String> addresses) {}
};
};
roster.addRosterListener(latchCounter);
@ -422,7 +422,7 @@ public class RosterSmackTest extends SmackTestCase {
/**
* Test presence management.<p>
*
*
* 1. Log in user0 from a client and user1 from 2 clients
* 2. Create presence subscription of type BOTH between 2 users
* 3. Check that presence is correctly delivered to both users
@ -699,12 +699,12 @@ public class RosterSmackTest extends SmackTestCase {
public void entriesUpdated(Collection<String> addresses) {}
@Override
public void entriesDeleted(Collection<String> addresses) {
public void entriesDeleted(Collection<String> addresses) {
latch.countDown();
}
@Override
public void entriesAdded(Collection<String> addresses) {}
};
};
}

@ -22,9 +22,9 @@ import org.xmlpull.v1.XmlPullParserException;
import java.io.StringReader;
/**
/**
* Test the PrivacyProvider class with valids privacy xmls
*
*
* @author Francisco Vives
*/
public class PrivacyProviderTest extends SmackTestCase {
@ -47,7 +47,7 @@ public class PrivacyProviderTest extends SmackTestCase {
}
/**
* Check the parser with an xml with all kind of stanzas.
* Check the parser with an xml with all kind of stanzas.
* To create the xml string based from an xml file, replace:\n with: "\n + "
*/
public void testFull() {
@ -296,7 +296,7 @@ public class PrivacyProviderTest extends SmackTestCase {
/**
* Check the parser with an xml with empty lists. It includes the active,
* Check the parser with an xml with empty lists. It includes the active,
* default and special list.
* To create the xml string based from an xml file, replace:\n with: "\n + "
*/
@ -338,7 +338,7 @@ public class PrivacyProviderTest extends SmackTestCase {
}
/**
* Check the parser with an xml with empty lists. It includes the active,
* Check the parser with an xml with empty lists. It includes the active,
* default and special list.
* To create the xml string based from an xml file, replace:\n with: "\n + "
*/

@ -452,7 +452,7 @@ public class PrivacyTest extends SmackTestCase {
// Look for the same server and original items
receivedItem = privacyItems.get(j);
index = 0;
while ((index < originalPrivacyItems.length)
while ((index < originalPrivacyItems.length)
&& (originalPrivacyItems[index].getOrder() != receivedItem.getOrder())) {
index++;
}
@ -484,7 +484,7 @@ public class PrivacyTest extends SmackTestCase {
/**
* This class supports automated tests about privacy communication from the
* server to the client.
*
*
* @author Francisco Vives
*/

@ -36,17 +36,17 @@ import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlPullParser;
/**
* Base class for all the test cases which provides a pre-configured execution context. This
* means that any test case that subclassifies this base class will have access to a pool of
* Base class for all the test cases which provides a pre-configured execution context. This
* means that any test case that subclassifies this base class will have access to a pool of
* connections and to the user of each connection. The maximum number of connections in the pool
* can be controlled by the message {@link #getMaxConnections()} which every subclass must
* implement.<p>
*
* This base class defines a default execution context (i.e. host, port, chat domain and muc
* can be controlled by the message {@link #getMaxConnections()} which every subclass must
* implement.<p>
*
* This base class defines a default execution context (i.e. host, port, chat domain and muc
* domain) which can be found in the file "config/test-case.xml". However, each subclass could
* redefine the default configuration by providing its own configuration file (if desired). The
* name of the configuration file must be of the form <test class name>.xml (e.g. RosterTest.xml).
* The file must be placed in the folder "config". This folder is where the default configuration
* The file must be placed in the folder "config". This folder is where the default configuration
* file is being held.
*
* @author Gaston Dombiak
@ -81,21 +81,21 @@ public abstract class SmackTestCase extends TestCase {
}
/**
* Returns the maximum number of connections to initialize for this test case. All the
* initialized connections will be connected to the server using a new test account for
* each conection.
*
* Returns the maximum number of connections to initialize for this test case. All the
* initialized connections will be connected to the server using a new test account for
* each conection.
*
* @return the maximum number of connections to initialize for this test case.
*/
protected abstract int getMaxConnections();
/**
* Returns a SocketFactory that will be used to create the socket to the XMPP server. By
* Returns a SocketFactory that will be used to create the socket to the XMPP server. By
* default no SocketFactory is used but subclasses my want to redefine this method.<p>
*
* A custom SocketFactory allows fine-grained control of the actual connection to the XMPP
*
* A custom SocketFactory allows fine-grained control of the actual connection to the XMPP
* server. A typical use for a custom SocketFactory is when connecting through a SOCKS proxy.
*
*
* @return a SocketFactory that will be used to create the socket to the XMPP server.
*/
protected SocketFactory getSocketFactory() {
@ -111,7 +111,7 @@ public abstract class SmackTestCase extends TestCase {
* <p>
* Connections are connected by default.
* Overwrite this method if the test case needs unconnected connections.
*
*
* @return <code>true</code> if connections should NOT be connected automatically,
* <code>false</code> if connections should be connected automatically.
*/
@ -123,11 +123,11 @@ public abstract class SmackTestCase extends TestCase {
* Returns the XMPPTCPConnection located at the requested position. Each test case holds a
* pool of connections which is initialized while setting up the test case. The maximum
* number of connections is controlled by the message {@link #getMaxConnections()} which
* every subclass must implement.<p>
*
* If the requested position is greater than the connections size then an
* IllegalArgumentException will be thrown.
*
* every subclass must implement.<p>
*
* If the requested position is greater than the connections size then an
* IllegalArgumentException will be thrown.
*
* @param index the position in the pool of the connection to look for.
* @return the XMPPTCPConnection located at the requested position.
*/
@ -156,9 +156,9 @@ public abstract class SmackTestCase extends TestCase {
}
/**
* Returns the name of the user (e.g. johndoe) that is using the connection
* Returns the name of the user (e.g. johndoe) that is using the connection
* located at the requested position.
*
*
* @param index the position in the pool of the connection to look for.
* @return the user of the user (e.g. johndoe).
*/
@ -167,9 +167,9 @@ public abstract class SmackTestCase extends TestCase {
}
/**
* Returns the password of the user (e.g. johndoe) that is using the connection
* Returns the password of the user (e.g. johndoe) that is using the connection
* located at the requested position.
*
*
* @param index the position in the pool of the connection to look for.
* @return the password of the user (e.g. johndoe).
*/
@ -180,7 +180,7 @@ public abstract class SmackTestCase extends TestCase {
/**
* Returns the bare XMPP address of the user (e.g. johndoe@jabber.org) that is
* using the connection located at the requested position.
*
*
* @param index the position in the pool of the connection to look for.
* @return the bare XMPP address of the user (e.g. johndoe@jabber.org).
*/
@ -191,7 +191,7 @@ public abstract class SmackTestCase extends TestCase {
/**
* Returns the full XMPP address of the user (e.g. johndoe@jabber.org/Smack) that is
* using the connection located at the requested position.
*
*
* @param index the position in the pool of the connection to look for.
* @return the full XMPP address of the user (e.g. johndoe@jabber.org/Smack).
*/
@ -213,7 +213,7 @@ public abstract class SmackTestCase extends TestCase {
/**
* Returns the default groupchat service domain.
*
*
* @return the default groupchat service domain.
*/
protected String getChatDomain() {
@ -222,7 +222,7 @@ public abstract class SmackTestCase extends TestCase {
/**
* Returns the default MUC service domain.
*
*
* @return the default MUC service domain.
*/
protected String getMUCDomain() {
@ -273,7 +273,7 @@ public abstract class SmackTestCase extends TestCase {
if (!getConnection(0).getAccountManager().supportsAccountCreation())
fail("Server does not support account creation");
// Create the account and try logging in again as the
// Create the account and try logging in again as the
// same user.
try {
createAccount(i, currentUser, currentPassword);
@ -345,7 +345,7 @@ public abstract class SmackTestCase extends TestCase {
con.login(getUsername(i), getUsername(i));
}
else if (!getConnection(i).isAuthenticated()) {
getConnection(i).login(getUsername(i), getUsername(i));
getConnection(i).login(getUsername(i), getUsername(i));
}
// Delete the created account for the test
getConnection(i).getAccountManager().deleteAccount();
@ -366,22 +366,22 @@ public abstract class SmackTestCase extends TestCase {
}
/**
* Initializes the context of the test case. We will first try to load the configuration from
* a file whose name is conformed by the test case class name plus an .xml extension
* (e.g RosterTest.xml). If no file was found under that name then we will try to load the
* Initializes the context of the test case. We will first try to load the configuration from
* a file whose name is conformed by the test case class name plus an .xml extension
* (e.g RosterTest.xml). If no file was found under that name then we will try to load the
* default configuration for all the test cases from the file "config/test-case.xml".
*
*/
private void init() {
try {
boolean found = false;
// Try to load the configutation from an XML file specific for this test case
// Try to load the configutation from an XML file specific for this test case
Enumeration<URL> resources =
ClassLoader.getSystemClassLoader().getResources(getConfigurationFilename());
while (resources.hasMoreElements()) {
found = parseURL(resources.nextElement());
}
// If none was found then try to load the configuration from the default configuration
// If none was found then try to load the configuration from the default configuration
// file (i.e. "config/test-case.xml")
if (!found) {
resources = ClassLoader.getSystemClassLoader().getResources("config/test-case.xml");
@ -401,8 +401,8 @@ public abstract class SmackTestCase extends TestCase {
/**
* Returns true if the given URL was found and parsed without problems. The file provided
* by the URL must contain information useful for the test case configuration, such us,
* host and port of the server.
*
* host and port of the server.
*
* @param url the url of the file to parse.
* @return true if the given URL was found and parsed without problems.
*/
@ -487,11 +487,11 @@ public abstract class SmackTestCase extends TestCase {
}
/**
* Returns the name of the configuration file related to <b>this</b> test case. By default all
* Returns the name of the configuration file related to <b>this</b> test case. By default all
* the test cases will use the same configuration file. However, it's possible to override the
* default configuration by providing a file of the form <test case class name>.xml
* (e.g. RosterTest.xml).
*
*
* @return the name of the configuration file related to this test case.
*/
private String getConfigurationFilename() {
@ -502,7 +502,7 @@ public abstract class SmackTestCase extends TestCase {
/**
* Subscribes all connections with each other: They all become friends
*
*
* @throws XMPPException
*/
protected void letsAllBeFriends() throws XMPPException {

@ -21,7 +21,7 @@ package org.jivesoftware.smack;
* methods defined by the {@link ConnectionListener} interface. This is a
* convenience class which should be used in case you do not need to implement
* all methods.
*
*
* @author Henning Staib
*/
public class AbstractConnectionListener implements ConnectionListener {

@ -100,7 +100,7 @@ import org.xmlpull.v1.XmlPullParser;
public abstract class AbstractXMPPConnection implements XMPPConnection {
private static final Logger LOGGER = Logger.getLogger(AbstractXMPPConnection.class.getName());
/**
/**
* Counter to uniquely identify connections that are created.
*/
private static final AtomicInteger connectionCounter = new AtomicInteger(0);
@ -293,7 +293,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Create a new XMPPConnection to an XMPP server.
*
*
* @param configuration The configuration which is used to establish the connection.
*/
protected AbstractXMPPConnection(ConnectionConfiguration configuration) {
@ -355,12 +355,12 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* <p>
* Listeners will be preserved from a previous connection.
* </p>
*
*
* @throws XMPPException if an error occurs on the XMPP protocol level.
* @throws SmackException if an error occurs somewhere else besides XMPP protocol level.
* @throws IOException
* @throws IOException
* @return a reference to this object, to chain <code>connect()</code> with <code>login()</code>.
* @throws InterruptedException
* @throws InterruptedException
*/
public synchronized AbstractXMPPConnection connect() throws SmackException, IOException, XMPPException, InterruptedException {
// Check if not already connected
@ -395,11 +395,11 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* Abstract method that concrete subclasses of XMPPConnection need to implement to perform their
* way of XMPP connection establishment. Implementations are required to perform an automatic
* login if the previous connection state was logged (authenticated).
*
*
* @throws SmackException
* @throws IOException
* @throws XMPPException
* @throws InterruptedException
* @throws InterruptedException
*/
protected abstract void connectInternal() throws SmackException, IOException, XMPPException, InterruptedException;
@ -412,7 +412,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Logs in to the server using the strongest SASL mechanism supported by
* the server. If more than the connection's default stanza timeout elapses in each step of the
* the server. If more than the connection's default stanza timeout elapses in each step of the
* authentication process without a response from the server, a
* {@link SmackException.NoResponseException} will be thrown.
* <p>
@ -427,11 +427,11 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* {@link ConnectionConfiguration.Builder#setCallbackHandler(javax.security.auth.callback.CallbackHandler)}.
* For more advanced login settings see {@link ConnectionConfiguration}.
* </p>
*
*
* @throws XMPPException if an error occurs on the XMPP protocol level.
* @throws SmackException if an error occurs somewhere else besides XMPP protocol level.
* @throws IOException if an I/O error occurs during login.
* @throws InterruptedException
* @throws InterruptedException
*/
public synchronized void login() throws XMPPException, SmackException, IOException, InterruptedException {
// The previously used username, password and resource take over precedence over the
@ -445,13 +445,13 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Same as {@link #login(CharSequence, String, Resourcepart)}, but takes the resource from the connection
* configuration.
*
*
* @param username
* @param password
* @throws XMPPException
* @throws SmackException
* @throws IOException
* @throws InterruptedException
* @throws InterruptedException
* @see #login
*/
public synchronized void login(CharSequence username, String password) throws XMPPException, SmackException,
@ -462,14 +462,14 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Login with the given username (authorization identity). You may omit the password if a callback handler is used.
* If resource is null, then the server will generate one.
*
*
* @param username
* @param password
* @param resource
* @throws XMPPException
* @throws SmackException
* @throws IOException
* @throws InterruptedException
* @throws InterruptedException
* @see #login
*/
public synchronized void login(CharSequence username, String password, Resourcepart resource) throws XMPPException,
@ -580,7 +580,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* Get the name of the SASL mechanism that was used to authenticate this connection. This returns the name of
* mechanism which was used the last time this connection was authenticated, and will return <code>null</code> if
* this connection was not authenticated before.
*
*
* @return the name of the used SASL mechanism.
* @since 4.2
*/
@ -674,7 +674,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Returns the SASLAuthentication manager that is responsible for authenticating with
* the server.
*
*
* @return the SASLAuthentication manager that is responsible for authenticating with
* the server.
*/
@ -708,9 +708,9 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* information such as "On vacation". Typically, just the status text of the presence
* stanza is set with online information, but most XMPP servers will deliver the full
* presence stanza with whatever data is set.
*
*
* @param unavailablePresence the optional presence stanza to send during shutdown.
* @throws NotConnectedException
* @throws NotConnectedException
*/
public synchronized void disconnect(Presence unavailablePresence) throws NotConnectedException {
if (unavailablePresence != null) {
@ -871,7 +871,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* <p>
* Compared to {@link #firePacketInterceptors(Stanza)}, the listeners will be invoked in a new thread.
* </p>
*
*
* @param packet the stanza to process.
*/
@SuppressWarnings("javadoc")
@ -946,7 +946,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
* Since the thread that requested to send the stanza will invoke all interceptors, it
* is important that interceptors perform their work as soon as possible so that the
* thread does not remain blocked for a long period.
*
*
* @param packet the stanza that is going to be sent to the server
*/
private void firePacketInterceptors(Stanza packet) {
@ -970,7 +970,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Initialize the {@link #debugger}. You can specify a customized {@link SmackDebugger}
* by setup the system property <code>smack.debuggerClass</code> to the implementation.
*
*
* @throws IllegalStateException if the reader or writer isn't yet initialized.
* @throws IllegalArgumentException if the SmackDebugger can't be loaded.
*/
@ -1208,7 +1208,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Sets whether the connection has already logged in the server. This method assures that the
* {@link #wasAuthenticated} flag is never reset once it has ever been set.
*
*
*/
protected void setWasAuthenticated() {
// Never reset the flag if the connection has ever been authenticated
@ -1284,7 +1284,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Create a class which associates a stanza filter with a listener.
*
*
* @param packetListener the stanza listener.
* @param packetFilter the associated filter or null if it listen for all packets.
*/
@ -1312,7 +1312,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Create a class which associates a stanza filter with an interceptor.
*
*
* @param packetInterceptor the interceptor.
* @param packetFilter the associated filter or null if it intercepts all packets.
*/
@ -1681,7 +1681,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Install a parsing exception callback, which will be invoked once an exception is encountered while parsing a
* stanza.
*
*
* @param callback the callback to install
*/
public void setParsingExceptionCallback(ParsingExceptionCallback callback) {
@ -1690,7 +1690,7 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
/**
* Get the current active parsing exception callback.
*
*
* @return the active exception callback or null if there is none
*/
public ParsingExceptionCallback getParsingExceptionCallback() {

@ -107,12 +107,12 @@ public abstract class ConnectionConfiguration {
private final X509TrustManager customX509TrustManager;
/**
*
*
*/
private final String[] enabledSSLProtocols;
/**
*
*
*/
private final String[] enabledSSLCiphers;
@ -210,7 +210,7 @@ public abstract class ConnectionConfiguration {
}
/**
* Retuns the path to the keystore file. The key store file contains the
* Retuns the path to the keystore file. The key store file contains the
* certificates that may be used to authenticate the client to the server,
* in the event the server requests or requires it.
*
@ -271,7 +271,7 @@ public abstract class ConnectionConfiguration {
* Returns the configured HostnameVerifier of this ConnectionConfiguration or the Smack default
* HostnameVerifier configured with
* {@link SmackConfiguration#setDefaultHostnameVerifier(HostnameVerifier)}.
*
*
* @return a configured HostnameVerifier or <code>null</code>
*/
public HostnameVerifier getHostnameVerifier() {
@ -305,7 +305,7 @@ public abstract class ConnectionConfiguration {
/**
* Returns the socket factory used to create new xmppConnection sockets.
* This is useful when connecting through SOCKS5 proxies.
*
*
* @return socketFactory used to create new sockets.
*/
public SocketFactory getSocketFactory() {
@ -413,7 +413,7 @@ public abstract class ConnectionConfiguration {
/**
* Returns the optional XMPP address to be requested as the SASL authorization identity.
*
*
* @return the authorization identifier.
* @see <a href="http://tools.ietf.org/html/rfc6120#section-6.3.8">RFC 6120 § 6.3.8. Authorization Identity</a>
* @since 4.2
@ -689,7 +689,7 @@ public abstract class ConnectionConfiguration {
}
/**
* Sets the path to the keystore file. The key store file contains the
* Sets the path to the keystore file. The key store file contains the
* certificates that may be used to authenticate the client to the server,
* in the event the server requests or requires it.
*
@ -752,8 +752,8 @@ public abstract class ConnectionConfiguration {
/**
* Set the enabled SSL/TLS ciphers.
*
* @param enabledSSLCiphers the enabled SSL/TLS ciphers
*
* @param enabledSSLCiphers the enabled SSL/TLS ciphers
* @return a reference to this builder.
*/
public B setEnabledSSLCiphers(String[] enabledSSLCiphers) {
@ -764,7 +764,7 @@ public abstract class ConnectionConfiguration {
/**
* Set the HostnameVerifier used to verify the hostname of SSLSockets used by XMPP connections
* created with this ConnectionConfiguration.
*
*
* @param verifier
* @return a reference to this builder.
*/
@ -795,7 +795,7 @@ public abstract class ConnectionConfiguration {
/**
* Set the Smack debugger factory used to construct Smack debuggers.
*
*
* @param debuggerFactory the Smack debugger factory.
* @return a reference to this builder.
*/
@ -832,7 +832,7 @@ public abstract class ConnectionConfiguration {
*
* Some SASL mechanisms (e.g. SASL External) may also signal the username (as "authorization identity"), in
* which case Smack should not throw an IllegalArgumentException when the username is not set.
*
*
* @return a reference to this builder.
*/
public B allowEmptyOrNullUsernames() {
@ -843,7 +843,7 @@ public abstract class ConnectionConfiguration {
/**
* Perform anonymous authentication using SASL ANONYMOUS. Your XMPP service must support this authentication
* mechanism. This method also calls {@link #addEnabledSaslMechanism(String)} with "ANONYMOUS" as argument.
*
*
* @return a reference to this builder.
*/
public B performSaslAnonymousAuthentication() {
@ -902,7 +902,7 @@ public abstract class ConnectionConfiguration {
* Enable the given SASL mechanisms. If you never add a mechanism to the set of enabled ones, <b>all mechanisms
* known to Smack</b> will be enabled. Only explicitly enable particular SASL mechanisms if you want to limit
* the used mechanisms to the enabled ones.
*
*
* @param saslMechanisms a collection of names of mechanisms to enable.
* @return a reference to this builder.
*/
@ -935,7 +935,7 @@ public abstract class ConnectionConfiguration {
* service domain, which should typically match.
* Calling this will also SASL CRAM, since this mechanism does not support authzid.
* </p>
*
*
* @param authzid The BareJid to be requested as the authorization identifier.
* @return a reference to this builder.
* @see <a href="http://tools.ietf.org/html/rfc6120#section-6.3.8">RFC 6120 § 6.3.8. Authorization Identity</a>

@ -30,7 +30,7 @@ public interface ConnectionCreationListener {
/**
* Notification that a new connection has been created. The new connection
* will not yet be connected to the server.
*
*
* @param connection the newly created connection.
*/
void connectionCreated(XMPPConnection connection);

@ -23,7 +23,7 @@ package org.jivesoftware.smack;
*
* @see XMPPConnection#addConnectionListener
* @see XMPPConnection#removeConnectionListener
*
*
* @author Matt Tucker
*/
public interface ConnectionListener {

@ -44,7 +44,7 @@ import org.jivesoftware.smack.util.Async;
* <li>If that fails it will indefinitely try to connect once every five minutes.
* </ol>
*
* {@link ReconnectionPolicy#FIXED_DELAY} - The reconnection mechanism will try to reconnect after a fixed delay
* {@link ReconnectionPolicy#FIXED_DELAY} - The reconnection mechanism will try to reconnect after a fixed delay
* independently from the number of reconnection attempts already performed.
* <p>
* Interrupting the reconnection thread will abort the reconnection mechanism.
@ -60,7 +60,7 @@ public final class ReconnectionManager {
/**
* Get a instance of ReconnectionManager for the given connection.
*
*
* @param connection
* @return a ReconnectionManager for the connection.
*/
@ -89,7 +89,7 @@ public final class ReconnectionManager {
/**
* Set if the automatic reconnection mechanism will be enabled per default for new XMPP connections. The default is
* 'false'.
*
*
* @param enabled
*/
public static void setEnabledPerDefault(boolean enabled) {
@ -121,7 +121,7 @@ public final class ReconnectionManager {
/**
* Set the default fixed delay in seconds between the reconnection attempts. Also set the
* default connection policy to {@link ReconnectionPolicy#FIXED_DELAY}
*
*
* @param fixedDelay Delay expressed in seconds
*/
public static void setDefaultFixedDelay(int fixedDelay) {
@ -131,7 +131,7 @@ public final class ReconnectionManager {
/**
* Set the default Reconnection Policy to use.
*
*
* @param reconnectionPolicy
*/
public static void setDefaultReconnectionPolicy(ReconnectionPolicy reconnectionPolicy) {
@ -162,7 +162,7 @@ public final class ReconnectionManager {
/**
* Set the fixed delay in seconds between the reconnection attempts Also set the connection
* policy to {@link ReconnectionPolicy#FIXED_DELAY}.
*
*
* @param fixedDelay Delay expressed in seconds
*/
public void setFixedDelay(int fixedDelay) {
@ -172,7 +172,7 @@ public final class ReconnectionManager {
/**
* Set the Reconnection Policy to use.
*
*
* @param reconnectionPolicy
*/
public void setReconnectionPolicy(ReconnectionPolicy reconnectionPolicy) {

@ -114,7 +114,7 @@ public final class SASLAuthentication {
/**
* Unregister a SASLMechanism by it's full class name. For example
* "org.jivesoftware.smack.sasl.javax.SASLCramMD5Mechanism".
*
*
* @param clazz the SASLMechanism class's name
* @return true if the given SASLMechanism was removed, false otherwise
*/
@ -228,10 +228,10 @@ public final class SASLAuthentication {
/**
* Wrapper for {@link #challengeReceived(String, boolean)}, with <code>finalChallenge</code> set
* to <code>false</code>.
*
*
* @param challenge a base64 encoded string representing the challenge.
* @throws SmackException
* @throws InterruptedException
* @throws InterruptedException
*/
public void challengeReceived(String challenge) throws SmackException, InterruptedException {
challengeReceived(challenge, false);
@ -261,8 +261,8 @@ public final class SASLAuthentication {
* Notification message saying that SASL authentication was successful. The next step
* would be to bind the resource.
* @param success result of the authentication.
* @throws SmackException
* @throws InterruptedException
* @throws SmackException
* @throws InterruptedException
*/
public void authenticated(Success success) throws SmackException, InterruptedException {
// RFC6120 6.3.10 "At the end of the authentication exchange, the SASL server (the XMPP
@ -284,7 +284,7 @@ public final class SASLAuthentication {
/**
* Notification message saying that SASL authentication has failed. The server may have
* closed the connection depending on the number of possible retries.
*
*
* @param saslFailure the SASL failure as reported by the server
* @see <a href="https://tools.ietf.org/html/rfc6120#section-6.5">RFC6120 6.5</a>
*/

@ -44,7 +44,7 @@ import org.jivesoftware.smack.util.Objects;
* </ul>
*
* Configuration settings are stored in org.jivesoftware.smack/smack-config.xml.
*
*
* @author Gaston Dombiak
*/
public final class SmackConfiguration {
@ -86,7 +86,7 @@ public final class SmackConfiguration {
/**
* Returns the Smack version information, eg "1.3.0".
*
*
* @return the Smack version information.
*/
public static String getVersion() {
@ -96,7 +96,7 @@ public final class SmackConfiguration {
/**
* Returns the number of milliseconds to wait for a response from
* the server. The default value is 5000 ms.
*
*
* @return the milliseconds to wait for a response from the server
* @deprecated use {@link #getDefaultReplyTimeout()} instead.
*/