Yeah, not a big fan of us caching the ServiceLoaders. I tried to get rid of this but we have a test failing: org.hibernate.test.service.ClassLoaderServiceImplTest#testStoppableClassLoaderService(). Obviously, if you get rid of the cache, when you load twice the services, you end up with different services. IMHO, there are two options:
- we cache the services themselves, not the service loaders - I'm not a big fan of keeping a reference to all the services around;
- we get rid of the cache, in this case, we would have to check that we don't rely on the current behavior of being able to call load several times while getting the same services.
Steve Ebersole any idea if this is still a strong requirement? |