Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 66bd9aadddc4437c04cb5be280e05c22a770a308
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Jun 01 21:21:03 2020
Fix NonNullableMutableLiveData lint check
The lint check currently only accounts for local variables and either
throws an error or ignores fields completely.
This change makes the Detector consider fields as well.
We should move this entire check to using the DataFlowAnalyzer in the
future.
Test: added test
Bug: 156002218
Bug: 157294666
Change-Id: I60b746df521c1817553cd1667f50ebe717f1b711
M lifecycle/lifecycle-livedata-core-ktx-lint/build.gradle
M lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetector.kt
M lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetectorTest.kt
https://android-review.googlesource.com/1322059
Branch: androidx-master-dev
commit 66bd9aadddc4437c04cb5be280e05c22a770a308
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Jun 01 21:21:03 2020
Fix NonNullableMutableLiveData lint check
The lint check currently only accounts for local variables and either
throws an error or ignores fields completely.
This change makes the Detector consider fields as well.
We should move this entire check to using the DataFlowAnalyzer in the
future.
Test: added test
Bug: 156002218
Bug: 157294666
Change-Id: I60b746df521c1817553cd1667f50ebe717f1b711
M lifecycle/lifecycle-livedata-core-ktx-lint/build.gradle
M lifecycle/lifecycle-livedata-core-ktx-lint/src/main/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetector.kt
M lifecycle/lifecycle-livedata-core-ktx-lint/src/test/java/androidx/lifecycle/lint/NonNullableMutableLiveDataDetectorTest.kt
il...@google.com <il...@google.com> #3
This has been fixed internally and the updated Lint check will be available in Lifecycle 2.3.0-alpha04.
Description
Component used: lifecycle-livedata-core-ktx Version used: 2.3.0-alpha03
Currently, it appears like the
MutableLiveData
check for nullability works only on local variables. It should be expanded to cover more cases such as: