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

Classloading: CachingProvider.getDefaultClassloader #353

Open
cruftex opened this issue May 19, 2016 · 2 comments
Open

Classloading: CachingProvider.getDefaultClassloader #353

cruftex opened this issue May 19, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@cruftex
Copy link
Member

cruftex commented May 19, 2016

Most implementations I analyzed, including the RI, use the following as default classloader:

public ClassLoader getDefaultClassLoader() {
   return getClass().getClassLoader();
}

Alternatives, I can think of, which are legal at the moment as well:

  • Bootstrap classloader
  • Thread.currentThread().getContextClassLoader()
  • keyClass.getClassloader()

Possibly will an implementation pass the TCK tests which decides for the TCCL as default. We should be more strict here, so users know precisely when to set the custom class loader.

The basic goal is that implementations should behave consistent.

@cruftex cruftex added the EE label May 19, 2016
@cruftex cruftex added this to the 1.1 milestone Jun 7, 2016
@cruftex cruftex self-assigned this Jun 7, 2016
@cruftex
Copy link
Member Author

cruftex commented Jun 7, 2016

At the moment I think the best way is to make the RI default mandatory.

@jerrinot
Copy link

Is TCCL a good option for a default classloader? The spec currently says:

Obtains the default ClassLoader that will be used by the CachingProvider

This is hard to guarantee with TCCL - it depends on context (by its very definition)

@gregrluck gregrluck modified the milestones: 2.0, 1.1 Oct 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants