String anonymousId = Strings.emptyToNull(params.getConfigValue(PARAM_ANONYMOUS_ID, DEFAULT_ANONYMOUS_ID, String.class));
if (anonymousId != null && userManager.getAuthorizable(anonymousId) == null) {
userManager.createUser(anonymousId, null);
}
if (root.hasPendingChanges()) {
root.commit();
}
} catch (RepositoryException e) {
log.error(errorMsg, e);
throw new RuntimeException(e);
} catch (CommitFailedException e) {