jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1171560 - in /jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name: CurrentPath.java NamePath.java ParentPath.java RelativePath.java
Date Fri, 16 Sep 2011 13:48:49 GMT
Author: mduerig
Date: Fri Sep 16 13:48:49 2011
New Revision: 1171560

URL: http://svn.apache.org/viewvc?rev=1171560&view=rev
Log:
Microkernel based Jackrabbit prototype (WIP) 
avoid virtual dispatch in constructor  

Modified:
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java
    jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java?rev=1171560&r1=1171559&r2=1171560&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/CurrentPath.java
Fri Sep 16 13:48:49 2011
@@ -37,12 +37,7 @@ final class CurrentPath extends Relative
         NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, ".");
 
     public CurrentPath(Path parent) {
-        super(parent);
-    }
-
-    @Override
-    protected int getDepthModifier() {
-        return 0;
+        super(parent, 0);
     }
 
     @Override

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java?rev=1171560&r1=1171559&r2=1171560&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/NamePath.java
Fri Sep 16 13:48:49 2011
@@ -38,7 +38,7 @@ class NamePath extends RelativePath {
     }
 
     protected NamePath(Path parent, Name name) {
-        super(parent);
+        super(parent, 1);
         if (name == null) {
             throw new IllegalArgumentException("Name must not be null");
         }
@@ -47,11 +47,6 @@ class NamePath extends RelativePath {
     }
 
     @Override
-    protected int getDepthModifier() {
-        return 1;
-    }
-
-    @Override
     protected Path getParent() {
         if (parent != null) {
             return parent;

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java?rev=1171560&r1=1171559&r2=1171560&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/ParentPath.java
Fri Sep 16 13:48:49 2011
@@ -37,12 +37,7 @@ final class ParentPath extends RelativeP
         NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, "..");
 
     public ParentPath(Path parent) {
-        super(parent);
-    }
-
-    @Override
-    protected int getDepthModifier() {
-        return -1;
+        super(parent, -1);
     }
 
     @Override

Modified: jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java?rev=1171560&r1=1171559&r2=1171560&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java
(original)
+++ jackrabbit/sandbox/jackrabbit-mk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/name/RelativePath.java
Fri Sep 16 13:48:49 2011
@@ -37,23 +37,21 @@ abstract class RelativePath extends Abst
 
     private final int length;
 
-    protected RelativePath(Path parent) {
+    protected RelativePath(Path parent, int depthModifier) {
         this.parent = parent;
         if (parent != null) {
             absolute = parent.isAbsolute();
             identifier = parent.isIdentifierBased();
-            depth = parent.getDepth() + getDepthModifier();
+            depth = parent.getDepth() + depthModifier;
             length = parent.getLength() + 1;
         } else {
             absolute = false;
             identifier = false;
-            depth = getDepthModifier();
+            depth = depthModifier;
             length = 1;
         }
     }
 
-    protected abstract int getDepthModifier();
-
     protected abstract Path getParent() throws RepositoryException;
 
     protected abstract String getElementString();



Mime
View raw message