jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1417357 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: plugins/nodetype/NodeTypeImpl.java util/NodeUtil.java
Date Wed, 05 Dec 2012 11:12:00 GMT
Author: angela
Date: Wed Dec  5 11:12:00 2012
New Revision: 1417357

URL: http://svn.apache.org/viewvc?rev=1417357&view=rev
Log:
OAK-491 : NodeType#isNodeType: wrong comparison of jcr names

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeImpl.java?rev=1417357&r1=1417356&r2=1417357&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeImpl.java
Wed Dec  5 11:12:00 2012
@@ -27,7 +27,6 @@ import java.util.LinkedList;
 import java.util.List;
 import java.util.Queue;
 import java.util.Set;
-
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
@@ -225,7 +224,8 @@ class NodeTypeImpl implements NodeType {
 
     @Override
     public boolean isNodeType(String nodeTypeName) {
-        if (nodeTypeName.equals(getName())) {
+        String oakName = node.getNameMapper().getOakName(nodeTypeName);
+        if (getOakName().equals(oakName)) {
             return true;
         }
 
@@ -306,6 +306,10 @@ class NodeTypeImpl implements NodeType {
         return getName();
     }
 
+    private String getOakName() {
+        return node.getTree().getName();
+    }
+
     private static boolean meetsTypeConstraints(Value value, int requiredType) {
         try {
             switch (requiredType) {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java?rev=1417357&r1=1417356&r2=1417357&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/util/NodeUtil.java
Wed Dec  5 11:12:00 2012
@@ -72,6 +72,11 @@ public class NodeUtil {
     }
 
     @Nonnull
+    public NameMapper getNameMapper() {
+        return mapper;
+    }
+
+    @Nonnull
     public Tree getTree() {
         return tree;
     }



Mime
View raw message