jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1384692 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java oak-jcr/pom.xml
Date Fri, 14 Sep 2012 09:14:33 GMT
Author: mduerig
Date: Fri Sep 14 09:14:33 2012
New Revision: 1384692

URL: http://svn.apache.org/viewvc?rev=1384692&view=rev
Log:
OAK-66: JCR Node Type Management
node type validation: double, boolean and long are not convertible to name

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java
    jackrabbit/oak/trunk/oak-jcr/pom.xml

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java?rev=1384692&r1=1384691&r2=1384692&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java
Fri Sep 14 09:14:33 2012
@@ -329,14 +329,20 @@ class NodeTypeImpl implements NodeType {
                 case PropertyType.BOOLEAN:
                     value.getBoolean();
                     return true;
-                case PropertyType.NAME:
-                    return JcrNameParser.validate(value.getString());
-                case PropertyType.PATH:
+                case PropertyType.NAME: {
                     int type = value.getType();
                     return type != PropertyType.DOUBLE &&
                            type != PropertyType.LONG &&
                            type != PropertyType.BOOLEAN &&
-                            JcrPathParser.validate(value.getString());
+                           JcrNameParser.validate(value.getString());
+                }
+                case PropertyType.PATH: {
+                    int type = value.getType();
+                    return type != PropertyType.DOUBLE &&
+                           type != PropertyType.LONG &&
+                           type != PropertyType.BOOLEAN &&
+                           JcrPathParser.validate(value.getString());
+                }
                 case PropertyType.REFERENCE:
                 case PropertyType.WEAKREFERENCE:
                     return IdentifierManager.isValidUUID(value.getString());
@@ -361,7 +367,7 @@ class NodeTypeImpl implements NodeType {
         }
     }
 
-    private boolean meetsTypeConstraints(Value[] values, int requiredType) {
+    private static boolean meetsTypeConstraints(Value[] values, int requiredType) {
         // Constraints must be met by all values
         for (Value value : values) {
             if (!meetsTypeConstraints(value, requiredType)) {

Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1384692&r1=1384691&r2=1384692&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Fri Sep 14 09:14:33 2012
@@ -63,12 +63,10 @@ org.apache.jackrabbit.test.api.Workspace
 org.apache.jackrabbit.test.api.SessionRemoveItemTest#testRemoveLockedNode
 org.apache.jackrabbit.test.api.SessionRemoveItemTest#testRemoveLockedChildItem
 org.apache.jackrabbit.test.api.SessionRemoveItemTest#testRemoveCheckedInItem
-org.apache.jackrabbit.test.api.nodetype.CanSetPropertyDoubleTest#testConversions        
 <!-- OAK-66 -->
-org.apache.jackrabbit.test.api.nodetype.CanSetPropertyDoubleTest#testConversionsMultiple
 <!-- OAK-66 -->
-org.apache.jackrabbit.test.api.nodetype.CanSetPropertyLongTest#testConversions          
 <!-- OAK-66 -->
-org.apache.jackrabbit.test.api.nodetype.CanSetPropertyLongTest#testConversionsMultiple  
 <!-- OAK-66 -->
-org.apache.jackrabbit.test.api.nodetype.CanSetPropertyNameTest#testConversions          
 <!-- OAK-66 -->
-org.apache.jackrabbit.test.api.nodetype.CanSetPropertyNameTest#testConversionsMultiple  
 <!-- OAK-66 -->
+org.apache.jackrabbit.test.api.nodetype.CanSetPropertyDoubleTest#testConversions        
 <!-- OAK-302 -->
+org.apache.jackrabbit.test.api.nodetype.CanSetPropertyDoubleTest#testConversionsMultiple
 <!-- OAK-302 -->
+org.apache.jackrabbit.test.api.nodetype.CanSetPropertyLongTest#testConversions          
 <!-- OAK-302 -->
+org.apache.jackrabbit.test.api.nodetype.CanSetPropertyLongTest#testConversionsMultiple  
 <!-- OAK-302 -->
 org.apache.jackrabbit.test.api.nodetype.NodeTypeCreationTest#testNewNodeTypeTemplate    
 <!-- OAK-66 -->
 org.apache.jackrabbit.test.api.nodetype.NodeTypeCreationTest#testPropertyDefinitionTemplate
      <!-- OAK-66 -->
 org.apache.jackrabbit.test.api.nodetype.NodeTypeCreationTest#testNodeDefinitionTemplate 
 <!-- OAK-66 -->
@@ -207,7 +205,7 @@ org.apache.jackrabbit.test.api.lock.Sess
 org.apache.jackrabbit.test.api.lock.SessionScopedLockTest#testGetLockOnChild
 org.apache.jackrabbit.test.api.lock.SessionScopedLockTest#testGetLockOnNewChild
 org.apache.jackrabbit.test.api.lock.SessionScopedLockTest#testRemoveMixLockableFromLockedNode
-org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsMandatory
+org.apache.jackrabbit.test.api.nodetype.PropertyDefTest#testIsMandatory  <!-- OAK-66 -->
 org.apache.jackrabbit.test.api.LifecycleTest
 org.apache.jackrabbit.test.api.query.ElementTest#testElementTestNameTestSomeNTWithSNS<!--
OAK-203 -->
 org.apache.jackrabbit.test.api.query.GetPropertyNamesTest#testGetPropertyNames



Mime
View raw message