Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 82941c128d8ef57e36a739fcfacdf006e94d1a4a
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Thu Oct 15 17:31:58 2020
[GH] Don't cache fragment classes across different class loaders
## Proposed Changes
- Don't cache fragment classes across different class loaders inside `FragmentFactory`.
## Testing
Test: Added tests to verify the change
## Issues Fixed
Fixes: 113886460
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/87 .
Resolves #87
Github-Pr-Head-Sha: e5f5916840904cab91884e3f525fde4a71d5a7dc
GitOrigin-RevId: babb5e1aedec7d815aa38a50ebca89d6c3e93f00
Change-Id: I07d5541a45ccadcf7159854818000455e245d118
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentFactory.java
A fragment/fragment/src/test/java/androidx/fragment/app/FragmentFactoryTest.kt
https://android-review.googlesource.com/1462523
Branch: androidx-master-dev
commit 82941c128d8ef57e36a739fcfacdf006e94d1a4a
Author: Simon Schiller <simonschiller@users.noreply.github.com>
Date: Thu Oct 15 17:31:58 2020
[GH] Don't cache fragment classes across different class loaders
## Proposed Changes
- Don't cache fragment classes across different class loaders inside `FragmentFactory`.
## Testing
Test: Added tests to verify the change
## Issues Fixed
Fixes: 113886460
This is an imported pull request from
Resolves #87
Github-Pr-Head-Sha: e5f5916840904cab91884e3f525fde4a71d5a7dc
GitOrigin-RevId: babb5e1aedec7d815aa38a50ebca89d6c3e93f00
Change-Id: I07d5541a45ccadcf7159854818000455e245d118
M fragment/fragment/src/main/java/androidx/fragment/app/FragmentFactory.java
A fragment/fragment/src/test/java/androidx/fragment/app/FragmentFactoryTest.kt
Description
Version used: 1.0.0-rc02
Fragment.instantiate() caches the parsed Class instances, but keeps all Class instances in a single map. This means that if you have two separate ClassLoaders, the Class instance from the first ClassLoader might be returned when it should actually call loadClass from the second ClassLoader.