You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by jo...@apache.org on 2025/09/15 12:11:40 UTC
(sling-org-apache-sling-jcr-resource) branch SLING-12940 created (now 2e625fe)
This is an automated email from the ASF dual-hosted git repository.
joerghoh pushed a change to branch SLING-12940
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-resource.git
at 2e625fe SLING-12940 read userData only for local events
This branch includes the following new commits:
new 2e625fe SLING-12940 read userData only for local events
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(sling-org-apache-sling-jcr-resource) 01/01: SLING-12940 read userData only for local events
Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
joerghoh pushed a commit to branch SLING-12940
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-resource.git
commit 2e625fe50d0e69fe22461970bf264ffae5e772c3
Author: Joerg Hoh <jo...@apache.org>
AuthorDate: Mon Sep 15 14:11:28 2025 +0200
SLING-12940 read userData only for local events
---
.../jcr/resource/internal/JcrResourceListener.java | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java b/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
index 66c4357..2c01d94 100644
--- a/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
+++ b/src/main/java/org/apache/sling/jcr/resource/internal/JcrResourceListener.java
@@ -163,17 +163,17 @@ public class JcrResourceListener implements EventListener, Closeable {
final String path,
final ChangeType changeType) {
final boolean isExternal = isExternal(event);
- final String userId;
+ String userId = null;
+ String userData = null;
if (!isExternal) {
+ // In Jackrabbit Oak userId and userData are not available if the event
+ // is external
userId = event.getUserID();
- } else {
- userId = null;
- }
- String userData = null;
- try {
- userData = event.getUserData();
- } catch (RepositoryException e) {
- logger.debug("Could not access user data from event " + event, e);
+ try {
+ userData = event.getUserData();
+ } catch (RepositoryException e) {
+ logger.debug("Could not access user data from event " + event, e);
+ }
}
return new JcrResourceChange(changeType, path, isExternal, userId, userData);
}