1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-09-09 10:19:41 +02:00

Enable trailing whitespace checkstyle check

for all source code regions, including javadoc.
This commit is contained in:
Florian Schmaus 2018-05-09 23:06:12 +02:00
parent 9d61a6de7d
commit e8923b9d16
545 changed files with 3713 additions and 3715 deletions

View file

@ -35,7 +35,7 @@ import org.jxmpp.jid.EntityJid;
* don't send thread IDs at all. Therefore, if a message without a thread ID
* arrives it is routed to the most recently created Chat with the message
* sender.
*
*
* @author Matt Tucker
* @deprecated use <code>org.jivesoftware.smack.chat2.Chat</code> from <code>smack-extensions</code> instead.
*/
@ -94,8 +94,8 @@ public class Chat {
* </pre>
*
* @param text the text to send.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void sendMessage(String text) throws NotConnectedException, InterruptedException {
Message message = new Message();
@ -108,8 +108,8 @@ public class Chat {
* and message type of the message will automatically set to those of this chat.
*
* @param message the message to send.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void sendMessage(Message message) throws NotConnectedException, InterruptedException {
// Force the recipient, message type, and thread ID since the user elected

View file

@ -96,7 +96,7 @@ public final class ChatManager extends Manager{
*/
NONE,
/**
* Will match on the JID in the from field of the message.
* Will match on the JID in the from field of the message.
*/
SUPPLIED_JID,
/**
@ -116,7 +116,7 @@ public final class ChatManager extends Manager{
});
/**
* Determines whether incoming messages of type normal can create chats.
* Determines whether incoming messages of type normal can create chats.
*/
private boolean normalIncluded = defaultIsNormalInclude;
@ -180,7 +180,7 @@ public final class ChatManager extends Manager{
/**
* Determines whether incoming messages of type <i>normal</i> will be used for creating new chats or matching
* a message to existing ones.
*
*
* @return true if normal is allowed, false otherwise.
*/
public boolean isNormalIncluded() {
@ -190,7 +190,7 @@ public final class ChatManager extends Manager{
/**
* Sets whether to allow incoming messages of type <i>normal</i> to be used for creating new chats or matching
* a message to an existing one.
*
*
* @param normalIncluded true to allow normal, false otherwise.
*/
public void setNormalIncluded(boolean normalIncluded) {
@ -199,7 +199,7 @@ public final class ChatManager extends Manager{
/**
* Gets the current mode for matching messages with <b>NO</b> thread id to existing chats.
*
*
* @return The current mode.
*/
public MatchMode getMatchMode() {
@ -208,7 +208,7 @@ public final class ChatManager extends Manager{
/**
* Sets the mode for matching messages with <b>NO</b> thread id to existing chats.
*
*
* @param matchMode The mode to set.
*/
public void setMatchMode(MatchMode matchMode) {
@ -238,7 +238,7 @@ public final class ChatManager extends Manager{
/**
* Creates a new chat using the specified thread ID, then returns it.
*
*
* @param userJID the jid of the user this chat is with
* @param thread the thread of the created chat.
* @param listener the optional listener to add to the chat
@ -309,8 +309,8 @@ public final class ChatManager extends Manager{
* Try to get a matching chat for the given user JID, based on the {@link MatchMode}.
* <li>NONE - return null
* <li>SUPPLIED_JID - match the jid in the from field of the message exactly.
* <li>BARE_JID - if not match for from field, try the bare jid.
*
* <li>BARE_JID - if not match for from field, try the bare jid.
*
* @param userJID jid in the from field of message.
* @return Matching chat, or null if no match found.
*/
@ -383,7 +383,7 @@ public final class ChatManager extends Manager{
}
StanzaCollector createStanzaCollector(Chat chat) {
return connection().createStanzaCollector(new AndFilter(new ThreadFilter(chat.getThreadID()),
return connection().createStanzaCollector(new AndFilter(new ThreadFilter(chat.getThreadID()),
FromMatchesFilter.create(chat.getParticipant())));
}

View file

@ -115,7 +115,7 @@ public final class Roster extends Manager {
* {@link Roster#removeEntry(RosterEntry)} , etc. except adding or removing
* {@link RosterListener}s will throw an IllegalStateException.
* </p>
*
*
* @param connection the connection the roster should be retrieved for.
* @return the user's roster.
*/
@ -201,7 +201,7 @@ public final class Roster extends Manager {
private final PresencePacketListener presencePacketListener = new PresencePacketListener();
/**
*
*
*/
private boolean rosterLoadedAtLogin = rosterLoadedAtLoginDefault;
@ -437,8 +437,8 @@ public final class Roster extends Manager {
* which means the method will return immediately, and the roster will be
* reloaded at a later point when the server responds to the reload request.
* @throws NotLoggedInException If not logged in.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void reload() throws NotLoggedInException, NotConnectedException, InterruptedException {
final XMPPConnection connection = getAuthenticatedConnectionOrThrow();
@ -476,7 +476,7 @@ public final class Roster extends Manager {
*
* @throws NotLoggedInException
* @throws NotConnectedException
* @throws InterruptedException
* @throws InterruptedException
* @since 4.1
*/
public void reloadAndWait() throws NotLoggedInException, NotConnectedException, InterruptedException {
@ -627,8 +627,8 @@ public final class Roster extends Manager {
* @throws NoResponseException if there was no response from the server.
* @throws XMPPErrorException if an XMPP exception occurs.
* @throws NotLoggedInException If not logged in.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void createEntry(BareJid user, String name, String[] groups) throws NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
final XMPPConnection connection = getAuthenticatedConnectionOrThrow();
@ -717,7 +717,7 @@ public final class Roster extends Manager {
* Add a subscribe listener, which is invoked on incoming subscription requests and if
* {@link SubscriptionMode} is set to {@link SubscriptionMode#manual}. This also sets subscription
* mode to {@link SubscriptionMode#manual}.
*
*
* @param subscribeListener the subscribe listener to add.
* @return <code>true</code> if the listener was not already added.
* @since 4.2
@ -758,8 +758,8 @@ public final class Roster extends Manager {
* @throws XMPPErrorException if an XMPP error occurs.
* @throws NotLoggedInException if not logged in.
* @throws NoResponseException SmackException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void removeEntry(RosterEntry entry) throws NotLoggedInException, NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
final XMPPConnection connection = getAuthenticatedConnectionOrThrow();
@ -1124,7 +1124,7 @@ public final class Roster extends Manager {
* having an implicit subscription to the users presence.
* </p>
* Note that if the roster is not loaded, then this method will always return false.
*
*
* @param jid
* @return true if the given JID is allowed to see the users presence.
* @since 4.1

View file

@ -93,10 +93,10 @@ public final class RosterEntry extends Manager {
* Sets the name associated with this entry.
*
* @param name the name.
* @throws NotConnectedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws InterruptedException
* @throws NotConnectedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws InterruptedException
*/
public synchronized void setName(String name) throws NotConnectedException, NoResponseException, XMPPErrorException, InterruptedException {
// Do nothing if the name hasn't changed.
@ -211,7 +211,7 @@ public final class RosterEntry extends Manager {
/**
* Cancel the presence subscription the XMPP entity representing this roster entry has with us.
*
*
* @throws NotConnectedException
* @throws InterruptedException
* @since 4.2
@ -266,7 +266,7 @@ public final class RosterEntry extends Manager {
* Indicates whether some other object is "equal to" this by comparing all members.
* <p>
* The {@link #equals(Object)} method returns <code>true</code> if the user JIDs are equal.
*
*
* @param obj the reference object with which to compare.
* @return <code>true</code> if this object is the same as the obj argument; <code>false</code>
* otherwise.

View file

@ -66,15 +66,15 @@ public class RosterGroup extends Manager {
/**
* Sets the name of the group. Changing the group's name is like moving all the group entries
* of the group to a new group specified by the new name. Since this group won't have entries
* it will be removed from the roster. This means that all the references to this object will
* of the group to a new group specified by the new name. Since this group won't have entries
* it will be removed from the roster. This means that all the references to this object will
* be invalid and will need to be updated to the new group specified by the new name.
*
* @param name the name of the group.
* @throws NotConnectedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws InterruptedException
* @throws NotConnectedException
* @throws XMPPErrorException
* @throws NoResponseException
* @throws InterruptedException
*/
public void setName(String name) throws NotConnectedException, NoResponseException, XMPPErrorException, InterruptedException {
synchronized (entries) {
@ -159,7 +159,7 @@ public class RosterGroup extends Manager {
}
/**
* Adds a roster entry to this group. If the entry was unfiled then it will be removed from
* Adds a roster entry to this group. If the entry was unfiled then it will be removed from
* the unfiled list and will be added to this group.
* Note that this is a synchronous call -- Smack must wait for the server
* to receive the updated roster.
@ -167,8 +167,8 @@ public class RosterGroup extends Manager {
* @param entry a roster entry.
* @throws XMPPErrorException if an error occured while trying to add the entry to the group.
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void addEntry(RosterEntry entry) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// Only add the entry if it isn't already in the list.
@ -186,22 +186,22 @@ public class RosterGroup extends Manager {
}
/**
* Removes a roster entry from this group. If the entry does not belong to any other group
* then it will be considered as unfiled, therefore it will be added to the list of unfiled
* Removes a roster entry from this group. If the entry does not belong to any other group
* then it will be considered as unfiled, therefore it will be added to the list of unfiled
* entries.
* Note that this is a synchronous call -- Smack must wait for the server
* to receive the updated roster.
*
* @param entry a roster entry.
* @throws XMPPErrorException if an error occurred while trying to remove the entry from the group.
* @throws XMPPErrorException if an error occurred while trying to remove the entry from the group.
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void removeEntry(RosterEntry entry) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// Only remove the entry if it's in the entry list.
// Remove the entry locally, if we wait for RosterPacketListenerProcess>>Packet(Packet)
// to take place the entry will exist in the group until a packet is received from the
// to take place the entry will exist in the group until a packet is received from the
// server.
synchronized (entries) {
if (entries.contains(entry)) {

View file

@ -26,7 +26,7 @@ import org.jxmpp.jid.Jid;
/**
* A listener that is fired any time a roster is changed or the presence of
* a user in the roster is changed.
*
*
* @see Roster#addRosterListener(RosterListener)
* @author Matt Tucker
*/

View file

@ -126,7 +126,7 @@ public class RosterPacket extends IQ {
*/
private boolean subscriptionPending;
// TODO Make immutable.
// TODO Make immutable.
private String name;
private ItemType itemType = ItemType.none;
private boolean approved;
@ -399,7 +399,7 @@ public class RosterPacket extends IQ {
* point in the direction presence messages are sent. For example, if there is only a head
* pointing to the big dot, then the local user will receive presence information from the
* remote entity.
*
*
* @return the symbolic representation of this item type.
*/
public String asSymbol() {

View file

@ -27,7 +27,7 @@ import org.junit.Test;
/**
* Tests the behavior of the roster if the connection is not authenticated yet.
*
*
* @author Henning Staib
*/
public class RosterOfflineTest {

View file

@ -57,7 +57,7 @@ import org.xmlpull.v1.XmlPullParser;
/**
* Tests that verifies the correct behavior of the {@link Roster} implementation.
*
*
* @see Roster
* @see <a href="http://xmpp.org/rfcs/rfc3921.html#roster">Roster Management</a>
* @author Guenther Niess
@ -369,7 +369,7 @@ public class RosterTest extends InitSmackIm {
/**
* Tests that roster pushes with invalid from are ignored.
* @throws XmppStringprepException
* @throws XmppStringprepException
*
* @see <a href="http://xmpp.org/rfcs/rfc6121.html#roster-syntax-actions-push">RFC 6121, Section 2.1.6</a>
*/
@ -397,7 +397,7 @@ public class RosterTest extends InitSmackIm {
/**
* Test if adding an user with an empty group is equivalent with providing
* no group.
*
*
* @see <a href="http://www.igniterealtime.org/issues/browse/SMACK-294">SMACK-294</a>
*/
@Test(timeout = 5000)
@ -465,7 +465,7 @@ public class RosterTest extends InitSmackIm {
/**
* Test processing a roster push with an empty group is equivalent with providing
* no group.
*
*
* @see <a href="http://www.igniterealtime.org/issues/browse/SMACK-294">SMACK-294</a>
*/
@Test
@ -512,7 +512,7 @@ public class RosterTest extends InitSmackIm {
/**
* Remove all roster entries by iterating trough {@link Roster#getEntries()}
* and simulating receiving roster pushes from the server.
*
*
* @param connection the dummy connection of which the provided roster belongs to.
* @param roster the roster (or buddy list) which should be initialized.
*/
@ -538,8 +538,8 @@ public class RosterTest extends InitSmackIm {
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-login"
* >RFC3921: Retrieving One's Roster on Login</a>.
*
* @throws SmackException
* @throws XmppStringprepException
* @throws SmackException
* @throws XmppStringprepException
*/
private void initRoster() throws InterruptedException, SmackException, XmppStringprepException {
roster.reload();
@ -587,7 +587,7 @@ public class RosterTest extends InitSmackIm {
* Check Romeo's roster entry according to the example in
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-login"
* >RFC3921: Retrieving One's Roster on Login</a>.
*
*
* @param romeo the roster entry which should be verified.
*/
public static void verifyRomeosEntry(final RosterEntry romeo) {
@ -610,7 +610,7 @@ public class RosterTest extends InitSmackIm {
* Check Mercutio's roster entry according to the example in
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-login"
* >RFC3921: Retrieving One's Roster on Login</a>.
*
*
* @param mercutio the roster entry which should be verified.
*/
public static void verifyMercutiosEntry(final RosterEntry mercutio) {
@ -629,7 +629,7 @@ public class RosterTest extends InitSmackIm {
* Check Benvolio's roster entry according to the example in
* <a href="http://xmpp.org/rfcs/rfc3921.html#roster-login"
* >RFC3921: Retrieving One's Roster on Login</a>.
*
*
* @param benvolio the roster entry which should be verified.
*/
public static void verifyBenvoliosEntry(final RosterEntry benvolio) {
@ -654,7 +654,7 @@ public class RosterTest extends InitSmackIm {
/**
* Overwrite this method to check if the received update request is valid.
*
*
* @param updateRequest the request which would be sent to the server.
*/
abstract void verifyUpdateRequest(RosterPacket updateRequest);
@ -699,7 +699,7 @@ public class RosterTest extends InitSmackIm {
/**
* Returns the exception or error if something went wrong.
*
*
* @return the Throwable exception or error that occurred.
*/
public Throwable getException() {
@ -741,7 +741,7 @@ public class RosterTest extends InitSmackIm {
/**
* Get a collection of JIDs of the added roster items.
*
*
* @return the collection of addresses which were added.
*/
public Collection<Jid> getAddedAddresses() {
@ -750,7 +750,7 @@ public class RosterTest extends InitSmackIm {
/**
* Get a collection of JIDs of the deleted roster items.
*
*
* @return the collection of addresses which were deleted.
*/
public Collection<Jid> getDeletedAddresses() {
@ -759,7 +759,7 @@ public class RosterTest extends InitSmackIm {
/**
* Get a collection of JIDs of the updated roster items.
*
*
* @return the collection of addresses which were updated.
*/
public Collection<Jid> getUpdatedAddresses() {

View file

@ -97,8 +97,8 @@ public class RosterVersioningTest {
/**
* Tests that receiving an empty roster result causes the roster to be populated
* by all entries of the roster store.
* @throws SmackException
* @throws XMPPException
* @throws SmackException
* @throws XMPPException
*/
@Test(timeout = 300000)
public void testEqualVersionStored() throws InterruptedException, IOException, XMPPException, SmackException {
@ -131,9 +131,9 @@ public class RosterVersioningTest {
/**
* Tests that a non-empty roster result empties the store.
* @throws SmackException
* @throws XMPPException
* @throws XmppStringprepException
* @throws SmackException
* @throws XMPPException
* @throws XmppStringprepException
*/
@Test(timeout = 5000)
public void testOtherVersionStored() throws XMPPException, SmackException, XmppStringprepException {

View file

@ -44,7 +44,7 @@ import org.jxmpp.jid.impl.JidCreate;
/**
* Tests that verifies the correct behavior of the pre-approval implementation.
*
*
* @see <a href="http://xmpp.org/rfcs/rfc6121.html#sub-preapproval">Pre-Approving a Subscription Request</a>
* @author Tomáš Havlas
*/
@ -145,7 +145,7 @@ public class SubscriptionPreApprovalTest extends InitSmackIm {
/**
* Overwrite this method to check if the received roster update request is valid.
*
*
* @param updateRequest the request which would be sent to the server.
*/
abstract void verifyRosterUpdateRequest(RosterPacket updateRequest);
@ -200,7 +200,7 @@ public class SubscriptionPreApprovalTest extends InitSmackIm {
/**
* Returns the exception or error if something went wrong.
*
*
* @return the Throwable exception or error that occurred.
*/
public Throwable getException() {