royteeuwen opened a new pull request, #205: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/205
When OSGi fires the @Modified lifecycle callback (e.g. triggered by a bundle deployment causing a configuration change), modified() delegates to deactivateInternal() which calls resourceDecoratorTracker.close(), clearing all registered ResourceDecorator services. Because the decorators use ReferencePolicy.DYNAMIC, OSGi does not re-fire bindResourceDecorator after a @Modified event (no component restart). The tracker is therefore left permanently empty, silently breaking any feature that relies on ResourceDecorator (e.g. path-rewriting decorators). Fix: introduce deactivateInternalWithoutClearingDecorators() which performs the same teardown as deactivateInternal() but omits the tracker.close() call. @Modified now delegates to this new helper. @Deactivate continues to use the full deactivateInternal() where a complete teardown is correct. Also add a null-guard in ResourceDecoratorEntry.compareTo() to prevent NPE when ServiceReference is null. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
