(Just in case a future Java version changes what Z...
# announcements
m
(Just in case a future Java version changes what ZonedDateTime will parse, or we switch to a different calendar or something...)
d
I think Java is backward compatible. Not your job to test that.
l
I think it's valid if you don't know the string to be parsed
As it might be invalid, and
parse
might return null
m
The point is to get a ZonedDateTime value I can use in tests, and which isn't nullable.
d
Oh I understand now.
It's a bit overkill but .... sure I guess.
@Ruckus Ha, same.
m
!!
works too, obviously, but IDEA suggested replacing it
d
Can
ZonedDateTime
be constructed without parsing? (I guess that doesn't quite solve the problem).
Rip, still platform type in that case.
It's an issue because it brings us back to square one.
The square of whether one should explicitly check the nullability of the returned value.
m
val zdt = ZonedDateTime.of(2019,7,19,14,19,5,0, ZoneId.ofOffset("",ZoneOffset.ofHours(-5)))
So much better 😛
d
I guess in conclusion, it's more on the unreasonable side of things.