1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-16 18:11:08 +01:00

Fix minor codestyle issues

This commit is contained in:
Paul Schaub 2017-12-13 23:10:11 +01:00 committed by Florian Schmaus
parent 431e5b3c67
commit 2f2c2f8663
16 changed files with 92 additions and 99 deletions

View file

@ -77,7 +77,7 @@ public final class AdHocCommandManager extends Manager {
* Map an XMPPConnection with it AdHocCommandManager. This map have a key-value
* pair for every active connection.
*/
private static Map<XMPPConnection, AdHocCommandManager> instances = new WeakHashMap<>();
private static final Map<XMPPConnection, AdHocCommandManager> instances = new WeakHashMap<>();
/**
* Register the listener for all the connection creations. When a new
@ -114,7 +114,7 @@ public final class AdHocCommandManager extends Manager {
* Value=command. Command node matches the node attribute sent by command
* requesters.
*/
private final Map<String, AdHocCommandInfo> commands = new ConcurrentHashMap<String, AdHocCommandInfo>();
private final Map<String, AdHocCommandInfo> commands = new ConcurrentHashMap<>();
/**
* Map a command session ID with the instance LocalCommand. The LocalCommand
@ -122,7 +122,7 @@ public final class AdHocCommandManager extends Manager {
* the command execution. Note: Key=session ID, Value=LocalCommand. Session
* ID matches the sessionid attribute sent by command responders.
*/
private final Map<String, LocalCommand> executingCommands = new ConcurrentHashMap<String, LocalCommand>();
private final Map<String, LocalCommand> executingCommands = new ConcurrentHashMap<>();
private final ServiceDiscoveryManager serviceDiscoveryManager;
@ -155,7 +155,7 @@ public final class AdHocCommandManager extends Manager {
@Override
public List<DiscoverItems.Item> getNodeItems() {
List<DiscoverItems.Item> answer = new ArrayList<DiscoverItems.Item>();
List<DiscoverItems.Item> answer = new ArrayList<>();
Collection<AdHocCommandInfo> commandsList = getRegisteredCommands();
for (AdHocCommandInfo info : commandsList) {
@ -181,7 +181,7 @@ public final class AdHocCommandManager extends Manager {
return processAdHocCommand(requestData);
}
catch (InterruptedException | NoResponseException | NotConnectedException e) {
LOGGER.log(Level.INFO, "processAdHocCommand threw exceptino", e);
LOGGER.log(Level.INFO, "processAdHocCommand threw exception", e);
return null;
}
}
@ -215,7 +215,7 @@ public final class AdHocCommandManager extends Manager {
* Registers a new command with this command manager, which is related to a
* connection. The <tt>node</tt> is an unique identifier of that
* command for the connection related to this command manager. The <tt>name</tt>
* is the human readeale name of the command. The <tt>factory</tt> generates
* is the human readable name of the command. The <tt>factory</tt> generates
* new instances of the command.
*
* @param node the unique identifier of the command.
@ -232,7 +232,7 @@ public final class AdHocCommandManager extends Manager {
new AbstractNodeInformationProvider() {
@Override
public List<String> getNodeFeatures() {
List<String> answer = new ArrayList<String>();
List<String> answer = new ArrayList<>();
answer.add(NAMESPACE);
// TODO: check if this service is provided by the
// TODO: current connection.
@ -241,7 +241,7 @@ public final class AdHocCommandManager extends Manager {
}
@Override
public List<DiscoverInfo.Identity> getNodeIdentities() {
List<DiscoverInfo.Identity> answer = new ArrayList<DiscoverInfo.Identity>();
List<DiscoverInfo.Identity> answer = new ArrayList<>();
DiscoverInfo.Identity identity = new DiscoverInfo.Identity(
"automation", name, "command-node");
answer.add(identity);
@ -353,7 +353,7 @@ public final class AdHocCommandManager extends Manager {
try {
// Create a new instance of the command with the
// corresponding sessioid
// corresponding sessionid
LocalCommand command;
try {
command = newInstanceOfCmd(commandNode, sessionId);
@ -425,7 +425,7 @@ public final class AdHocCommandManager extends Manager {
// the requester know why his execution request is
// not accepted. If the session is removed just
// after the time out, then whe the user request to
// continue the execution he will recieved an
// continue the execution he will received an
// invalid session error and not a time out error.
if (System.currentTimeMillis() - creationStamp > SESSION_TIMEOUT * 1000 * 2) {
// Remove the expired session

View file

@ -41,6 +41,6 @@ public interface LocalCommandFactory {
* @throws InvocationTargetException
* @throws IllegalArgumentException
*/
public LocalCommand getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException;
LocalCommand getInstance() throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException;
}