Source:
public DatasetField parseField(JsonObject json, Boolean testType) throws JsonParseException { if (json == null) { return null; } DatasetField ret = new DatasetField(); DatasetFieldType type = datasetFieldSvc.findByNameOpt(json.getString("typeName", "")); if (type == null) { logger.info("Can't find type '" + json.getString("typeName", "") + "'"); return null; } if (testType && type.isAllowMultiples() != json.getBoolean("multiple")) { throw new JsonParseException("incorrect multiple for field " + json.getString("typeName", "")); } if (testType && type.isCompound() && !json.getString("typeClass").equals("compound")) { throw new JsonParseException("incorrect typeClass for field " + json.getString("typeName", "") + ", should be compound."); } if (testType && !type.isControlledVocabulary() && type.isPrimitive() && !json.getString("typeClass").equals("primitive")) { throw new JsonParseException("incorrect typeClass for field: " + json.getString("typeName", "") + ", should be primitive"); } if (testType && type.isControlledVocabulary() && !json.getString("typeClass").equals("controlledVocabulary")) { throw new JsonParseException("incorrect typeClass for field " + json.getString("typeName", "") + ", should be controlledVocabulary"); } ret.setDatasetFieldType(type); if (type.isCompound()) { List<DatasetFieldCompoundValue> vals = parseCompoundValue(type, json, testType); for (DatasetFieldCompoundValue dsfcv : vals) { dsfcv.setParentDatasetField(ret); } ret.setDatasetFieldCompoundValues(vals); } else if (type.isControlledVocabulary()) { List<ControlledVocabularyValue> vals = parseControlledVocabularyValue(type, json); for (ControlledVocabularyValue cvv : vals) { cvv.setDatasetFieldType(type); } ret.setControlledVocabularyValues(vals); } else { List<DatasetFieldValue> values = parsePrimitiveValue(type, json); for (DatasetFieldValue val : values) { val.setDatasetField(ret); } ret.setDatasetFieldValues(values); } return ret; }

Target:
public DatasetField parseField(JsonObject json, Boolean testType) throws JsonParseException { if (json == null) { return null; } DatasetField ret = new DatasetField(); DatasetFieldType type = datasetFieldSvc.findByNameOpt(json.getString("typeName", "")); if (type == null) { logger.fine("Can't find type '" + json.getString("typeName", "") + "'"); return null; } if (testType && type.isAllowMultiples() != json.getBoolean("multiple")) { throw new JsonParseException("incorrect multiple for field " + json.getString("typeName", "")); } if (testType && type.isCompound() && !json.getString("typeClass").equals("compound")) { throw new JsonParseException("incorrect typeClass for field " + json.getString("typeName", "") + ", should be compound."); } if (testType && !type.isControlledVocabulary() && type.isPrimitive() && !json.getString("typeClass").equals("primitive")) { throw new JsonParseException("incorrect typeClass for field: " + json.getString("typeName", "") + ", should be primitive"); } if (testType && type.isControlledVocabulary() && !json.getString("typeClass").equals("controlledVocabulary")) { throw new JsonParseException("incorrect typeClass for field " + json.getString("typeName", "") + ", should be controlledVocabulary"); } ret.setDatasetFieldType(type); if (type.isCompound()) { List<DatasetFieldCompoundValue> vals = parseCompoundValue(type, json, testType); for (DatasetFieldCompoundValue dsfcv : vals) { dsfcv.setParentDatasetField(ret); } ret.setDatasetFieldCompoundValues(vals); } else if (type.isControlledVocabulary()) { List<ControlledVocabularyValue> vals = parseControlledVocabularyValue(type, json); for (ControlledVocabularyValue cvv : vals) { cvv.setDatasetFieldType(type); } ret.setControlledVocabularyValues(vals); } else { List<DatasetFieldValue> values = parsePrimitiveValue(type, json); for (DatasetFieldValue val : values) { val.setDatasetField(ret); } ret.setDatasetFieldValues(values); } return ret; }