Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Bill Burke 2014-06-02 09:37:30 -04:00
commit a180c6b896
2 changed files with 9 additions and 7 deletions

View file

@ -173,7 +173,7 @@ public class KeycloakInstalled {
}
public String getTokenString(long minValidity, TimeUnit unit) throws VerificationException, IOException, ServerRequest.HttpFailure {
long expires = token.getExpiration() * 1000 - unit.toMillis(minValidity);
long expires = ((long) token.getExpiration()) * 1000 - unit.toMillis(minValidity);
if (expires < System.currentTimeMillis()) {
refreshToken();
}

View file

@ -34,12 +34,14 @@ public class SocialUser {
}
public void setName(String name) {
int i = name.lastIndexOf(' ');
if (i != -1) {
firstName = name.substring(0, i);
lastName = name.substring(i + 1);
} else {
firstName = name;
if (name != null) {
int i = name.lastIndexOf(' ');
if (i != -1) {
firstName = name.substring(0, i);
lastName = name.substring(i + 1);
} else {
firstName = name;
}
}
}