jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r492235 - /jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Date Wed, 03 Jan 2007 17:42:45 GMT
Author: mreutegg
Date: Wed Jan  3 09:42:44 2007
New Revision: 492235

URL: http://svn.apache.org/viewvc?view=rev&rev=492235
Log:
JCR-689: Minimize calls to PersistenceManager

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?view=diff&rev=492235&r1=492234&r2=492235
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Wed Jan  3 09:42:44 2007
@@ -421,6 +421,17 @@
             throws ConstraintViolationException, RepositoryException {
         status.clear();
 
+        if (isNew() && !hasProperty(name)) {
+            // this is a new node and the property does not exist yet
+            // -> no need to check item manager
+            PropertyDefinitionImpl def = getApplicablePropertyDefinition(
+                    name, type, multiValued, exactTypeMatch);
+            PropertyImpl prop = createChildProperty(name, type, def);
+            status.set(CREATED);
+            return prop;
+        }
+
+
         /*
          * Please note, that this implementation does not win a price for beauty
          * or speed. It's never a good idea to use exceptions for semantical



Mime
View raw message