{
JSONObject jso = (JSONObject)o;
String java_class = getJavaClass(jso);
if(java_class == null)
throw new UnmarshallException("no type hint");
AbstractSet abset = null;
if(java_class.equals("java.util.Set") ||
java_class.equals("java.util.AbstractSet") ||
java_class.equals("java.util.HashSet")) {
abset = new HashSet();
} else if(java_class.equals("java.util.TreeSet")) {
abset = new TreeSet();
} else if(java_class.equals("java.util.LinkedHashSet")) {
abset = new LinkedHashSet();
} else {
throw new UnmarshallException("not a Set");
}
JSONObject jsonset = getSet(jso);
if(jsonset == null)
throw new UnmarshallException("set missing");
Iterator i = jsonset.keys();
String key = null;
try {
while(i.hasNext()) {
key = (String)i.next();
Object setElement = jsonset.get(key);
abset.add(ser.unmarshall(state, null, setElement));
}
} catch (JSONException e) {
throw new UnmarshallException("key " + i + e.getMessage());
} catch (UnmarshallException e) {
throw new UnmarshallException("key " + i + e.getMessage());