Skip to content

Commit 2019899

Browse files
authored
Link to the new location of the design FAQ and to specific sections. (#845)
1 parent f01eac9 commit 2019899

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

‎src/main/java/org/jspecify/annotations/NullMarked.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@
5454
* <ul>
5555
* <li>A <b>wildcard</b> (as seen in {@code List<?>}) generally represents a nullable type, unless
5656
* either it or its corresponding type parameter has a non-null upper bound. (<a
57-
* href="https://bit.ly/3ppb8ZC">Why?</a>)
57+
* href="https://jspecify.dev/docs/nullness-design-faq/#wildcards-and-bounds">Why?</a>)
5858
* <li>A <b>type parameter</b> itself is a different case. It is never really "unbounded"; if no
5959
* upper bound is given explicitly, then {@code Object} is filled in by the compiler. This
6060
* means the example {@code class MyList<E>} is interpreted identically to {@code class
6161
* MyList<E extends Object>}, making the upper bound <i>non-null</i> {@code Object}. (<a
62-
* href="https://bit.ly/3ppb8ZC">Why?</a>)
62+
* href="https://jspecify.dev/docs/nullness-design-faq/#type-parameters-and-bounds">Why?</a>)
6363
* <li>When a type parameter has a nullable upper bound, such as the {@code E} in {@code class
6464
* Foo<E extends @Nullable Bar>}, an unannotated usage of the associated <b>type variable</b>
6565
* (within that class) must be handled conservatively: it is nullable when read, yet cannot

‎src/main/java/org/jspecify/annotations/NullUnmarked.java‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,18 @@
6161
*
6262
* <p>Within null-unmarked context, a type usage that is {@linkplain Nullable##applicability
6363
* nullness-applicable} but has no nullness annotation generally has <b>unspecified nullness</b> (<a
64-
* href="https://bit.ly/3ppb8ZC">Why?</a>). This means we <i>do not know</i> whether it includes or
65-
* excludes {@code null} as a value. In such a case, tools can vary widely in how strict or lenient
66-
* their enforcement is, or might even be configurable.
64+
* href="https://jspecify.dev/docs/nullness-design-faq/#unspecified-nullness">Why?</a>). This means
65+
* we <i>do not know</i> whether it includes or excludes {@code null} as a value. In such a case,
66+
* tools can vary widely in how strict or lenient their enforcement is, or might even be
67+
* configurable.
6768
*
6869
* <p>For more, please see this more <a
6970
* href="https://github.com/jspecify/jspecify/wiki/nullness-unspecified">comprehensive
7071
* discussion</a> of unspecified nullness.
7172
*
7273
* <p>There is no way for an individual type usage within null-marked context to have unspecified
73-
* nullness. (<a href="https://bit.ly/3ppb8ZC">Why?</a>)
74+
* nullness. (<a
75+
* href="https://jspecify.dev/docs/nullness-design-faq/#type-use-unspecified-nullness">Why?</a>)
7476
*
7577
* <h2>Where it can be used</h2>
7678
*

‎src/main/java/org/jspecify/annotations/Nullable.java‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,15 @@
113113
* annotation in this location could only be either contradictory or redundant.
114114
* <li>On a <b>local variable</b> declaration (root type only). While the cases listed above
115115
* benefit from <i>declarative</i> nullness, the nullness of a local variable is more properly
116-
* determined through flow analysis (<a href="https://bit.ly/3ppb8ZC">Why?</a>). This rule
116+
* determined through flow analysis (<a
117+
* href="https://jspecify.dev/docs/nullness-design-faq/#local-variables">Why?</a>). This rule
117118
* applies only to the <i>root type</i> of the variable; type components, such as type
118119
* arguments, follow the usual rules.
119120
* <li>In a <b>cast expression</b> (root type only). To inform an analyzer that an expression it
120121
* sees as nullable is truly non-null, use an assertion or a method like {@link
121-
* java.util.Objects#requireNonNull}. (<a href="https://bit.ly/3ppb8ZC">Why?</a>) Type
122-
* components, such as type arguments, follow the usual rules.
122+
* java.util.Objects#requireNonNull}. (<a
123+
* href="https://jspecify.dev/docs/nullness-design-faq/#casts">Why?</a>) Type components, such
124+
* as type arguments, follow the usual rules.
123125
* <li>On any part of the argument to <b>{@code instanceof}</b>. The root type is intrinsically
124126
* non-null, as discussed above, and nothing else about nullness is checked at runtime.
125127
* <li>On any part of a <b>receiver parameter</b> type (<a

0 commit comments

Comments
 (0)