private void upgradeProfile(OrcidProfile orcidProfile) { if (orcidProfile != null) { if (orcidProfile.getOrcidInternal() != null) { if (orcidProfile.getOrcidInternal().getPreferences() != null) { Preferences prefs = orcidProfile.getOrcidInternal().getPreferences(); if (prefs.getWorkVisibilityDefault() != null && prefs.getWorkVisibilityDefault().getValue() != null) { prefs.setActivitiesVisibilityDefault(new ActivitiesVisibilityDefault(prefs.getWorkVisibilityDefault().getValue())); prefs.setWorkVisibilityDefault(null); } if(prefs.getDeveloperToolsEnabled() == null) { DeveloperToolsEnabled dtn = new DeveloperToolsEnabled(false); prefs.setDeveloperToolsEnabled(dtn); } } } } }