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 63
63
64
64
import org .checkerframework .checker .nullness .qual .Nullable ;
65
65
import org .checkerframework .framework .qual .AnnotatedFor ;
66
+ import org .checkerframework .framework .qual .CFComment ;
66
67
67
68
import java .time .DateTimeException ;
68
69
import java .util .Objects ;
@@ -309,6 +310,8 @@ default int get(TemporalField field) {
309
310
* @throws DateTimeException if unable to query
310
311
* @throws ArithmeticException if numeric overflow occurs
311
312
*/
313
+ @ CFComment ({"nullness: TemporalQuery promises that this is equivalent to query.queryFrom, so "
314
+ + "it returns plain R, just like that method." })
312
315
default <R > R query (TemporalQuery <R > query ) {
313
316
if (query == TemporalQueries .zoneId ()
314
317
|| query == TemporalQueries .chronology ()
Original file line number Diff line number Diff line change 62
62
package java .time .temporal ;
63
63
64
64
import org .checkerframework .framework .qual .AnnotatedFor ;
65
+ import org .checkerframework .framework .qual .CFComment ;
65
66
66
67
import java .time .DateTimeException ;
67
68
@@ -143,6 +144,8 @@ public interface TemporalQuery<R> {
143
144
* @throws DateTimeException if unable to query
144
145
* @throws ArithmeticException if numeric overflow occurs
145
146
*/
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." })
146
149
R queryFrom (TemporalAccessor temporal );
147
150
148
151
}
You can’t perform that action at this time.
0 commit comments