Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 7ab801318180a1f289f99fa5ef24ec28f99528fe
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Sep 01 10:30:44 2021
Convert FragmentContainerView to Kotlin
Rewrite FragmentContainerView in Kotlin to ensure proper handling of
nullable classes in the getFragment function.
Test: ./gradlew checkApi
Bug: 189629145
RelNote: "The `FragmentContainerView` class has been rewritten in Kotlin
ensuring that the `getFragment` function will properly respect
nullability."
Change-Id: If694a3b70bf84f03c95d67d20e58485135ab7d86
M fragment/fragment/api/current.txt
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/build.gradle
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentContainerViewTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentContainerView.kt
https://android-review.googlesource.com/1816380
Branch: androidx-main
commit 7ab801318180a1f289f99fa5ef24ec28f99528fe
Author: Jeremy Woods <jbwoods@google.com>
Date: Wed Sep 01 10:30:44 2021
Convert FragmentContainerView to Kotlin
Rewrite FragmentContainerView in Kotlin to ensure proper handling of
nullable classes in the getFragment function.
Test: ./gradlew checkApi
Bug: 189629145
RelNote: "The `FragmentContainerView` class has been rewritten in Kotlin
ensuring that the `getFragment` function will properly respect
nullability."
Change-Id: If694a3b70bf84f03c95d67d20e58485135ab7d86
M fragment/fragment/api/current.txt
M fragment/fragment/api/public_plus_experimental_current.txt
M fragment/fragment/api/restricted_current.txt
M fragment/fragment/build.gradle
M fragment/fragment/src/androidTest/java/androidx/fragment/app/FragmentContainerViewTest.kt
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentContainerView.kt
jb...@google.com <jb...@google.com> #3
FragmentContainerView has been converted to Kotlin internally, and will be available in the Fragment 2.4.0-alpha09
release.
Description
Component used: Fragment
Version used: 1.4.0-alpha01
The method on
getFragment()
FragmentContainerView
is currently defined as:Where the nullability of the returned fragment is not based on whether the generic passed to it is nullable or not.
It is expected that passing a non-null generic would result in a non-null fragment:
And similarly, passing in a nullable generic would result in a nullable fragment:
I suspect that this might require that this method be written in Kotlin to actually respect the nullability in generics.