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:
David Ostrovsky 2016-05-30 22:44:48 +02:00 committed by David Pursehouse
parent cc91bb2494
commit 1de95f4de9
2 changed files with 3 additions and 3 deletions

View File

@ -229,7 +229,7 @@ public class PublicKeyCheckerTest {
"Key is revoked (key material has been compromised): test6 compromised";
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()
.setStore(store)
.setEffectiveTime(df.parse("2010-01-01 12:00:00"));
@ -385,7 +385,7 @@ public class PublicKeyCheckerTest {
}
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) {

View File

@ -139,7 +139,7 @@ public class PushCertificateCheckerTest {
@Test
public void signatureByExpiredKeyBeforeExpiration() throws Exception {
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");
PushCertificate cert = newSignedCert(validNonce(), key3, now);
assertNoProblems(cert);