mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 23:02:15 +00:00
Unnecessary conversion to String
This commit is contained in:
parent
eddcd1622f
commit
8d0ca14e55
@ -83,7 +83,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
|
|||||||
long creationTime = new Date().getTime();
|
long creationTime = new Date().getTime();
|
||||||
String serverSecret = computeServerSecretApplicableAt(creationTime);
|
String serverSecret = computeServerSecretApplicableAt(creationTime);
|
||||||
String pseudoRandomNumber = generatePseudoRandomNumber();
|
String pseudoRandomNumber = generatePseudoRandomNumber();
|
||||||
String content = Long.toString(creationTime) + ":" + pseudoRandomNumber + ":"
|
String content = creationTime + ":" + pseudoRandomNumber + ":"
|
||||||
+ extendedInformation;
|
+ extendedInformation;
|
||||||
|
|
||||||
// Compute key
|
// Compute key
|
||||||
@ -126,7 +126,7 @@ public class KeyBasedPersistenceTokenService implements TokenService, Initializi
|
|||||||
String sha1Hex = tokens[tokens.length - 1];
|
String sha1Hex = tokens[tokens.length - 1];
|
||||||
|
|
||||||
// Verification
|
// Verification
|
||||||
String content = Long.toString(creationTime) + ":" + pseudoRandomNumber + ":"
|
String content = creationTime + ":" + pseudoRandomNumber + ":"
|
||||||
+ extendedInfo.toString();
|
+ extendedInfo.toString();
|
||||||
String expectedSha512Hex = Sha512DigestUtils.shaHex(content + ":" + serverSecret);
|
String expectedSha512Hex = Sha512DigestUtils.shaHex(content + ":" + serverSecret);
|
||||||
Assert.isTrue(expectedSha512Hex.equals(sha1Hex), "Key verification failure");
|
Assert.isTrue(expectedSha512Hex.equals(sha1Hex), "Key verification failure");
|
||||||
|
@ -127,7 +127,7 @@ public class FilterChainPerformanceTests {
|
|||||||
HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
|
HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY,
|
||||||
SecurityContextHolder.getContext());
|
SecurityContextHolder.getContext());
|
||||||
SecurityContextHolder.clearContext();
|
SecurityContextHolder.clearContext();
|
||||||
sw.start(Integer.toString(nAuthorities) + " authorities");
|
sw.start(nAuthorities + " authorities");
|
||||||
runWithStack(minimalStack);
|
runWithStack(minimalStack);
|
||||||
System.out.println(sw.shortSummary());
|
System.out.println(sw.shortSummary());
|
||||||
sw.stop();
|
sw.stop();
|
||||||
|
@ -75,7 +75,7 @@ public class RedirectUrlBuilder {
|
|||||||
|
|
||||||
// Append the port number if it's not standard for the scheme
|
// Append the port number if it's not standard for the scheme
|
||||||
if (port != (scheme.equals("http") ? 80 : 443)) {
|
if (port != (scheme.equals("http") ? 80 : 443)) {
|
||||||
sb.append(":").append(Integer.toString(port));
|
sb.append(":").append(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contextPath != null) {
|
if (contextPath != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user