// we need to switch on the type field to figure out the concrete class to instantiate
JsonObject object = element.getAsJsonObject();
if(!object.has("type")) {
throw new JsonParseException("DefectEvent does not have type information");
}
EventType eType = context.deserialize(object.get("type"), EventType.class);
if(eType != null) { // type could be any garbage string, eType null if not in enum
switch(eType) {
case CHANGESET:
return context.deserialize(element, DefectChangeset.class);
case COMMENT: