Skip to content

Commit

Permalink
[7.10] Fix incorrect use of Format.equals instead of matches backport…
Browse files Browse the repository at this point in the history
…#63462 elastic#63463

closes elastic#63459
backports elastic#63462
  • Loading branch information
pgomulka authored Oct 8, 2020
1 parent 5e62352 commit d7391bc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static JodaDateFormatter forPattern(String input) {
formatter = ISODateTimeFormat.weekDateTime();
} else if (FormatNames.WEEK_DATE_TIME_NO_MILLIS.matches(input)) {
formatter = ISODateTimeFormat.weekDateTimeNoMillis();
} else if (FormatNames.WEEKYEAR.equals(input)) {
} else if (FormatNames.WEEKYEAR.matches(input)) {
getDeprecationLogger()
.deprecate("week_year_format_name", "Format name \"week_year\" is deprecated and will be removed in a future version. " +
"Use \"weekyear\" format instead");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ public void testCustomTimeFormats() {
// assertSamePrinterOutput("E, d MMM yyyy HH:mm:ss Z", LocaleUtils.parse("de"), javaTimeNow, dateTimeNow);
// }

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/63459")
public void testDuellingFormatsValidParsing() {
assertSameDate("1522332219", "epoch_second");
assertSameDate("0", "epoch_second");
Expand Down Expand Up @@ -761,7 +760,6 @@ public void testDuelingStrictParsing() {
assertParseException("2012-W1-1", "strict_weekyear_week_day");
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/63459")
public void testSamePrinterOutput() {
int year = randomIntBetween(1970, 2030);
int month = randomIntBetween(1, 12);
Expand Down

0 comments on commit d7391bc

Please sign in to comment.