incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1465411 - /sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
Date Sun, 07 Apr 2013 15:18:58 GMT
Author: cziegeler
Date: Sun Apr  7 15:18:58 2013
New Revision: 1465411

URL: http://svn.apache.org/r1465411
Log:
SLING-2814 :  JcrResourceProvider should ignore auto properties when creating a resource 

Modified:
    sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java

Modified: sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java?rev=1465411&r1=1465410&r2=1465411&view=diff
==============================================================================
--- sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
(original)
+++ sling/trunk/bundles/jcr/resource/src/main/java/org/apache/sling/jcr/resource/internal/helper/jcr/JcrResourceProvider.java
Sun Apr  7 15:18:58 2013
@@ -83,6 +83,14 @@ public class JcrResourceProvider
     @SuppressWarnings("deprecation")
     private static final String DEFAULT_QUERY_LANGUAGE = Query.XPATH;
 
+    private static final Set<String> IGNORED_PROPERTIES = new HashSet<String>();
+    static {
+        IGNORED_PROPERTIES.add(NodeUtil.MIXIN_TYPES);
+        IGNORED_PROPERTIES.add(NodeUtil.NODE_TYPE);
+        IGNORED_PROPERTIES.add("jcr:created");
+        IGNORED_PROPERTIES.add("jcr:createdBy");
+    }
+
     /** Default logger */
     private final Logger log = LoggerFactory.getLogger(getClass());
 
@@ -440,7 +448,7 @@ public class JcrResourceProvider
                     jcrMap.put(NodeUtil.MIXIN_TYPES, value);
                 }
                 for(final Map.Entry<String, Object> entry : properties.entrySet())
{
-                    if ( !NodeUtil.NODE_TYPE.equals(entry.getKey()) && !NodeUtil.MIXIN_TYPES.equals(entry.getKey()))
{
+                    if ( !IGNORED_PROPERTIES.contains(entry.getKey()) ) {
                         try {
                             jcrMap.put(entry.getKey(), entry.getValue());
                         } catch (final IllegalArgumentException iae) {



Mime
View raw message