Fixed
Status Update
Comments
am...@gmail.com <am...@gmail.com> #2
./gradlew :app:lintDebug --no-daemon
is used for running lint. But Android Studio also doesn't show any error on expected lines.
bo...@google.com <bo...@google.com> #3
I opened a PR to improve NonNullableMutableLiveDataDetector's type references check.
https://github.com/androidx/androidx/pull/161
d4...@gmail.com <d4...@gmail.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
Description
Path:
/extSdCard/_documentTest
Uri:
content://com.android.externalstorage.documents/tree/0000-0000%3A/document/0000-0000%3A_documentTest
SingleDocumentFile doesn't support any write features, so we are left with TreeDocumentFile which is created with:
public static DocumentFile fromTreeUri(Context context, Uri treeUri) {
final int version = Build.VERSION.SDK_INT;
if (version >= 21) {
return new TreeDocumentFile(null, context,
DocumentsContractApi21.prepareTreeUri(treeUri));
} else {
return null;
}
}
However DocumentsContractApi21.prepareTreeUri(treeUri) truncates the document id returning a DocumentFile pointing to:
content://com.android.externalstorage.documents/tree/0000-0000%3A/document/0000-0000%3A
This is NOT the same URI! It simply truncated this URI down to the tree root...
I cannot see a workaround without reflection into TreeDocumentFile.