Commit 8cde607b authored by Christian Schudt's avatar Christian Schudt

Replace Arrays.asList() (with 1 arg) with Collections.singletonList().

(for performance reasons)
parent cce0b3d0
......@@ -119,7 +119,7 @@ public class GetListActiveUsers extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -29,8 +29,8 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
......@@ -119,7 +119,7 @@ public class GetUsersPresence extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -28,7 +28,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
......@@ -124,7 +124,7 @@ public class PacketsNotification extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -19,10 +19,6 @@
package org.jivesoftware.openfire.commands.admin.group;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.dom4j.Element;
import org.jivesoftware.openfire.commands.AdHocCommand;
import org.jivesoftware.openfire.commands.SessionData;
......@@ -35,6 +31,10 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Command that allows to create and configure new goups.
*
......@@ -188,7 +188,7 @@ public class AddGroup extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -19,10 +19,6 @@
package org.jivesoftware.openfire.commands.admin.group;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import org.dom4j.Element;
import org.jivesoftware.openfire.commands.AdHocCommand;
import org.jivesoftware.openfire.commands.SessionData;
......@@ -35,6 +31,10 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
/**
* Command that allows to add members or admins to a given group.
*
......@@ -130,7 +130,7 @@ public class AddGroupUsers extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -28,7 +28,7 @@ import org.jivesoftware.openfire.group.GroupNotFoundException;
import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
......@@ -98,7 +98,7 @@ public class DeleteGroup extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -19,9 +19,6 @@
package org.jivesoftware.openfire.commands.admin.group;
import java.util.Arrays;
import java.util.List;
import org.dom4j.Element;
import org.jivesoftware.openfire.commands.AdHocCommand;
import org.jivesoftware.openfire.commands.SessionData;
......@@ -34,6 +31,9 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Collections;
import java.util.List;
/**
* Command that allows to delete members or admins from a given group.
*
......@@ -119,7 +119,7 @@ public class DeleteGroupUsers extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -29,7 +29,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -110,7 +110,7 @@ public class GetListGroupUsers extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -28,7 +28,7 @@ import org.jivesoftware.openfire.roster.RosterManager;
import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -155,7 +155,7 @@ public class GetListGroups extends AdHocCommand {
@Override
protected List<AdHocCommand.Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -28,7 +28,12 @@ import org.jivesoftware.openfire.group.GroupNotFoundException;
import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.StringTokenizer;
/**
* Command that allows to update a given group.
......@@ -213,12 +218,12 @@ public class UpdateGroup extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
if (data.getStage() == 0) {
return Arrays.asList(AdHocCommand.Action.next);
return Collections.singletonList(Action.next);
}
else if (data.getStage() == 1) {
return Arrays.asList(AdHocCommand.Action.next, AdHocCommand.Action.prev, AdHocCommand.Action.complete);
}
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -30,8 +30,8 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -167,7 +167,7 @@ public class CreateMUCRoom extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -168,7 +168,7 @@ public class AddUser extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -22,9 +22,9 @@ package org.jivesoftware.openfire.commands.admin.user;
import org.dom4j.Element;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.auth.AuthFactory;
import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.auth.ConnectionException;
import org.jivesoftware.openfire.auth.InternalUnauthenticatedException;
import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.commands.AdHocCommand;
import org.jivesoftware.openfire.commands.SessionData;
import org.jivesoftware.openfire.component.InternalComponentManager;
......@@ -35,7 +35,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
......@@ -142,7 +142,7 @@ public class AuthenticateUser extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -30,7 +30,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
......@@ -118,7 +118,7 @@ public class ChangeUserPassword extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -19,10 +19,6 @@
*/
package org.jivesoftware.openfire.commands.admin.user;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import org.dom4j.Element;
import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.commands.AdHocCommand;
......@@ -35,6 +31,10 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* Delete a user from Openfire if the provider is not read-only. See
* <a href="http://www.xmpp.org/extensions/xep-0133.html#delete-user">Service Administration:
......@@ -122,7 +122,7 @@ public class DeleteUser extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -19,17 +19,17 @@
*/
package org.jivesoftware.openfire.commands.admin.user;
import org.dom4j.Element;
import org.jivesoftware.openfire.commands.AdHocCommand;
import org.jivesoftware.openfire.commands.SessionData;
import org.jivesoftware.openfire.user.UserManager;
import org.jivesoftware.openfire.user.User;
import org.dom4j.Element;
import org.jivesoftware.openfire.user.UserManager;
import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Collections;
import java.util.List;
import java.util.Arrays;
/**
* An adhoc command to retrieve the properties of the user.
......@@ -120,7 +120,7 @@ public class UserProperties extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(AdHocCommand.Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -28,7 +28,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -122,7 +122,7 @@ public class ChangeSharedSecret extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -16,18 +16,18 @@
package org.jivesoftware.openfire.commands.clearspace;
import org.dom4j.Element;
import org.jivesoftware.openfire.admin.AdminManager;
import org.jivesoftware.openfire.commands.AdHocCommand;
import org.jivesoftware.openfire.commands.SessionData;
import org.jivesoftware.openfire.admin.AdminManager;
import org.jivesoftware.openfire.component.InternalComponentManager;
import org.dom4j.Element;
import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Arrays;
/**
* Notifies that a new system administrator has been added.
......@@ -98,7 +98,7 @@ public class SystemAdminAdded extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -16,18 +16,18 @@
package org.jivesoftware.openfire.commands.clearspace;
import org.dom4j.Element;
import org.jivesoftware.openfire.admin.AdminManager;
import org.jivesoftware.openfire.commands.AdHocCommand;
import org.jivesoftware.openfire.commands.SessionData;
import org.jivesoftware.openfire.admin.AdminManager;
import org.jivesoftware.openfire.component.InternalComponentManager;
import org.dom4j.Element;
import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Arrays;
/**
* Notifies that a user has had its system administrator status revoked.
......@@ -98,7 +98,7 @@ public class SystemAdminRemoved extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -140,7 +140,7 @@ public class GroupAdminAdded extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -32,6 +32,7 @@ import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -140,7 +141,7 @@ public class GroupAdminRemoved extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,6 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -117,7 +116,7 @@ public class GroupCreated extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,6 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -117,7 +116,7 @@ public class GroupDeleting extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -140,7 +140,7 @@ public class GroupMemberAdded extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -140,7 +140,7 @@ public class GroupMemberRemoved extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -188,7 +188,7 @@ public class GroupModified extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,6 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -118,7 +117,7 @@ public class UserCreated extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,6 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -115,7 +114,7 @@ public class UserDeleting extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -31,7 +31,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -194,7 +194,7 @@ public class UserModified extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -29,7 +29,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -112,7 +112,7 @@ public class VCardCreated extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -29,7 +29,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -112,7 +112,7 @@ public class VCardDeleting extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -29,7 +29,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
......@@ -112,7 +112,7 @@ public class VCardModified extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -20,13 +20,6 @@
package org.jivesoftware.openfire.handler;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.jivesoftware.openfire.IQHandlerInfo;
......@@ -52,6 +45,13 @@ import org.xmpp.packet.IQ;
import org.xmpp.packet.JID;
import org.xmpp.packet.PacketError;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
/**
* Implements JEP-0013: Flexible Offline Message Retrieval. Allows users to request number of
* messages, request message headers, retrieve specific messages, remove specific messages,
......@@ -156,7 +156,7 @@ public class IQOfflineMessagesHandler extends IQHandler implements ServerFeature
}
public Iterator<String> getFeatures(String name, String node, JID senderJID) {
return Arrays.asList(NAMESPACE).iterator();
return Collections.singletonList(NAMESPACE).iterator();
}
public DataForm getExtendedInfo(String name, String node, JID senderJID) {
......
......@@ -27,7 +27,7 @@ import org.xmpp.forms.DataForm;
import org.xmpp.forms.FormField;
import org.xmpp.packet.JID;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
......@@ -120,7 +120,7 @@ public class PendingSubscriptionsCommand extends AdHocCommand {
@Override
protected List<Action> getActions(SessionData data) {
return Arrays.asList(Action.complete);
return Collections.singletonList(Action.complete);
}
@Override
......
......@@ -20,17 +20,6 @@
package org.jivesoftware.openfire.pubsub;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.dom4j.QName;
......@@ -53,9 +42,18 @@ import org.xmpp.packet.IQ;
import org.xmpp.packet.JID;
import org.xmpp.packet.Message;
import org.xmpp.packet.PacketError;
import org.xmpp.packet.PacketError.Condition;
import org.xmpp.packet.Presence;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/**
* A PubSubEngine is responsible for handling packets sent to a pub-sub service.
*
......@@ -1841,7 +1839,7 @@ public class PubSubEngine {
return Collections.emptyList();
}
// User is connected at specified resource so answer list with presence show value
return Arrays.asList(show);
return Collections.singletonList(show);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment