File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
src/java.base/share/classes/java/time/temporal Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 6363
6464import org .checkerframework .checker .nullness .qual .Nullable ;
6565import org .checkerframework .framework .qual .AnnotatedFor ;
66+ import org .checkerframework .framework .qual .CFComment ;
6667
6768import java .time .DateTimeException ;
6869import java .util .Objects ;
@@ -309,6 +310,8 @@ default int get(TemporalField field) {
309310 * @throws DateTimeException if unable to query
310311 * @throws ArithmeticException if numeric overflow occurs
311312 */
313+ @ CFComment ({"nullness: TemporalQuery promises that this is equivalent to query.queryFrom, so "
314+ + "it returns plain R, just like that method." })
312315 default <R > R query (TemporalQuery <R > query ) {
313316 if (query == TemporalQueries .zoneId ()
314317 || query == TemporalQueries .chronology ()
Original file line number Diff line number Diff line change 6262package java .time .temporal ;
6363
6464import org .checkerframework .framework .qual .AnnotatedFor ;
65+ import org .checkerframework .framework .qual .CFComment ;
6566
6667import java .time .DateTimeException ;
6768
@@ -143,6 +144,8 @@ public interface TemporalQuery<R> {
143144 * @throws DateTimeException if unable to query
144145 * @throws ArithmeticException if numeric overflow occurs
145146 */
147+ @ CFComment ({"nullness: This is a function object, so we return plain R to distinguish between "
148+ + "instances that can return null and those that cannot." })
146149 R queryFrom (TemporalAccessor temporal );
147150
148151}
You can’t perform that action at this time.
0 commit comments