-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TemporalQuery.queryFrom
should return @Nullable R
#125
Comments
The understanding I came to is that there are " |
It seems every single type argument to
Where do you see these? |
jdk/src/java.base/share/classes/java/time/temporal/TemporalAccessor.java Lines 308 to 312 in 2ada91b
|
...huh :) I may have gotten confused when I saw a few entries like "A query for Oh, maybe what I was actually going on was this...?
And now I see your message about But I'd need to look into how instances are actually used in order to understand what that's about.... OK, here are a couple factory methods (which I won't pretend that I have any memory of) that do appear to be claiming that they always return non-null values: |
Some implementations of |
We don't run nullness checked on the annotated JDK. (We also haven't made much effort to annotate anything beyond publicly visible APIs, though we're inconsistent about that.) I agree that a checker would produce an error for... jdk/src/java.base/share/classes/java/time/temporal/TemporalAccessor.java Lines 312 to 316 in 2ada91b
...but I think that's one of those very rare cases (like in |
Documentation on jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java Lines 1376 to 1377 in 2ada91b
|
As for how these things are even used: It looks like a large fraction of the usages of (And now I'm confused as to how |
(Answer: The doc is wrong: |
The documentation says "may return null to indicate not found":
jdk/src/java.base/share/classes/java/time/temporal/TemporalQuery.java
Line 143 in 2ada91b
Also, maybe
R
shouldn'textends @Nullable Object
:jdk/src/java.base/share/classes/java/time/temporal/TemporalQuery.java
Line 107 in 2ada91b
since the meaning of a
null
return value would be ambiguous ifR
itself is@Nullable
.The text was updated successfully, but these errors were encountered: