Bazel: Fix MisusedWeekYear error detected by ErrorProne
Building Gerrit code with Bazel revealed MisusedWeekYear error detected by ErrorProne: [1]. [1] http://errorprone.info/bugpattern/MisusedWeekYear Change-Id: I95edf77a1922840e9e37a6125ba7d094be297516
This commit is contained in:

committed by
David Pursehouse

parent
cc91bb2494
commit
1de95f4de9
@@ -229,7 +229,7 @@ public class PublicKeyCheckerTest {
|
|||||||
"Key is revoked (key material has been compromised): test6 compromised";
|
"Key is revoked (key material has been compromised): test6 compromised";
|
||||||
assertProblems(k, problem);
|
assertProblems(k, problem);
|
||||||
|
|
||||||
SimpleDateFormat df = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
|
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
PublicKeyChecker checker = new PublicKeyChecker()
|
PublicKeyChecker checker = new PublicKeyChecker()
|
||||||
.setStore(store)
|
.setStore(store)
|
||||||
.setEffectiveTime(df.parse("2010-01-01 12:00:00"));
|
.setEffectiveTime(df.parse("2010-01-01 12:00:00"));
|
||||||
@@ -385,7 +385,7 @@ public class PublicKeyCheckerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Date parseDate(String str) throws Exception {
|
private static Date parseDate(String str) throws Exception {
|
||||||
return new SimpleDateFormat("YYYY-MM-dd HH:mm:ss Z").parse(str);
|
return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<String> list(String first, String[] rest) {
|
private static List<String> list(String first, String[] rest) {
|
||||||
|
@@ -139,7 +139,7 @@ public class PushCertificateCheckerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void signatureByExpiredKeyBeforeExpiration() throws Exception {
|
public void signatureByExpiredKeyBeforeExpiration() throws Exception {
|
||||||
TestKey key3 = expiredKey();
|
TestKey key3 = expiredKey();
|
||||||
Date now = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss Z")
|
Date now = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z")
|
||||||
.parse("2005-07-10 12:00:00 -0400");
|
.parse("2005-07-10 12:00:00 -0400");
|
||||||
PushCertificate cert = newSignedCert(validNonce(), key3, now);
|
PushCertificate cert = newSignedCert(validNonce(), key3, now);
|
||||||
assertNoProblems(cert);
|
assertNoProblems(cert);
|
||||||
|
Reference in New Issue
Block a user