jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1381723 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/type/NodeTypeImpl.java
Date Thu, 06 Sep 2012 19:27:57 GMT
Author: mduerig
Date: Thu Sep  6 19:27:56 2012
New Revision: 1381723

URL: http://svn.apache.org/viewvc?rev=1381723&view=rev
Log:
OAK-66: JCR Node Type Management
type validation: check whether property can be removed when setting property value to null

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

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=1381723&r1=1381722&r2=1381723&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
Thu Sep  6 19:27:56 2012
@@ -265,6 +265,10 @@ class NodeTypeImpl implements NodeType {
 
     @Override
     public boolean canSetProperty(String propertyName, Value value) {
+        if (value == null) {
+            return canRemoveProperty(propertyName);
+        }
+
         for (PropertyDefinition definition : getPropertyDefinitions()) {
             String name = definition.getName();
             if ((propertyName.equals(name) && !isProtected(definition))
@@ -280,6 +284,10 @@ class NodeTypeImpl implements NodeType {
 
     @Override
     public boolean canSetProperty(String propertyName, Value[] values) {
+        if (values == null) {
+            return canRemoveProperty(propertyName);
+        }
+
         for (PropertyDefinition definition : getPropertyDefinitions()) {
             String name = definition.getName();
             if ((propertyName.equals(name) && !isProtected(definition))



Mime
View raw message