joerghoh commented on code in PR #26:
URL:
https://github.com/apache/sling-org-apache-sling-i18n/pull/26#discussion_r4325625559
##########
src/main/java/org/apache/sling/i18n/impl/JcrResourceBundleProvider.java:
##########
@@ -277,55 +285,57 @@ private void onChange(final ChangeStatus status, final
ResourceChange change) th
}
}
- // may be a completely new dictionary
if (status.resourceResolver == null) {
status.resourceResolver = createResourceResolver();
}
- if (isDictionaryResource(status.resourceResolver, change)) {
+ final Resource resource =
status.resourceResolver.getResource(change.getPath());
+ if (resource == null) {
+ log.trace("Could not get resource for '{}' for event {}",
change.getPath(), change.getType());
+ return;
+ }
Review Comment:
This already happens above, where the path of every change is compared (as
String) against the languageRootPaths, and if it's part of one of them, it is
marked for reload.
That means, that any REMOVED event never needs to get here, it could return
before it. But we should have the check nevertheless, as we could have a these
change events:
1. /apps/i18n/de/foo: CHANGED
2. /apps/i18n/de/foo: REMOVED
and these resources are at the time of the proceessing already gone.
--
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]