Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-53985] Add classloader awareness for ClassForNameSupport. #9893

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

graalvmbot
Copy link
Collaborator

Currently the Class.forName(...) in NI is implemented naively.

This prevents us from being able to support reflective class lookup for different classes with equal FQN name.
This PR modifies NI ClassForNameSupport to behave as close as possible to regular Java.

…lass#forName use in DefaultMBeanServerInterceptor#isInstanceOf
…REGISTRY entries on cleanup

When tests are run with c.o.s.enterprise.test.runner.UnitTests (svmtest)
all test classes are loaded by NativeImageClassLoader and that
loader instance is used throughout all the subsequent image builds that
happen as part of a UnitTests run. Entries into ResolvedDispatch#REGISTRY
are put there by static initializers of generated classes. Because of
the NativeImageClassLoader reuse for all image builds this only happens
once per such class and removing the entries on TruffleBaseFeature#cleanup
would make them unavailable in a subsequent tests that also rely on the
entries in ResolvedDispatch#REGISTRY.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants