royteeuwen opened a new pull request, #206: URL: https://github.com/apache/sling-org-apache-sling-resourceresolver/pull/206
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: move resourceDecoratorTracker.close() out of deactivateInternal() and into deactivate() only. deactivateInternal() is still called from both @Modified and @Deactivate, but only the true component teardown path (@Deactivate) now closes the tracker. 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]
