ecolombo commented on code in PR #15:
URL:
https://github.com/apache/sling-org-apache-sling-i18n/pull/15#discussion_r1716445198
##########
src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java:
##########
@@ -791,4 +733,102 @@ public String toString() {
return "Key(" + baseName + ", " + locale + ")";
}
}
+
+ /**
+ * Registry of the loaded <code>resource bundles</code> and the associated
<code>service registrations</code>
+ * The <code>ResourceBundleRegistry</code> takes care of the
registration/deregistration of the resource bundles as OSGi services.
+ * It stores the references to the registered resource bundles and to the
associated service registrations.
+ */
+ private static class ResourceBundleRegistry {
Review Comment:
Thanks for the suggestion! I hesitate: in this particular case there will
never be a try-with use case since the usage of ResourceBundleRegistry always
extends over the length of a method (instantiate in "activate", close in
"deactivate" method).
But if you feel it would clarify that the registry must be closed at some
time, I am happy to implement AutoCloseable. (Closeable throws IOException so
it doesn't seem adequate). What do you think?
--
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]