diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java
index 15c941ba7d..32c1af4566 100644
--- a/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java
+++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/caps/EntityCapsManager.java
@@ -70,7 +70,6 @@
import org.jivesoftware.smackx.disco.packet.DiscoverInfoBuilder;
import org.jivesoftware.smackx.disco.packet.DiscoverInfoView;
import org.jivesoftware.smackx.xdata.FormField;
-import org.jivesoftware.smackx.xdata.TextSingleFormField;
import org.jivesoftware.smackx.xdata.packet.DataForm;
import org.jxmpp.jid.DomainBareJid;
@@ -683,12 +682,12 @@ protected static CapsVersionAndHash generateVerificationString(DiscoverInfoView
// by the XML character data of the element).
Collections.sort(extendedInfos, new Comparator() {
@Override
- public int compare(DataForm d1, DataForm d2) {
- final TextSingleFormField hft1 = d1.getHiddenFormTypeField();
- assert hft1 != null; // ensured by the previous step.
- final TextSingleFormField hft2 = d2.getHiddenFormTypeField();
- assert hft2 != null; // ensured by the previous step.
- return hft1.getFirstValue().compareTo(hft2.getFirstValue());
+ public int compare(DataForm dataFormLeft, DataForm dataFormRight) {
+ final String formTypeLeft = dataFormLeft.getFormType();
+ assert formTypeLeft != null; // ensured by the previous step.
+ final String formTypeRight = dataFormRight.getFormType();
+ assert formTypeRight != null; // ensured by the previous step.
+ return formTypeLeft.compareTo(formTypeRight);
}
});