Remove leniency on poll message ID format without years in them

It's been long enough since the format change adding in years that all
registrars should no longer have any IDs in the old format lying around
that they're still attempting to ACK. All poll messages have already been
coming back to registrars with the new format for months now.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=184714735
This commit is contained in:
mcilwain 2018-02-06 11:44:50 -08:00 committed by jianglai
parent 6280d74f1c
commit 29c38f3622
5 changed files with 40 additions and 42 deletions

View file

@ -85,11 +85,9 @@ public class PollMessageExternalKeyConverter {
*
* @throws PollMessageExternalKeyParseException if the external key has an invalid format.
*/
// TODO(b/68953444): Make the year field mandatory once sufficient time has elapsed and backwards
// compatibility is no longer necessary.
public static Key<PollMessage> parsePollMessageExternalId(String externalKey) {
List<String> idComponents = Splitter.on('-').splitToList(externalKey);
if (idComponents.size() != 5 && idComponents.size() != 6) {
if (idComponents.size() != 6) {
throw new PollMessageExternalKeyParseException();
}
try {