Source:
protected U convertAttributesToProfile(final List<Map<String, Object>> listStorageAttributes, final String username) { if (listStorageAttributes == null || listStorageAttributes.size() == 0) { return null; } final Map<String, Object> storageAttributes = listStorageAttributes.get(0); final String linkedId = (String) storageAttributes.get(LINKEDID); if (isLegacyMode()) { final U profile = getProfileDefinition().newProfile(); for (final String attributeName : attributeNames) { getProfileDefinition().convertAndAdd(profile, PROFILE_ATTRIBUTE, attributeName, storageAttributes.get(attributeName)); } final Object retrievedUsername = storageAttributes.get(getUsernameAttribute()); if (retrievedUsername != null) { profile.addAttribute(USERNAME, retrievedUsername); } else { profile.addAttribute(USERNAME, username); } final Object retrievedId = storageAttributes.get(getIdAttribute()); if (retrievedId != null) { profile.setId(ProfileHelper.sanitizeIdentifier(profile, retrievedId)); } else { throw new TechnicalException("Could not retrieve id"); } if (isNotBlank(linkedId)) { profile.setLinkedId(linkedId); } return profile; } else { final String serializedProfile = (String) storageAttributes.get(SERIALIZED_PROFILE); if (serializedProfile == null) { throw new TechnicalException("No serialized profile found. You should certainly define the explicit attribute names you " + "want to retrieve"); } final U profile = (U) javaSerializationHelper.deserializeFromBase64(serializedProfile); if (profile == null) { throw new TechnicalException("No deserialized profile available. You should certainly define the explicit attribute " + "names you want to retrieve"); } final Object id = storageAttributes.get(getIdAttribute()); if (isBlank(profile.getId()) && id != null) { profile.setId(ProfileHelper.sanitizeIdentifier(profile, id)); } if (isBlank(profile.getLinkedId()) && isNotBlank(linkedId)) { profile.setLinkedId(linkedId); } return profile; } }

Target:
protected U convertAttributesToProfile(final List<Map<String, Object>> listStorageAttributes, final String username) { if (listStorageAttributes == null || listStorageAttributes.size() == 0) { return null; } final Map<String, Object> storageAttributes = listStorageAttributes.get(0); final String linkedId = (String) storageAttributes.get(LINKEDID); if (isLegacyMode()) { final U profile = getProfileDefinition().newProfile(); for (final String attributeName : attributeNames) { getProfileDefinition().convertAndAdd(profile, PROFILE_ATTRIBUTE, attributeName, storageAttributes.get(attributeName)); } final Object retrievedUsername = storageAttributes.get(getUsernameAttribute()); if (retrievedUsername != null) { profile.addAttribute(USERNAME, retrievedUsername); } else { profile.addAttribute(USERNAME, username); } final Object retrievedId = storageAttributes.get(getIdAttribute()); assertNotNull(getIdAttribute(), retrievedId); profile.setId(ProfileHelper.sanitizeIdentifier(profile, retrievedId)); if (isNotBlank(linkedId)) { profile.setLinkedId(linkedId); } return profile; } else { final String serializedProfile = (String) storageAttributes.get(SERIALIZED_PROFILE); if (serializedProfile == null) { throw new TechnicalException("No serialized profile found. You should certainly define the explicit attribute names you " + "want to retrieve"); } final U profile = (U) javaSerializationHelper.deserializeFromBase64(serializedProfile); if (profile == null) { throw new TechnicalException("No deserialized profile available. You should certainly define the explicit attribute " + "names you want to retrieve"); } final Object id = storageAttributes.get(getIdAttribute()); if (isBlank(profile.getId()) && id != null) { profile.setId(ProfileHelper.sanitizeIdentifier(profile, id)); } if (isBlank(profile.getLinkedId()) && isNotBlank(linkedId)) { profile.setLinkedId(linkedId); } return profile; } }