[go: nahoru, domu]

Enables UnknownNullness lint check

Adds all existing UnknownNullness warnings to lint-baseline.xml

Using the flag -PcheckUnknownNullness checks only UnknownNullness errors
without using the baseline, so it is easy to see what the errors are.

Also enables UnknownNullness and other kotlin interop inspections in
Studio, to make it easier to notice and fix these.

Bug: b/132358934
Test: ./gradlew lintDebug
Change-Id: I7e6ea1a2e3a1b32b9de02b037e06ce8515ff1ad0
diff --git a/lifecycle/lifecycle-common/lint-baseline.xml b/lifecycle/lifecycle-common/lint-baseline.xml
index fb333f3..f2fba58 100644
--- a/lifecycle/lifecycle-common/lint-baseline.xml
+++ b/lifecycle/lifecycle-common/lint-baseline.xml
@@ -1,20 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Copyright 2019 The Android Open Source Project
-
-  Licensed under the Apache License, Version 2.0 (the "License");
-  you may not use this file except in compliance with the License.
-  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
-  -->
-
 <issues format="5" by="lint 3.5.0-beta04" client="gradle" version="3.5.0-beta04">
 
     <issue
@@ -39,4 +23,70 @@
             column="57"/>
     </issue>
 
+    <issue
+        id="UnknownNullness"
+        message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
+        errorLine1="    void callMethods(LifecycleOwner source, Lifecycle.Event event, boolean onAny,"
+        errorLine2="                     ~~~~~~~~~~~~~~">
+        <location
+            file="src/main/java/androidx/lifecycle/GeneratedAdapter.java"
+            line="36"
+            column="22"/>
+    </issue>
+
+    <issue
+        id="UnknownNullness"
+        message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
+        errorLine1="    void callMethods(LifecycleOwner source, Lifecycle.Event event, boolean onAny,"
+        errorLine2="                                            ~~~~~~~~~~~~~~~">
+        <location
+            file="src/main/java/androidx/lifecycle/GeneratedAdapter.java"
+            line="36"
+            column="45"/>
+    </issue>
+
+    <issue
+        id="UnknownNullness"
+        message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
+        errorLine1="            MethodCallsLogger logger);"
+        errorLine2="            ~~~~~~~~~~~~~~~~~">
+        <location
+            file="src/main/java/androidx/lifecycle/GeneratedAdapter.java"
+            line="37"
+            column="13"/>
+    </issue>
+
+    <issue
+        id="UnknownNullness"
+        message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
+        errorLine1="    public static String getAdapterName(String className) {"
+        errorLine2="                  ~~~~~~">
+        <location
+            file="src/main/java/androidx/lifecycle/Lifecycling.java"
+            line="205"
+            column="19"/>
+    </issue>
+
+    <issue
+        id="UnknownNullness"
+        message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
+        errorLine1="    public static String getAdapterName(String className) {"
+        errorLine2="                                        ~~~~~~">
+        <location
+            file="src/main/java/androidx/lifecycle/Lifecycling.java"
+            line="205"
+            column="41"/>
+    </issue>
+
+    <issue
+        id="UnknownNullness"
+        message="Unknown nullability; explicitly declare as `@Nullable` or `@NonNull` to improve Kotlin interoperability; see https://android.github.io/kotlin-guides/interop.html#nullability-annotations"
+        errorLine1="    public boolean approveCall(String name, int type) {"
+        errorLine2="                               ~~~~~~">
+        <location
+            file="src/main/java/androidx/lifecycle/MethodCallsLogger.java"
+            line="35"
+            column="32"/>
+    </issue>
+
 </issues>