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

Added check for missing field type for multi list in data forms.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13430 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2013-02-04 03:53:53 +00:00
parent 457959bc88
commit f0cd048635

View file

@ -20,15 +20,15 @@
package org.jivesoftware.smackx; package org.jivesoftware.smackx;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.packet.DataForm;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.StringTokenizer; import java.util.StringTokenizer;
import org.jivesoftware.smack.packet.Packet;
import org.jivesoftware.smack.packet.PacketExtension;
import org.jivesoftware.smackx.packet.DataForm;
/** /**
* Represents a Form for gathering data. The form could be of the following types: * Represents a Form for gathering data. The form could be of the following types:
* <ul> * <ul>
@ -308,6 +308,7 @@ public class Form {
if (!FormField.TYPE_JID_MULTI.equals(field.getType()) if (!FormField.TYPE_JID_MULTI.equals(field.getType())
&& !FormField.TYPE_LIST_MULTI.equals(field.getType()) && !FormField.TYPE_LIST_MULTI.equals(field.getType())
&& !FormField.TYPE_LIST_SINGLE.equals(field.getType()) && !FormField.TYPE_LIST_SINGLE.equals(field.getType())
&& !FormField.TYPE_TEXT_MULTI.equals(field.getType())
&& !FormField.TYPE_HIDDEN.equals(field.getType())) { && !FormField.TYPE_HIDDEN.equals(field.getType())) {
throw new IllegalArgumentException("This field only accept list of values."); throw new IllegalArgumentException("This field only accept list of values.");
} }