1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 22:32:06 +01:00

Use LinkedHashMap for PacketExtensions in Packet

to keep the order in which the elements are added.

Some XEPs define a Schema using 'xs:sequence' (see for example XEP-60 §
17.1), so the order the PacketExtensions are added should be the same
they are transformed to a XML String.
This commit is contained in:
Florian Schmaus 2014-11-05 17:58:32 +01:00
parent b9167c5fe2
commit 10643cce7c

View file

@ -25,7 +25,7 @@ import org.jxmpp.util.XmppStringUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
@ -62,7 +62,7 @@ public abstract class Packet extends TopLevelStreamElement {
*/ */
private static final AtomicLong id = new AtomicLong(); private static final AtomicLong id = new AtomicLong();
private final Map<String, PacketExtension> packetExtensions = new HashMap<String, PacketExtension>(12); private final Map<String, PacketExtension> packetExtensions = new LinkedHashMap<String, PacketExtension>(12);
private String packetID = null; private String packetID = null;
private String to = null; private String to = null;