throw new UnmarshallException("Could not read javaClass", e);
}
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;
try {
jsonset = jso.getJSONObject("set");
} catch (JSONException e) {
throw new UnmarshallException("set missing", e);
}
if (jsonset == null) {
throw new UnmarshallException("set missing");
}
Iterator i = jsonset.keys();
String key = null;
state.setSerialized(o, abset);
try {
while (i.hasNext()) {
key = (String) i.next();
Object setElement = jsonset.get(key);
abset.add(_ser.unmarshall(state, null, setElement));
}
} catch (UnmarshallException e) {
throw new UnmarshallException("key " + i + e.getMessage(), e);
} catch (JSONException e) {
throw new UnmarshallException("key " + key + " " + e.getMessage(), e);