jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1132967 - /jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Date Tue, 07 Jun 2011 12:10:35 GMT
Author: mduerig
Date: Tue Jun  7 12:10:35 2011
New Revision: 1132967

URL: http://svn.apache.org/viewvc?rev=1132967&view=rev
Log:
spi2microkernel prototype (WIP)
fix npe for non existing items

Modified:
    jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java

Modified: jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java?rev=1132967&r1=1132966&r2=1132967&view=diff
==============================================================================
--- jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
(original)
+++ jackrabbit/sandbox/spi2microkernel/src/main/java/org/apache/jackrabbit/spi2microkernel/RepositoryServiceImpl.java
Tue Jun  7 12:10:35 2011
@@ -204,13 +204,18 @@ public class RepositoryServiceImpl exten
             String mkPath = Paths.translateQPath(wspName, path);
             String rev = getRevision(sessionInfo);
 
+            NodeInfo info = null;
             if (microKernel.nodeExists(mkPath, rev)) {
                 String json = microKernel.getNodes(mkPath, 1, rev);
-                return Json.buildNodeInfo(path, json);
+                info = Json.buildNodeInfo(path, json);
             }
-            else {
+
+            if (info == null) {
                 throw new PathNotFoundException(path.toString());
             }
+            else {
+                return info;
+            }
         }
         catch (MicroKernelException e) {
             // todo throw correct exceptions
@@ -225,13 +230,18 @@ public class RepositoryServiceImpl exten
             String mkPath = Paths.translateQPath(wspName, path.getAncestor(1));
             String rev = getRevision(sessionInfo);
 
+            PropertyInfo info = null;
             if (microKernel.nodeExists(mkPath, rev)) {
                 String json = microKernel.getNodes(mkPath, 0, rev);
-                return Json.buildPropertyInfo(path, json);
+                info = Json.buildPropertyInfo(path, json);
             }
-            else {
+
+            if (info == null) {
                 throw new PathNotFoundException(path.toString());
             }
+            else {
+                return info;
+            }
         }
         catch (MicroKernelException e) {
             // todo throw correct exceptions



Mime
View raw message