mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-25 21:42:07 +01:00
[caps] Use DataForm.getFormType() when sorting
This commit is contained in:
parent
a1e85d644f
commit
ba02a868f6
1 changed files with 6 additions and 7 deletions
|
@ -70,7 +70,6 @@ import org.jivesoftware.smackx.disco.packet.DiscoverInfo.Identity;
|
||||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder;
|
import org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder;
|
||||||
import org.jivesoftware.smackx.disco.packet.DiscoverInfoView;
|
import org.jivesoftware.smackx.disco.packet.DiscoverInfoView;
|
||||||
import org.jivesoftware.smackx.xdata.FormField;
|
import org.jivesoftware.smackx.xdata.FormField;
|
||||||
import org.jivesoftware.smackx.xdata.TextSingleFormField;
|
|
||||||
import org.jivesoftware.smackx.xdata.packet.DataForm;
|
import org.jivesoftware.smackx.xdata.packet.DataForm;
|
||||||
|
|
||||||
import org.jxmpp.jid.DomainBareJid;
|
import org.jxmpp.jid.DomainBareJid;
|
||||||
|
@ -683,12 +682,12 @@ public final class EntityCapsManager extends Manager {
|
||||||
// by the XML character data of the <value/> element).
|
// by the XML character data of the <value/> element).
|
||||||
Collections.sort(extendedInfos, new Comparator<DataForm>() {
|
Collections.sort(extendedInfos, new Comparator<DataForm>() {
|
||||||
@Override
|
@Override
|
||||||
public int compare(DataForm d1, DataForm d2) {
|
public int compare(DataForm dataFormLeft, DataForm dataFormRight) {
|
||||||
final TextSingleFormField hft1 = d1.getHiddenFormTypeField();
|
final String formTypeLeft = dataFormLeft.getFormType();
|
||||||
assert hft1 != null; // ensured by the previous step.
|
assert formTypeLeft != null; // ensured by the previous step.
|
||||||
final TextSingleFormField hft2 = d2.getHiddenFormTypeField();
|
final String formTypeRight = dataFormRight.getFormType();
|
||||||
assert hft2 != null; // ensured by the previous step.
|
assert formTypeRight != null; // ensured by the previous step.
|
||||||
return hft1.getFirstValue().compareTo(hft2.getFirstValue());
|
return formTypeLeft.compareTo(formTypeRight);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue