1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-12-12 22:11:07 +01:00

Return more specific types (e.g. Collection → List)

be generic as possible in what you accept, but more specific in what you
return.

Also tweak MultiuserChatManager methods a bit.
This commit is contained in:
Florian Schmaus 2014-11-29 13:36:56 +01:00
parent 9286a1decb
commit 252d5172e9
12 changed files with 52 additions and 60 deletions

View file

@ -16,9 +16,8 @@
*/
package org.jivesoftware.smackx.amp.packet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.jivesoftware.smack.packet.PacketExtension;
@ -82,12 +81,12 @@ public class AMPExtension implements PacketExtension {
}
/**
* Returns a Collection of the rules in the packet.
* Returns a unmodifiable List of the rules in the packet.
*
* @return a Collection of the rules in the packet.
* @return a unmodifiable List of the rules in the packet.
*/
public Collection<Rule> getRules() {
return Collections.unmodifiableList(new ArrayList<Rule>(rules));
public List<Rule> getRules() {
return Collections.unmodifiableList(rules);
}
/**