jspecify / jspecify/jdk

`TemporalQuery.queryFrom` should return `@Nullable R`

Open
#125 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
7
Forks
3
Avg merge
15h 17m
Merged PRs (30d)
8

Description

The documentation says "may return null to indicate not found": https://github.com/jspecify/jdk/blob/2ada91bb0cf2f01ce67e1ce046c45322bf836661/src/java.base/share/classes/java/time/temporal/TemporalQuery.java#L143

Also, maybe R shouldn't extends @Nullable Object: https://github.com/jspecify/jdk/blob/2ada91bb0cf2f01ce67e1ce046c45322bf836661/src/java.base/share/classes/java/time/temporal/TemporalQuery.java#L107

since the meaning of a null return value would be ambiguous if R itself is @Nullable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/java.base/share/classes/java/time/temporal/TemporalQuery.java at the cited lines 107 and 143. Compare the generic bound, queryFrom return annotation, and documentation to determine how null results should be represented. Done means the declarations and documentation consistently express the agreed nullability semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.