Fixed
Status Update
Comments
se...@google.com <se...@google.com>
[Deleted User] <[Deleted User]> #2
./gradlew :app:lintDebug --no-daemon
is used for running lint. But Android Studio also doesn't show any error on expected lines.
ko...@gmail.com <ko...@gmail.com> #3
I opened a PR to improve NonNullableMutableLiveDataDetector's type references check.
https://github.com/androidx/androidx/pull/161
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 655e08dca6e27aa15c862132914cb61b0ec29fdf
Author: Sinan Kozak <kozaxinan@gmail.com>
Date: Wed May 05 16:38:12 2021
[GH] [Lifecycle] [Lint] fixes b/184830263 Lint should use check reference too
## Proposed Changes
- Fix NonNullableMutableLiveDataDetector for [different cases](https://issuetracker.google.com/issues/184830263 ). It is possible to only set type reference and omit call's generic argument.
- Added check for generic values because default upper bound of generic (if none specified) is Any?. If generic is not specified as `<T : Any>`, `T` can be defined null at call site.https://kotlinlang.org/docs/generics.html#upper-bounds
## Testing
Test: Run NonNullableMutableLiveDataDetectorTest with new edge cases.
`nullLiteralFailMultipleFields` : Added type reference
`justKotlinObject` : Add additional test to prevent ArrayIndexOutOfBoundsException. It is fixed inhttps://github.com/androidx/androidx/commit/428f0ec685ff80035c0511c0cdb12b9770b6159c but not tested. It is reported here with [ b/184830262 ](https://issuetracker.google.com/issues/184830262 )
`genericParameterDefinition` : Generics are assumed as nullable, lint should ignore.
## Issues Fixed
Fixes: The bug on [ b/184830263 ](https://issuetracker.google.com/issues/184830263 ) being fixed
Fixes: Tests [ b/184830262 ](https://issuetracker.google.com/issues/184830263 )
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/161 .
Resolves #161
Github-Pr-Head-Sha: e96b4a8e860002feccd455e9ad8dcdd868dff2df
GitOrigin-RevId: eb21c2ef19da5465be438c928d9b6ba2498b72e8
Change-Id: Id6cd01e9ec6b79a3f14b569b53d79627c79b9866
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/1697465
Branch: androidx-main
commit 655e08dca6e27aa15c862132914cb61b0ec29fdf
Author: Sinan Kozak <kozaxinan@gmail.com>
Date: Wed May 05 16:38:12 2021
[GH] [Lifecycle] [Lint] fixes
## Proposed Changes
- Fix NonNullableMutableLiveDataDetector for [different cases](
- Added check for generic values because default upper bound of generic (if none specified) is Any?. If generic is not specified as `<T : Any>`, `T` can be defined null at call site.
## Testing
Test: Run NonNullableMutableLiveDataDetectorTest with new edge cases.
`nullLiteralFailMultipleFields` : Added type reference
`justKotlinObject` : Add additional test to prevent ArrayIndexOutOfBoundsException. It is fixed in
`genericParameterDefinition` : Generics are assumed as nullable, lint should ignore.
## Issues Fixed
Fixes: The bug on [
Fixes: Tests [
This is an imported pull request from
Resolves #161
Github-Pr-Head-Sha: e96b4a8e860002feccd455e9ad8dcdd868dff2df
GitOrigin-RevId: eb21c2ef19da5465be438c928d9b6ba2498b72e8
Change-Id: Id6cd01e9ec6b79a3f14b569b53d79627c79b9866
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
pa...@gmail.com <pa...@gmail.com> #5
??
Description
Component used: lifecycle lint Version used: 2.3.1 Devices/Android versions reproduced on:
If I remove <String> from initialization, lint doesn't fail. This is not an error.
If I remove private modifier, lint doesn't fail. This is not an error.