commit | a419a075dbe2379183d3d2676128f389bd2fbb29 | [log] [tgz] |
---|---|---|
author | Paladox none <thomasmulhall410@yahoo.com> | Sun Feb 12 02:15:05 2017 +0000 |
committer | David Ostrovsky <david.ostrovsky@gmail.com> | Sun Feb 12 22:29:31 2017 +0000 |
tree | e7d0ab99ff46277e2fd46b7466955b68bb60f576 | |
parent | 7c75c6cf4954a0eccfcd4c5a657af9d764939c1c [diff] |
Fix MisusedWeekYear bug pattern flagged by error prone Passing "YYYYMMdd-HHmmss" format to SimpleDateFormat ctor was failing with: error: [MisusedWeekYear] Use of "YYYY" (week year) in a date pattern without "ww" (week in year). You probably meant to use "yyyy" (year) instead. new SimpleDateFormat("YYYYMMdd-HHmmss").format(new Date())); ^ (see http://errorprone.info/bugpattern/MisusedWeekYear) Did you mean 'new SimpleDateFormat("yyyyMMdd-HHmmss").format(new Date()));' Change-Id: Ie51692fbacf06aed4a8920ca6dc0d75de47a1ee8
diff --git a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java index de5014a..884d1ab 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java +++ b/src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
@@ -188,7 +188,7 @@ if (refName.startsWith(R_HEADS) || refName.startsWith(R_TAGS)) { return String.format("%s-%s", R_BACKUPS + refName.replaceFirst(R_REFS, ""), - new SimpleDateFormat("YYYYMMdd-HHmmss").format(new Date())); + new SimpleDateFormat("yyyyMMdd-HHmmss").format(new Date())); } return refName;