diff options
author | Paul Duffin <paulduffin@google.com> | 2023-10-17 15:34:39 +0100 |
---|---|---|
committer | Jihoon Kang <jihoonkang@google.com> | 2023-10-20 06:17:43 +0000 |
commit | 03894d1f720fdec16035aa4827f9b88d7e46f23c (patch) | |
tree | c5ac74d0a2323fc2eeccc4ba364ec0f27c735399 | |
parent | 31d82635bc3c5556b30827eb4274ea2debb85aa6 (diff) | |
download | error_prone-03894d1f720fdec16035aa4827f9b88d7e46f23c.tar.gz |
Disable overtriggered lint check for from-text stub buildandroid-u-rb-dp-10-gplandroid-u-rb-dp-10-gpl
ObjectToString lint check is triggered when a final class does not
override Object.ToString(). Per Android API Guidelines, this is an
encouraged behavior but not required. Also, since the stubs generated
from signature files do not include overriding methods with identical
signatures to its parent method(s), majority of the toString() method
will not be included in the stubs, triggering this lint warning.
Therefore, this change disables the ObjectToString error prone check.
Test: m droid
Bug: 306242755
Change-Id: Iaf4a7f62f33e5cc3fb024e346d95ad3a0ee81e08
-rw-r--r-- | soong/error_prone.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/soong/error_prone.go b/soong/error_prone.go index 8e93578..24179ba 100644 --- a/soong/error_prone.go +++ b/soong/error_prone.go @@ -178,8 +178,7 @@ func init() { } // The checks that are default-disabled - config.ErrorProneChecksDefaultDisabled = []string{ - } + config.ErrorProneChecksDefaultDisabled = []string{} config.ErrorProneChecksOff = []string{ // We are not interested in Guava recommendations @@ -204,6 +203,10 @@ func init() { "-Xep:SameNameButDifferent:OFF", // Noisy and requires projects to add a dependency on errorprone annotations "-Xep:CanIgnoreReturnValueSuggester:OFF", + // Data classes are encouraged to override toString(), but it is not a strict + // requirement. The warning is overtriggered when source depends on the API stubs, which + // may not include the toString() method. + "-Xep:ObjectToString:OFF", } config.ErrorProneFlags = []string{ |