diff --git a/server/src/main/java/org/elasticsearch/common/joda/JodaDateFormatter.java b/server/src/main/java/org/elasticsearch/common/joda/JodaDateFormatter.java index 26db11a48acb8..e065c9af8f7c7 100644 --- a/server/src/main/java/org/elasticsearch/common/joda/JodaDateFormatter.java +++ b/server/src/main/java/org/elasticsearch/common/joda/JodaDateFormatter.java @@ -46,15 +46,11 @@ public JodaDateFormatter(String pattern, DateTimeFormatter parser, DateTimeForma } /** - * Try to parse input to a java time TemporalAccessor using Joda library + * Try to parse input to a java time TemporalAccessor using joda-time library. * @see DateFormatter#parse(String) - * @throws UnsupportedOperationException if parsing is not supported * @throws IllegalArgumentException if the text to parse is invalid - * @see DateTimeFormatter#parseDateTime - * - * @throws java.time.DateTimeException as per java-time javadoc - * @see ZonedDateTime#ofInstant(Instant, ZoneId) - * @see Instant#ofEpochMilli(long) + * @throws java.time.DateTimeException if the parsing result exceeds the supported range of ZoneDateTime + * or if the parsed instant exceeds the maximum or minimum instant */ @Override public TemporalAccessor parse(String input) { diff --git a/server/src/main/java/org/elasticsearch/common/time/DateFormatter.java b/server/src/main/java/org/elasticsearch/common/time/DateFormatter.java index 38e93e327af72..763fe6a6c0fe1 100644 --- a/server/src/main/java/org/elasticsearch/common/time/DateFormatter.java +++ b/server/src/main/java/org/elasticsearch/common/time/DateFormatter.java @@ -23,6 +23,7 @@ import org.elasticsearch.common.joda.Joda; import org.joda.time.DateTime; +import java.time.DateTimeException; import java.time.Instant; import java.time.ZoneId; import java.time.ZoneOffset; @@ -39,6 +40,8 @@ public interface DateFormatter { * @param input An arbitrary string resembling the string representation of a date or time * @throws IllegalArgumentException If parsing fails, this exception will be thrown. * Note that it can contained suppressed exceptions when several formatters failed parse this value + * @throws DateTimeException if the parsing result exceeds the supported range of ZoneDateTime + * or if the parsed instant exceeds the maximum or minimum instant * @return The java time object containing the parsed input */ TemporalAccessor parse(String input);