Skip to content

Commit

Permalink
Adjust to changes of elastic#37407
Browse files Browse the repository at this point in the history
  • Loading branch information
droberts195 committed Jan 25, 2019
1 parent c0fc44d commit fd16bca
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ protected boolean enableWarningsCheck() {
}

// This method is using the Joda BWC layer. When that's removed, this method
// can be deleted too - we'll just validate the Java time formats after that.
// can be deleted - we'll just validate the Java time formats after that.
// Also remove enableWarningsCheck() above if this method is removed.
private void validateJodaTimestampFormats(List<String> jodaTimestampFormats, String text, long expectedEpochMs) {

// All the test times are for Tue May 15 2018 16:14:56 UTC, which is 17:14:56 in London.
Expand All @@ -300,12 +301,7 @@ private void validateJodaTimestampFormats(List<String> jodaTimestampFormats, Str
actualEpochMs = Joda.forPattern("date_optional_time").withZone(defaultZone).parseMillis(text);
break;
default:
// The Joda BWC layer doesn't support setting a default year, so we
// cannot validate patterns that don't explicitly include a year.
if (timestampFormat.contains("YYYY") == false) {
return;
}
actualEpochMs = Joda.forPattern(timestampFormat).withZone(defaultZone).parseMillis(text);
actualEpochMs = Joda.forPattern(timestampFormat).withYear(2018).withZone(defaultZone).parseMillis(text);
break;
}
if (expectedEpochMs == actualEpochMs) {
Expand Down

0 comments on commit fd16bca

Please sign in to comment.