1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-18 11:01:08 +01: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

@ -68,9 +68,9 @@ import org.jxmpp.jid.Jid;
* </p>
* Use the <code>getSpecificErrorConditionFrom</code> to obtain the specific
* information from an <code>XMPPError</code>.
*
*
* @author Gabriel Guardincerri
*
*
*/
public abstract class AdHocCommand {
// TODO: Analyze the redesign of command by having an ExecutionResponse as a
@ -89,7 +89,7 @@ public abstract class AdHocCommand {
/**
* Returns the specific condition of the <code>error</code> or <tt>null</tt> if the
* error doesn't have any.
*
*
* @param error the error the get the specific condition from.
* @return the specific condition of this error, or null if it doesn't have
* any.
@ -109,7 +109,7 @@ public abstract class AdHocCommand {
/**
* Set the the human readable name of the command, usually used for
* displaying in a UI.
*
*
* @param name the name.
*/
public void setName(String name) {
@ -118,7 +118,7 @@ public abstract class AdHocCommand {
/**
* Returns the human readable name of the command.
*
*
* @return the human readable name of the command
*/
public String getName() {
@ -128,7 +128,7 @@ public abstract class AdHocCommand {
/**
* Sets the unique identifier of the command. This value must be unique for
* the <code>OwnerJID</code>.
*
*
* @param node the unique identifier of the command.
*/
public void setNode(String node) {
@ -138,7 +138,7 @@ public abstract class AdHocCommand {
/**
* Returns the unique identifier of the command. It is unique for the
* <code>OwnerJID</code>.
*
*
* @return the unique identifier of the command.
*/
public String getNode() {
@ -148,14 +148,14 @@ public abstract class AdHocCommand {
/**
* Returns the full JID of the owner of this command. This JID is the "to" of a
* execution request.
*
*
* @return the owner JID.
*/
public abstract Jid getOwnerJID();
/**
* Returns the notes that the command has at the current stage.
*
*
* @return a list of notes.
*/
public List<AdHocCommandNote> getNotes() {
@ -167,7 +167,7 @@ public abstract class AdHocCommand {
* response to the execution of an action. All the notes added here are
* returned by the {@link #getNotes} method during the current stage.
* Once the stage changes all the notes are discarded.
*
*
* @param note the note.
*/
protected void addNote(AdHocCommandNote note) {
@ -184,7 +184,7 @@ public abstract class AdHocCommand {
* used by the requester to fill all the information that the executor needs
* to continue to the next stage. It can also be the result of the
* execution.
*
*
* @return the form of the current stage to fill out or the result of the
* execution.
*/
@ -201,7 +201,7 @@ public abstract class AdHocCommand {
* Sets the form of the current stage. This should be used when setting a
* response. It could be a form to fill out the information needed to go to
* the next stage or the result of an execution.
*
*
* @param form the form of the current stage to fill out or the result of the
* execution.
*/
@ -216,8 +216,8 @@ public abstract class AdHocCommand {
*
* @throws NoResponseException
* @throws XMPPErrorException if there is an error executing the command.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public abstract void execute() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
@ -227,12 +227,12 @@ public abstract class AdHocCommand {
* previous stage. This method will be only invoked for commands that have one
* or more stages. If there is a problem executing the command it throws an
* XMPPException.
*
*
* @param response the form answer of the previous stage.
* @throws NoResponseException
* @throws XMPPErrorException if there is a problem executing the command.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public abstract void next(Form response) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
@ -242,13 +242,13 @@ public abstract class AdHocCommand {
* previous stage. This method will be only invoked for commands that have one
* or more stages. If there is a problem executing the command it throws an
* XMPPException.
*
*
* @param response the form answer of the previous stage.
*
* @throws NoResponseException
* @throws XMPPErrorException if there is a problem executing the command.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public abstract void complete(Form response) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
@ -260,8 +260,8 @@ public abstract class AdHocCommand {
*
* @throws NoResponseException
* @throws XMPPErrorException if there is a problem executing the command.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public abstract void prev() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
@ -272,8 +272,8 @@ public abstract class AdHocCommand {
*
* @throws NoResponseException
* @throws XMPPErrorException if there is a problem executing the command.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public abstract void cancel() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException;
@ -282,7 +282,7 @@ public abstract class AdHocCommand {
* Possible actions are: {@link Action#prev prev}, {@link Action#next next} and
* {@link Action#complete complete}. This method will be only invoked for commands that
* have one or more stages.
*
*
* @return a collection with the allowed actions based on the current stage
* as defined in the SessionData.
*/
@ -293,7 +293,7 @@ public abstract class AdHocCommand {
/**
* Add an action to the current stage available actions. This should be used
* when creating a response.
*
*
* @param action the action.
*/
protected void addActionAvailable(Action action) {
@ -306,7 +306,7 @@ public abstract class AdHocCommand {
* reply, if no action was defined in the command then the action will be
* assumed "execute" thus assuming the action returned by this method. This
* method will never be invoked for commands that have no stages.
*
*
* @return the action available for the current stage which is considered
* the equivalent to "execute".
*/
@ -320,7 +320,7 @@ public abstract class AdHocCommand {
* a response. When the requester sends his reply, if no action was defined
* in the command then the action will be assumed "execute" thus assuming
* the action returned by this method.
*
*
* @param action the action.
*/
protected void setExecuteAction(Action action) {
@ -329,7 +329,7 @@ public abstract class AdHocCommand {
/**
* Returns the status of the current stage.
*
*
* @return the current status.
*/
public Status getStatus() {
@ -338,7 +338,7 @@ public abstract class AdHocCommand {
/**
* Check if this command has been completed successfully.
*
*
* @return <code>true</code> if this command is completed.
* @since 4.2
*/
@ -348,7 +348,7 @@ public abstract class AdHocCommand {
/**
* Sets the data of the current stage. This should not used.
*
*
* @param data the data.
*/
void setData(AdHocCommandData data) {
@ -368,7 +368,7 @@ public abstract class AdHocCommand {
* Returns true if the <code>action</code> is available in the current stage.
* The {@link Action#cancel cancel} action is always allowed. To define the
* available actions use the <code>addActionAvailable</code> method.
*
*
* @param action
* The action to check if it is available.
* @return True if the action is available for the current stage.

View file

@ -59,8 +59,8 @@ import org.jxmpp.jid.Jid;
*
* Pass in an XMPPConnection instance to
* {@link #getAddHocCommandsManager(XMPPConnection)} in order to
* get an instance of this class.
*
* get an instance of this class.
*
* @author Gabriel Guardincerri
*/
public final class AdHocCommandManager extends Manager {
@ -258,7 +258,7 @@ public final class AdHocCommandManager extends Manager {
* @return the discovered items.
* @throws XMPPException if the operation failed for some reason.
* @throws SmackException if there was no response from the server.
* @throws InterruptedException
* @throws InterruptedException
*/
public DiscoverItems discoverCommands(Jid jid) throws XMPPException, SmackException, InterruptedException {
return serviceDiscoveryManager.discoverItems(jid, NAMESPACE);
@ -270,7 +270,7 @@ public final class AdHocCommandManager extends Manager {
* @param jid the full JID to publish the commands to.
* @throws XMPPException if the operation failed for some reason.
* @throws SmackException if there was no response from the server.
* @throws InterruptedException
* @throws InterruptedException
* @deprecated This method uses no longer existent XEP-0030 features and will be removed.
*/
@SuppressWarnings("deprecation")
@ -315,7 +315,7 @@ public final class AdHocCommandManager extends Manager {
* <li>The command has more than one stage, if so, it saves the command and
* session ID for further use</li>
* </ul>
*
*
* <br>
* <br>
* If this is not the first request, this method checks, before executing
@ -330,7 +330,7 @@ public final class AdHocCommandManager extends Manager {
* the stanza to process.
* @throws NotConnectedException
* @throws NoResponseException
* @throws InterruptedException
* @throws InterruptedException
*/
private IQ processAdHocCommand(AdHocCommandData requestData) throws NoResponseException, NotConnectedException, InterruptedException {
// Creates the response with the corresponding data
@ -587,10 +587,10 @@ public final class AdHocCommandManager extends Manager {
/**
* Responds an error with an specific condition.
*
*
* @param response the response to send.
* @param condition the condition of the error.
* @throws NotConnectedException
* @throws NotConnectedException
*/
private static IQ respondError(AdHocCommandData response,
StanzaError.Condition condition) {
@ -599,11 +599,11 @@ public final class AdHocCommandManager extends Manager {
/**
* Responds an error with an specific condition.
*
*
* @param response the response to send.
* @param condition the condition of the error.
* @param specificCondition the adhoc command error condition.
* @throws NotConnectedException
* @throws NotConnectedException
*/
private static IQ respondError(AdHocCommandData response, StanzaError.Condition condition,
AdHocCommand.SpecificErrorCondition specificCondition) {
@ -613,10 +613,10 @@ public final class AdHocCommandManager extends Manager {
/**
* Responds an error with an specific error.
*
*
* @param response the response to send.
* @param error the error to send.
* @throws NotConnectedException
* @throws NotConnectedException
*/
private static IQ respondError(AdHocCommandData response, StanzaError.Builder error) {
response.setType(IQ.Type.error);
@ -626,17 +626,17 @@ public final class AdHocCommandManager extends Manager {
/**
* Creates a new instance of a command to be used by a new execution request
*
*
* @param commandNode the command node that identifies it.
* @param sessionID the session id of this execution.
* @return the command instance to execute.
* @throws XMPPErrorException if there is problem creating the new instance.
* @throws SecurityException
* @throws NoSuchMethodException
* @throws InvocationTargetException
* @throws IllegalArgumentException
* @throws IllegalAccessException
* @throws InstantiationException
* @throws SecurityException
* @throws NoSuchMethodException
* @throws InvocationTargetException
* @throws IllegalArgumentException
* @throws IllegalAccessException
* @throws InstantiationException
*/
private LocalCommand newInstanceOfCmd(String commandNode, String sessionID)
throws XMPPErrorException, InstantiationException, IllegalAccessException, IllegalArgumentException,
@ -653,7 +653,7 @@ public final class AdHocCommandManager extends Manager {
/**
* Returns the registered commands of this command manager, which is related
* to a connection.
*
*
* @return the registered commands.
*/
private Collection<AdHocCommandInfo> getRegisteredCommands() {

View file

@ -19,7 +19,7 @@ package org.jivesoftware.smackx.commands;
/**
* Notes can be added to a command execution response. A note has a type and value.
*
*
* @author Gabriel Guardincerri
*/
public class AdHocCommandNote {
@ -40,7 +40,7 @@ public class AdHocCommandNote {
/**
* Returns the value or message of the note.
*
*
* @return the value or message of the note.
*/
public String getValue() {
@ -49,7 +49,7 @@ public class AdHocCommandNote {
/**
* Return the type of the note.
*
*
* @return the type of the note.
*/
public Type getType() {

View file

@ -36,7 +36,7 @@ import org.jxmpp.jid.Jid;
* methods. When implementing the actions remember that they could be invoked
* several times, and that you must use the current stage number to know what to
* do.
*
*
* @author Gabriel Guardincerri
*/
public abstract class LocalCommand extends AdHocCommand {
@ -70,7 +70,7 @@ public abstract class LocalCommand extends AdHocCommand {
/**
* The sessionID is an unique identifier of an execution request. This is
* automatically handled and should not be called.
*
*
* @param sessionID the unique session id of this execution
*/
public void setSessionID(String sessionID) {
@ -80,7 +80,7 @@ public abstract class LocalCommand extends AdHocCommand {
/**
* Returns the session ID of this execution.
*
*
* @return the unique session id of this execution
*/
public String getSessionID() {
@ -90,7 +90,7 @@ public abstract class LocalCommand extends AdHocCommand {
/**
* Sets the JID of the command host. This is automatically handled and should
* not be called.
*
*
* @param ownerJID the JID of the owner.
*/
public void setOwnerJID(Jid ownerJID) {
@ -104,7 +104,7 @@ public abstract class LocalCommand extends AdHocCommand {
/**
* Returns the date the command was created.
*
*
* @return the date the command was created.
*/
public long getCreationDate() {
@ -115,7 +115,7 @@ public abstract class LocalCommand extends AdHocCommand {
* Returns true if the current stage is the last one. If it is then the
* execution of some action will complete the execution of the command.
* Commands that don't have multiple stages can always return <tt>true</tt>.
*
*
* @return true if the command is in the last stage.
*/
public abstract boolean isLastStage();
@ -151,7 +151,7 @@ public abstract class LocalCommand extends AdHocCommand {
/**
* Increase the current stage number. This is automatically handled and should
* not be called.
*
*
*/
void incrementStage() {
currentStage++;
@ -160,7 +160,7 @@ public abstract class LocalCommand extends AdHocCommand {
/**
* Decrease the current stage number. This is automatically handled and should
* not be called.
*
*
*/
void decrementStage() {
currentStage--;

View file

@ -24,7 +24,7 @@ import java.lang.reflect.InvocationTargetException;
* when arguments must be passed into the constructor or when using a dependency injection
* framework. When a LocalCommandFactory isn't used, you can provide the AdHocCommandManager
* a Class object instead. For more details, see
* {@link AdHocCommandManager#registerCommand(String, String, LocalCommandFactory)}.
* {@link AdHocCommandManager#registerCommand(String, String, LocalCommandFactory)}.
*
* @author Matt Tucker
*/
@ -36,10 +36,10 @@ public interface LocalCommandFactory {
* @return a LocalCommand instance.
* @throws InstantiationException if creating an instance failed.
* @throws IllegalAccessException if creating an instance is not allowed.
* @throws SecurityException
* @throws NoSuchMethodException
* @throws InvocationTargetException
* @throws IllegalArgumentException
* @throws SecurityException
* @throws NoSuchMethodException
* @throws InvocationTargetException
* @throws IllegalArgumentException
*/
LocalCommand getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException;

View file

@ -97,8 +97,8 @@ public class RemoteCommand extends AdHocCommand {
* @param form the form answer of the previous stage.
* @throws XMPPErrorException if an error occurs.
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void execute(Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
executeAction(Action.execute, form);
@ -127,8 +127,8 @@ public class RemoteCommand extends AdHocCommand {
* @param form the form with the information.
* @throws XMPPErrorException if there is a problem executing the command.
* @throws NoResponseException if there was no response from the server.
* @throws NotConnectedException
* @throws InterruptedException
* @throws NotConnectedException
* @throws InterruptedException
*/
private void executeAction(Action action, Form form) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
// TODO: Check that all the required fields of the form were filled, if

View file

@ -33,7 +33,7 @@ import org.jxmpp.jid.Jid;
/**
* Represents the state and the request of the execution of an adhoc command.
*
*
* @author Gabriel Guardincerri
*/
public class AdHocCommandData extends IQ {

View file

@ -32,7 +32,7 @@ import org.xmlpull.v1.XmlPullParser;
/**
* The AdHocCommandDataProvider parses AdHocCommandData packets.
*
*
* @author Gabriel Guardincerri
*/
public class AdHocCommandDataProvider extends IQProvider<AdHocCommandData> {