@@ -1841,7 +1841,7 @@ public static ZonedDateTime from(TemporalAccessor accessor) {
1841
1841
zoneId = ZoneOffset .UTC ;
1842
1842
}
1843
1843
1844
- LocalDate localDate = accessor .query (LOCAL_DATE_QUERY );
1844
+ LocalDate localDate = accessor .query (TemporalQueries . localDate ()); //accessor.query( LOCAL_DATE_QUERY);
1845
1845
LocalTime localTime = accessor .query (TemporalQueries .localTime ());
1846
1846
boolean isLocalDateSet = localDate != null ;
1847
1847
boolean isLocalTimeSet = localTime != null ;
@@ -1859,8 +1859,10 @@ public static ZonedDateTime from(TemporalAccessor accessor) {
1859
1859
if (accessor .isSupported (MONTH_OF_YEAR )) {
1860
1860
return getFirstOfMonth (accessor ).atStartOfDay (zoneId );
1861
1861
} else {
1862
- int year = getYear (accessor );
1863
- return Year .of (year ).atDay (1 ).atStartOfDay (zoneId );
1862
+ return Year .of (accessor .get (ChronoField .YEAR )).atDay (1 ).atStartOfDay (zoneId );
1863
+
1864
+ // int year = getYear(accessor);
1865
+ // return Year.of(year).atDay(1).atStartOfDay(zoneId);
1864
1866
}
1865
1867
} else if (accessor .isSupported (MONTH_OF_YEAR )) {
1866
1868
// missing year, falling back to the epoch and then filling
@@ -1941,6 +1943,8 @@ private static ZonedDateTime of(LocalDate localDate, LocalTime localTime, ZoneId
1941
1943
1942
1944
@ SuppressForbidden (reason = "LocalDate.of is fine here" )
1943
1945
private static LocalDate getFirstOfMonth (TemporalAccessor accessor ) {
1944
- return LocalDate .of (getYear (accessor ), accessor .get (MONTH_OF_YEAR ), 1 );
1946
+ // return LocalDate.of(getYear(accessor), accessor.get(MONTH_OF_YEAR), 1);
1947
+ return LocalDate .of (accessor .get (ChronoField .YEAR ), accessor .get (MONTH_OF_YEAR ), 1 );
1948
+
1945
1949
}
1946
1950
}
0 commit comments