Skip to content

Commit 4ef1b97

Browse files
cpovirkGoogle Java Core Libraries
authored andcommitted
Explicitly list Table<..., @nullable V> as a supertype of ArrayTable.
That way, when the rendered Javadoc lists `Table` under "All implemented interfaces," it lists it with `@Nullable` on the type argument. Currently, Javadoc does not include `@Nullable` because we explicitly declare only `extends ArrayTable<R, C, @nullable V>`, where `ArrayTable` in turn `implements Table<R, C, V>`. That is not enough for Javadoc because Java doesn't know how substitution works for arbitrary custom type systems. (I think this relates to [JDK-8042981](https://bugs.openjdk.org/browse/JDK-8042981).) RELNOTES=n/a PiperOrigin-RevId: 794648642
1 parent 9fb2a4a commit 4ef1b97

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

android/guava/src/com/google/common/collect/ArrayTable.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@
8989
* @author Jared Levy
9090
* @since 10.0
9191
*/
92+
// We explicitly list `implements Table<...>` so that its `@Nullable V` appears in Javadoc.
93+
@SuppressWarnings("RedundancyRemover")
9294
@GwtCompatible
9395
public final class ArrayTable<R, C, V> extends AbstractTable<R, C, @Nullable V>
94-
implements Serializable {
96+
implements Table<R, C, @Nullable V>, Serializable {
9597

9698
/**
9799
* Creates an {@code ArrayTable} filled with {@code null}.

guava/src/com/google/common/collect/ArrayTable.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,11 @@
9090
* @author Jared Levy
9191
* @since 10.0
9292
*/
93+
// We explicitly list `implements Table<...>` so that its `@Nullable V` appears in Javadoc.
94+
@SuppressWarnings("RedundancyRemover")
9395
@GwtCompatible
9496
public final class ArrayTable<R, C, V> extends AbstractTable<R, C, @Nullable V>
95-
implements Serializable {
97+
implements Table<R, C, @Nullable V>, Serializable {
9698

9799
/**
98100
* Creates an {@code ArrayTable} filled with {@code null}.

0 commit comments

Comments
 (0)