File tree Expand file tree Collapse file tree 6 files changed +30
-18
lines changed
android/guava/src/com/google/common
guava/src/com/google/common Expand file tree Collapse file tree 6 files changed +30
-18
lines changed Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ final class NullnessCasts {
4444 * doesn't work: Because nullness analyses typically infer the nullness of local variables,
4545 * there's no way to assign a {@code @Nullable T} to a field {@code T foo;} and instruct the
4646 * analysis that that means "plain {@code T}" rather than the inferred type {@code @Nullable T}.
47- * (Even if supported added {@code @NonNull}, that would not help, since the problem case
48- * addressed by this method is the case in which {@code T} has parametric nullness -- and thus its
49- * value may be legitimately {@code null}.)
47+ * (And even if annotations on local variables were permitted as an optional hint, no annotation
48+ * would be the right tool for the job here: {@code @Nullable} is the annotation that we're trying
49+ * to get rid of, and {@code @NonNull} would be wrong for our use case for the same reason as
50+ * {@code requireNonNull}: Our use case is the one in which {@code T} has parametric nullness—and
51+ * thus its value may be legitimately {@code null}.)
5052 */
5153 @ ParametricNullness
5254 @ SuppressWarnings ("nullness" )
Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ final class NullnessCasts {
4444 * doesn't work: Because nullness analyses typically infer the nullness of local variables,
4545 * there's no way to assign a {@code @Nullable T} to a field {@code T foo;} and instruct the
4646 * analysis that that means "plain {@code T}" rather than the inferred type {@code @Nullable T}.
47- * (Even if supported added {@code @NonNull}, that would not help, since the problem case
48- * addressed by this method is the case in which {@code T} has parametric nullness -- and thus its
49- * value may be legitimately {@code null}.)
47+ * (And even if annotations on local variables were permitted as an optional hint, no annotation
48+ * would be the right tool for the job here: {@code @Nullable} is the annotation that we're trying
49+ * to get rid of, and {@code @NonNull} would be wrong for our use case for the same reason as
50+ * {@code requireNonNull}: Our use case is the one in which {@code T} has parametric nullness—and
51+ * thus its value may be legitimately {@code null}.)
5052 */
5153 @ ParametricNullness
5254 @ SuppressWarnings ("nullness" )
Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ final class NullnessCasts {
4444 * doesn't work: Because nullness analyses typically infer the nullness of local variables,
4545 * there's no way to assign a {@code @Nullable T} to a field {@code T foo;} and instruct the
4646 * analysis that that means "plain {@code T}" rather than the inferred type {@code @Nullable T}.
47- * (Even if supported added {@code @NonNull}, that would not help, since the problem case
48- * addressed by this method is the case in which {@code T} has parametric nullness -- and thus its
49- * value may be legitimately {@code null}.)
47+ * (And even if annotations on local variables were permitted as an optional hint, no annotation
48+ * would be the right tool for the job here: {@code @Nullable} is the annotation that we're trying
49+ * to get rid of, and {@code @NonNull} would be wrong for our use case for the same reason as
50+ * {@code requireNonNull}: Our use case is the one in which {@code T} has parametric nullness—and
51+ * thus its value may be legitimately {@code null}.)
5052 */
5153 @ SuppressWarnings ("nullness" )
5254 @ ParametricNullness
Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ final class NullnessCasts {
4444 * doesn't work: Because nullness analyses typically infer the nullness of local variables,
4545 * there's no way to assign a {@code @Nullable T} to a field {@code T foo;} and instruct the
4646 * analysis that that means "plain {@code T}" rather than the inferred type {@code @Nullable T}.
47- * (Even if supported added {@code @NonNull}, that would not help, since the problem case
48- * addressed by this method is the case in which {@code T} has parametric nullness -- and thus its
49- * value may be legitimately {@code null}.)
47+ * (And even if annotations on local variables were permitted as an optional hint, no annotation
48+ * would be the right tool for the job here: {@code @Nullable} is the annotation that we're trying
49+ * to get rid of, and {@code @NonNull} would be wrong for our use case for the same reason as
50+ * {@code requireNonNull}: Our use case is the one in which {@code T} has parametric nullness—and
51+ * thus its value may be legitimately {@code null}.)
5052 */
5153 @ ParametricNullness
5254 @ SuppressWarnings ("nullness" )
Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ final class NullnessCasts {
4444 * doesn't work: Because nullness analyses typically infer the nullness of local variables,
4545 * there's no way to assign a {@code @Nullable T} to a field {@code T foo;} and instruct the
4646 * analysis that that means "plain {@code T}" rather than the inferred type {@code @Nullable T}.
47- * (Even if supported added {@code @NonNull}, that would not help, since the problem case
48- * addressed by this method is the case in which {@code T} has parametric nullness -- and thus its
49- * value may be legitimately {@code null}.)
47+ * (And even if annotations on local variables were permitted as an optional hint, no annotation
48+ * would be the right tool for the job here: {@code @Nullable} is the annotation that we're trying
49+ * to get rid of, and {@code @NonNull} would be wrong for our use case for the same reason as
50+ * {@code requireNonNull}: Our use case is the one in which {@code T} has parametric nullness—and
51+ * thus its value may be legitimately {@code null}.)
5052 */
5153 @ ParametricNullness
5254 @ SuppressWarnings ("nullness" )
Original file line number Diff line number Diff line change @@ -44,9 +44,11 @@ final class NullnessCasts {
4444 * doesn't work: Because nullness analyses typically infer the nullness of local variables,
4545 * there's no way to assign a {@code @Nullable T} to a field {@code T foo;} and instruct the
4646 * analysis that that means "plain {@code T}" rather than the inferred type {@code @Nullable T}.
47- * (Even if supported added {@code @NonNull}, that would not help, since the problem case
48- * addressed by this method is the case in which {@code T} has parametric nullness -- and thus its
49- * value may be legitimately {@code null}.)
47+ * (And even if annotations on local variables were permitted as an optional hint, no annotation
48+ * would be the right tool for the job here: {@code @Nullable} is the annotation that we're trying
49+ * to get rid of, and {@code @NonNull} would be wrong for our use case for the same reason as
50+ * {@code requireNonNull}: Our use case is the one in which {@code T} has parametric nullness—and
51+ * thus its value may be legitimately {@code null}.)
5052 */
5153 @ SuppressWarnings ("nullness" )
5254 @ ParametricNullness
You can’t perform that action at this time.
0 commit comments