Skip to content

Commit

Permalink
Replaces Date().getTime() method with System.currentTimeMillis()
Browse files Browse the repository at this point in the history
  • Loading branch information
openrefactorymunawar authored and sjohnr committed Oct 10, 2024
1 parent 567933d commit aa7ef11
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import java.security.SecureRandom;
import java.util.Base64;
import java.util.Date;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.security.crypto.codec.Hex;
Expand Down Expand Up @@ -85,7 +84,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
@Override
public Token allocateToken(String extendedInformation) {
Assert.notNull(extendedInformation, "Must provided non-null extendedInformation (but it can be empty)");
long creationTime = new Date().getTime();
long creationTime = System.currentTimeMillis();
String serverSecret = computeServerSecretApplicableAt(creationTime);
String pseudoRandomNumber = generatePseudoRandomNumber();
String content = creationTime + ":" + pseudoRandomNumber + ":" + extendedInformation;
Expand Down

0 comments on commit aa7ef11

Please sign in to comment.