You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2013/05/23 08:12:46 UTC
svn commit: r1485588 -
/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java
Author: cziegeler
Date: Thu May 23 06:12:46 2013
New Revision: 1485588
URL: http://svn.apache.org/r1485588
Log:
SLING-2877 : Regression: changes off SLING-2775 fail to set jcr:lastModified property on existing nodes. Apply patch from Tobias Bocanegra
Modified:
sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java
Modified: sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java?rev=1485588&r1=1485587&r2=1485588&view=diff
==============================================================================
--- sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java (original)
+++ sling/trunk/bundles/servlets/post/src/main/java/org/apache/sling/servlets/post/impl/helper/SlingPropertyValueHandler.java Thu May 23 06:12:46 2013
@@ -105,14 +105,9 @@ public class SlingPropertyValueHandler {
}
}
}
- final NodeTypeIterator nti = nodeType.getSubtypes();
- while ( nti.hasNext() ) {
- final NodeType st = nti.nextNodeType();
- PropertyDefinition result = searchPropertyDefinition(st, name);
- if ( result != null ) {
- return result;
- }
- }
+ // SLING-2877:
+ // no need to search property definitions of super types, as nodeType.getPropertyDefinitions()
+ // already includes those. see javadoc of {@link NodeType#getPropertyDefinitions()}
return null;
}
@@ -168,7 +163,8 @@ public class SlingPropertyValueHandler {
if ( mod.node != null ) {
final PropertyDefinition pd = this.searchPropertyDefinition(mod.node, name);
if ( pd != null ) {
- if ( pd.isAutoCreated() || pd.isProtected() ) {
+ // SLING-2877 (autocreated check is only required for new nodes)
+ if ( (mod.node.isNew() && pd.isAutoCreated()) || pd.isProtected() ) {
return;
}
}