Switch printed order of firstname and lastname (#758)

When separating with a comma, put the lastname up front.

Signed-off-by: Stefan Schake <stefan.schake@devolo.de>
This commit is contained in:
Stefan Schake
2018-11-07 11:02:22 +01:00
committed by Stefan Behl
parent ddca072561
commit 49d064df18

View File

@@ -123,13 +123,13 @@ public final class UserDetailsFormatter {
final UserPrincipal userPrincipal = (UserPrincipal) userDetails;
String firstname = StringUtils.defaultIfEmpty(userPrincipal.getFirstname(), "");
String lastname = StringUtils.defaultIfEmpty(userPrincipal.getLastname(), "");
if (!StringUtils.isEmpty(firstname)) {
firstname += DETAIL_SEPERATOR;
if (!StringUtils.isEmpty(lastname)) {
lastname += DETAIL_SEPERATOR;
}
final String firstAndLastname = firstname + StringUtils.defaultIfEmpty(userPrincipal.getLastname(), "");
final String firstAndLastname = lastname + StringUtils.defaultIfEmpty(userPrincipal.getFirstname(), "");
final String trimmedUsername = trimAndFormatDetail(firstAndLastname, expectedNameLength);