Open
Conversation
Contributor
Author
|
These are the names of classes loaded by the Android systemclassloader. Printed via These are the names of classes loaded by the JVM systemclassloader. Printed via As you can see, Android's SystemClassLoader only loads Java or Android classes, while the JVM's SystemClassLoader not only loads Java classes but also loads classes from the classpath. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The original ChildFirstURLClassLoader did not work as expected. It first loads classes using the SystemClassLoader. Unlike Android's system ClassLoader, which only loads core classes (java., android.), the JVM's one also loads classes from the CLASSPATH, meaning if a class exists both in the extension and the host, it will be loaded by the host's class loader. (NOT child-first)
The new implementation is based on Flink’s ChildFirstClassLoader, which adopts an allowlist approach. Core JRE classes are loaded by the parent class loader first(like Android's SystemClassLoader), then the child class loader attempts to load them. If the child fails to load a class, it falls back to the parent, effectively achieving child-first class loading.