summaryrefslogtreecommitdiff
path: root/core/java/android/util/SparseBooleanArray.java
diff options
context:
space:
mode:
authorRoman Kalukiewicz <romkal@google.com>2020-10-14 15:59:06 -0700
committerRoman Kalukiewicz <romkal@google.com>2020-10-15 10:48:01 -0700
commit24403f7ef2fcb9c9185f33474a43af885ac3ba49 (patch)
tree5913fae84a4c3fdc7d7e613da312b1e62882c019 /core/java/android/util/SparseBooleanArray.java
parenta4091c6922a677a8e18bf9feff79e66fde4ce149 (diff)
Add @Nullable annotation to the parameter of Object.equals() methods.
Those annotations could be inferred by some tools (like Kotlin), but the https://checkerframework.org/ doesn't check inherited annotations complaining about all equals() invocations that get nullable argument. The change was generated by running find . -name \*.java | xargs sed -i 's/public boolean equals(Object /public boolean equals(@Nullable Object /' in the frameworks/base directory and by automatically adding and formatting required imports if needed. No manual edits. Bug: 170883422 Test: Annotation change only. Should have not impact. Exempt-From-Owner-Approval: Mechanical change not specific to any component. Change-Id: I5eedb571c9d78862115dfdc5dae1cf2a35343580
Diffstat (limited to 'core/java/android/util/SparseBooleanArray.java')
-rw-r--r--core/java/android/util/SparseBooleanArray.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/java/android/util/SparseBooleanArray.java b/core/java/android/util/SparseBooleanArray.java
index 846df397aa6d..c145b20e6f6c 100644
--- a/core/java/android/util/SparseBooleanArray.java
+++ b/core/java/android/util/SparseBooleanArray.java
@@ -16,6 +16,7 @@
package android.util;
+import android.annotation.Nullable;
import android.compat.annotation.UnsupportedAppUsage;
import com.android.internal.util.ArrayUtils;
@@ -289,7 +290,7 @@ public class SparseBooleanArray implements Cloneable {
}
@Override
- public boolean equals(Object that) {
+ public boolean equals(@Nullable Object that) {
if (this == that) {
return true;
}