src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java
Print this page
@@ -165,10 +165,11 @@
* @param chrono the chronology, not null
* @param instant the instant, not null
* @param zone the zone identifier, not null
* @return the zoned date-time, not null
*/
+ @SuppressWarnings("rawtypes")
static ChronoZonedDateTimeImpl<?> ofInstant(Chronology chrono, Instant instant, ZoneId zone) {
ZoneRules rules = zone.getRules();
ZoneOffset offset = rules.getOffset(instant);
Objects.requireNonNull(offset, "offset"); // protect against bad ZoneRules
LocalDateTime ldt = LocalDateTime.ofEpochSecond(instant.getEpochSecond(), instant.getNano(), offset);