Source:
private void createProfileForSelectedAuthType(XFormDialog dialog) { String authType = dialog.getValue(AuthorizationTypeForm.AUTHORIZATION_TYPE); CredentialsConfig.AuthType.Enum authTypeEnum; String profileName; if (CredentialsConfig.AuthType.O_AUTH_2_0.toString().equals(authType)) { profileName = dialog.getValue(AuthorizationTypeForm.OAUTH2_PROFILE_NAME_FIELD); if (ProfileSelectionForm.isReservedProfileName(profileName)) { UISupport.showErrorMessage("'" + profileName + "' is a reserved profile name."); return; } if (getOAuth2ProfileContainer().getOAuth2ProfileNameList().contains(profileName)) { UISupport.showErrorMessage("There is already a profile named '" + profileName + "'"); return; } getOAuth2ProfileContainer().addNewOAuth2Profile(profileName); authTypeEnum = CredentialsConfig.AuthType.O_AUTH_2_0; } else if (CredentialsConfig.AuthType.O_AUTH_1_0.toString().equals(authType)) { profileName = dialog.getValue(AuthorizationTypeForm.OAUTH2_PROFILE_NAME_FIELD); if (ProfileSelectionForm.isReservedProfileName(profileName)) { UISupport.showErrorMessage("'" + profileName + "' is a reserved profile name."); return; } if (getOAuth1ProfileContainer().getOAuth1ProfileNameList().contains(profileName)) { UISupport.showErrorMessage("There is already a profile named '" + profileName + "'"); return; } getOAuth1ProfileContainer().addNewOAuth1Profile(profileName); authTypeEnum = CredentialsConfig.AuthType.O_AUTH_1_0; } else { profileName = authType; authTypeEnum = request.getBasicAuthType(authType); } request.setSelectedAuthProfileAndAuthType(profileName, authTypeEnum); }

Target:
private void createProfileForSelectedAuthType(XFormDialog dialog) { String authType = dialog.getValue(AuthorizationTypeForm.AUTHORIZATION_TYPE); CredentialsConfig.AuthType.Enum authTypeEnum; String profileName; if (CredentialsConfig.AuthType.O_AUTH_2_0.toString().equals(authType)) { profileName = dialog.getValue(AuthorizationTypeForm.OAUTH_PROFILE_NAME_FIELD); if (ProfileSelectionForm.isReservedProfileName(profileName)) { UISupport.showErrorMessage(messages.get("AuthorizationSelectionDialog.Error.ReservedProfileName", profileName)); return; } if (getOAuth2ProfileContainer().getOAuth2ProfileNameList().contains(profileName)) { UISupport.showErrorMessage(messages.get("AuthorizationSelectionDialog.Error.ProfileAlreadyExists", profileName)); return; } getOAuth2ProfileContainer().addNewOAuth2Profile(profileName); authTypeEnum = CredentialsConfig.AuthType.O_AUTH_2_0; } else if (CredentialsConfig.AuthType.O_AUTH_1_0.toString().equals(authType)) { profileName = dialog.getValue(AuthorizationTypeForm.OAUTH_PROFILE_NAME_FIELD); if (ProfileSelectionForm.isReservedProfileName(profileName)) { UISupport.showErrorMessage(messages.get("AuthorizationSelectionDialog.Error.ReservedProfileName", profileName)); return; } if (getOAuth1ProfileContainer().getOAuth1ProfileNameList().contains(profileName)) { UISupport.showErrorMessage(messages.get("AuthorizationSelectionDialog.Error.ProfileAlreadyExists", profileName)); return; } getOAuth1ProfileContainer().addNewOAuth1Profile(profileName); authTypeEnum = CredentialsConfig.AuthType.O_AUTH_1_0; } else { profileName = authType; authTypeEnum = request.getBasicAuthType(authType); } request.setSelectedAuthProfileAndAuthType(profileName, authTypeEnum); }