private Person generatePerson(String username) { String product = applicationProperties.getDisplayName(); Person person = new Person(); // don't want to get a default UserProfile when the "user" is anon or the product, // and anyway there could be a user with the username "anonymous" or "Confluence" etc if (i18nResolver.getText("upm.auditLog.anonymous").equals(username) || product.equals(username)) { person.setName(username); } else { UserProfile userProfile = userManager.getUserProfile(username); final String userFullname = userProfile == null ? null : userProfile.getFullName(); person.setName((userFullname != null) ? userFullname : username); URI userUri = uriBuilder.buildAbsoluteProfileUri(userProfile); if (userUri != null) { person.setUrl(userUri.toString()); } } return person; }