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

ServerLoader.lookupProviderClasses throw NPE #18

Open
russgold opened this issue Aug 17, 2020 · 1 comment
Open

ServerLoader.lookupProviderClasses throw NPE #18

russgold opened this issue Aug 17, 2020 · 1 comment

Comments

@russgold
Copy link

The ServiceLoader.lookupProviderClasses method dereferences the field _me without first ensuring that it is null. This frequently results in a NullPointerException. It is caught, so the functionality works, but it complicates debugging NPEs expected in other code. The lookupProviderInstances right above it does check for null. It would very nice if this method did so as well.

@minfrin
Copy link

minfrin commented Nov 28, 2023

Also found this here:

Cannot invoke "org.glassfish.hk2.osgiresourcelocator.ServiceLoader.lookupProviderClasses1(java.lang.Class)" because "org.glassfish.hk2.osgiresourcelocator.ServiceLoader._me" is null

It appears possible to reach this line without running initialize, or after running reset:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants