jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1467937 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java
Date Mon, 15 Apr 2013 11:20:46 GMT
Author: mreutegg
Date: Mon Apr 15 11:20:45 2013
New Revision: 1467937

URL: http://svn.apache.org/r1467937
Log:
OAK-675: Observation generates NPE in an existing EventListener
- Only log dummy implementation value for userId once

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java?rev=1467937&r1=1467936&r2=1467937&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java
Mon Apr 15 11:20:45 2013
@@ -50,6 +50,7 @@ class ChangeProcessor implements Runnabl
 
     private static final Logger log = LoggerFactory.getLogger(ChangeProcessor.class);
 
+    private static final String DUMMY_USER_ID = TODO.dummyImplementation().returnValueOrNull("oak:unknown");
     private final ObservationManagerImpl observationManager;
     private final NamePathMapper namePathMapper;
     private final ChangeExtractor changeExtractor;
@@ -243,8 +244,7 @@ class ChangeProcessor implements Runnabl
             String jcrPath = namePathMapper.getJcrPath(PathUtils.concat(parentPath, property.getName()));
 
             // TODO support userId, identifier, info, date
-            String userId = TODO.dummyImplementation().returnValueOrNull("oak:unknown");
-            return new EventImpl(eventType, jcrPath, userId, null, null, 0);
+            return new EventImpl(eventType, jcrPath, DUMMY_USER_ID, null, null, 0);
         }
 
         private Iterator<Event> generateNodeEvents(int eventType, String parentPath,
String name, NodeState node) {
@@ -256,8 +256,7 @@ class ChangeProcessor implements Runnabl
             Iterator<Event> nodeEvent;
             if (filter.include(eventType, jcrParentPath, associatedParentNode)) {
                 // TODO support userId, identifier, info, date
-                String userId = TODO.dummyImplementation().returnValueOrNull("oak:unknown");
-                Event event = new EventImpl(eventType, jcrPath, userId, null, null, 0);
+                Event event = new EventImpl(eventType, jcrPath, DUMMY_USER_ID, null, null,
0);
                 nodeEvent = Iterators.singletonIterator(event);
             } else {
                 nodeEvent = Iterators.emptyIterator();



Mime
View raw message