Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't [v2]

2023-05-02 Thread Roger Riggs
On Tue, 2 May 2023 19:54:14 GMT, Eamonn McManus wrote: >> Instant.ofEpochMilli says this: >> >> >> @throws DateTimeException if the instant exceeds the maximum or minimum >> instant >> >> >> But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it >> does not throw. That's

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't [v2]

2023-05-02 Thread Eamonn McManus
> Instant.ofEpochMilli says this: > > > @throws DateTimeException if the instant exceeds the maximum or minimum > instant > > > But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it > does not throw. That's already implicitly tested in > [`TestInstant`](https://github.com

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-04-07 Thread Eamonn McManus
On Thu, 9 Mar 2023 19:49:29 GMT, Eamonn McManus wrote: > Instant.ofEpochMilli says this: > > > @throws DateTimeException if the instant exceeds the maximum or minimum > instant > > > But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it > does not throw. That's already i

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-04-07 Thread Roger Riggs
On Thu, 9 Mar 2023 19:49:29 GMT, Eamonn McManus wrote: > Instant.ofEpochMilli says this: > > > @throws DateTimeException if the instant exceeds the maximum or minimum > instant > > > But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it > does not throw. That's already i

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-04-07 Thread Eamonn McManus
On Thu, 9 Mar 2023 19:49:29 GMT, Eamonn McManus wrote: > Instant.ofEpochMilli says this: > > > @throws DateTimeException if the instant exceeds the maximum or minimum > instant > > > But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it > does not throw. That's already i

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-04-07 Thread Alan Bateman
On Thu, 9 Mar 2023 19:49:29 GMT, Eamonn McManus wrote: > Instant.ofEpochMilli says this: > > > @throws DateTimeException if the instant exceeds the maximum or minimum > instant > > > But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it > does not throw. That's already i

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-03-09 Thread Alan Bateman
On Thu, 9 Mar 2023 22:07:17 GMT, Roger Riggs wrote: > I see your point, but no one has stumbled into/over it before. > Rationalizing here... > The presence of the exception is a reminder that there are values of epoch > milliseconds that `Instant` can not represent. > It is also the case that `l

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-03-09 Thread Roger Riggs
On Thu, 9 Mar 2023 19:49:29 GMT, Eamonn McManus wrote: > Instant.ofEpochMilli says this: > > > @throws DateTimeException if the instant exceeds the maximum or minimum > instant > > > But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it > does not throw. That's already i

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-03-09 Thread Eamonn McManus
On Thu, 9 Mar 2023 21:03:38 GMT, Roger Riggs wrote: > You're picking on a fine point here that is data dependent, and there's not > much value in changing it. Could you elaborate on this a bit? The way I see it, the argument to `ofEpochMillis` is a `long` with the same meaning as `System.curr

Re: RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-03-09 Thread Roger Riggs
On Thu, 9 Mar 2023 19:49:29 GMT, Eamonn McManus wrote: > Instant.ofEpochMilli says this: > > > @throws DateTimeException if the instant exceeds the maximum or minimum > instant > > > But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it > does not throw. That's already i

RFR: 8303919: Instant.ofEpochMilli says it can throw an exception that it can't

2023-03-09 Thread Eamonn McManus
Instant.ofEpochMilli says this: @throws DateTimeException if the instant exceeds the maximum or minimum instant But that can't happen. Even given `Long.MIN_VALUE` or `Long.MAX_VALUE` it does not throw. That's already implicitly tested in [`TestInstant`](https://github.com/openjdk/jdk/blob/a9d