File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
android/guava/src/com/google/common/base
guava/src/com/google/common/base Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,12 @@ public String toString() {
7979 }
8080 }
8181
82- /** Returns the identity function. */
82+ /**
83+ * Returns the identity function.
84+ *
85+ * <p><b>Discouraged:</b> Prefer using a lambda like {@code v -> v}, which is shorter and often
86+ * more readable.
87+ */
8388 // implementation is "fully variant"; E has become a "pass-through" type
8489 @ SuppressWarnings ("unchecked" )
8590 public static <E extends @ Nullable Object > Function <E , E > identity () {
Original file line number Diff line number Diff line change @@ -79,7 +79,12 @@ public String toString() {
7979 }
8080 }
8181
82- /** Returns the identity function. */
82+ /**
83+ * Returns the identity function.
84+ *
85+ * <p><b>Discouraged:</b> Prefer using a lambda like {@code v -> v}, which is shorter and often
86+ * more readable.
87+ */
8388 // implementation is "fully variant"; E has become a "pass-through" type
8489 @ SuppressWarnings ("unchecked" )
8590 public static <E extends @ Nullable Object > Function <E , E > identity () {
You can’t perform that action at this time.
0 commit comments