Hi! While checking the changes for SLING-12420 I have noticed that in certain cases JspScriptEngineFactory may not renew JspRuntimeContext.
First, with the improvement the context is only renewed if the path in the context is actually matches or an ancestor path of "/org/apache/jsp". However, if the path is a subpath, or an actual path to jsp or class (e.g. /libs/Page/Page__002e_.jsp), then the context is not renewed. I am not sure if it's expected to have calls on the onClassLoaderClear method with such paths that are not initiated from the JSP scripting engine. The other problem is about an older change: how FSClassLoaderProvider handles ServicesReferences of ClassLoaderWriterListener. In its activate method it creates a ServiceListener for ClassLoaderWriterListener. Which will correctly handle service events, but only after the activation of FSClassLoaderProvider. Which has bundle service scope. So in case a service of ClassLoaderWriterListener is already registered before the activate method of FSClassLoaderProvider is called, then it won't be stored in the classLoaderWriterListeners map. Hence it will also not be called when FSClassLoaderProvider's delete method is executed. So I think after creating the listener the service should also obtain the existing ServiceReferences. What do you think? Should these be addressed? Also one more thing: for these ServiceReferences callerBundle.getBundleContext().ungetService() is never called. Kind Regards, Bence Barna
