diff options
author | Aurimas Liutikas <aurimas@google.com> | 2020-07-27 18:47:45 -0700 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2021-05-13 20:48:26 +0800 |
commit | 5f1d9529ee8afb1c0e166460691b16dec3216ac2 (patch) | |
tree | 0f571ac10d9f331286cae4f6bdc5bbe9311fa57c | |
parent | 21659a2683eed66e16aeafeb8d9c40916946a51b (diff) |
[master] Check isInteresting for methods and fields in ApiLintHEADlineage-18.1
The issue happens because we are running API lint when comparing
between new and old APIs surface which means that visitClass for
BigInteger does not get called (not a new class), but visitMethod
for byteValueExact does trigger. ApiLint skip check used to only
be called for ClassItem, which works for most cases, except for
new methods/fields in an old class.
Bug: 162035124
Test: New test added
Change-Id: Ia1be825fd9d51bdbb11b8d3f00edef44ddee8b59
-rw-r--r-- | src/main/java/com/android/tools/metalava/ApiLint.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/com/android/tools/metalava/ApiLint.kt b/src/main/java/com/android/tools/metalava/ApiLint.kt index 61b84cb..d438b59 100644 --- a/src/main/java/com/android/tools/metalava/ApiLint.kt +++ b/src/main/java/com/android/tools/metalava/ApiLint.kt @@ -234,7 +234,10 @@ class ApiLint(private val codebase: Codebase, private val oldCodebase: Codebase? } override fun skip(item: Item): Boolean { - return super.skip(item) || item is ClassItem && !isInteresting(item) + return super.skip(item) || + item is ClassItem && !isInteresting(item) || + item is MethodItem && !isInteresting(item.containingClass()) || + item is FieldItem && !isInteresting(item.containingClass()) } // The previous Kotlin interop tests are also part of API lint now (though they can be |