jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r760479 - /jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
Date Tue, 31 Mar 2009 15:28:00 GMT
Author: mduerig
Date: Tue Mar 31 15:27:58 2009
New Revision: 760479

URL: http://svn.apache.org/viewvc?rev=760479&view=rev
Log:
JCR-2039: Add log information when node/property type determination fails

Modified:
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java?rev=760479&r1=760478&r2=760479&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/ItemDefinitionProviderImpl.java
Tue Mar 31 15:27:58 2009
@@ -83,12 +83,13 @@
             EffectiveNodeType entTarget = getEffectiveNodeType(ntName);
             definition = getQNodeDefinition(ent, entTarget, nodeName);
         } catch (RepositoryException e) {
-            definition = service.getNodeDefinition(sessionInfo, nodeId);
+            log.debug("Cannot determine effective node type of {}: {}", nodeId, e);
+            definition = getNodeDefinition(service, sessionInfo, nodeId);
         }
         return definition;
     }
 
-   /**
+    /**
      * @inheritDoc
      */
    public QNodeDefinition getQNodeDefinition(Name[] parentNodeTypeNames, Name name, Name
nodeTypeName)
@@ -119,7 +120,8 @@
             EffectiveNodeType ent = entProvider.getEffectiveNodeType(parentNodeTypeNames);
             definition = getQPropertyDefinition(ent, propertyName, propertType, isMultiValued,
true);
         } catch (RepositoryException e) {
-            definition = service.getPropertyDefinition(sessionInfo, propertyId);
+            log.debug("Cannot determine property defintion of {}: {}", propertyId, e);
+            definition = getPropertyDefinition(service, sessionInfo, propertyId);
         }
         return definition;
     }
@@ -367,4 +369,28 @@
         return match;
     }
 
+    private static QNodeDefinition getNodeDefinition(RepositoryService service, SessionInfo
sessionInfo,
+            NodeId nodeId) throws RepositoryException {
+
+        try {
+            return service.getNodeDefinition(sessionInfo, nodeId);
+        }
+        catch (RepositoryException e) {
+            log.error("Cannot determine node definition of {}: {}", nodeId, e);
+            throw e;
+        }
+    }
+
+    private static QPropertyDefinition getPropertyDefinition(RepositoryService service,
+            SessionInfo sessionInfo, PropertyId propertyId) throws RepositoryException {
+
+        try {
+            return service.getPropertyDefinition(sessionInfo, propertyId);
+        }
+        catch (RepositoryException e) {
+            log.error("Cannot determine property definition of {}: {}", propertyId, e);
+            throw e;
+        }
+    }
+
 }



Mime
View raw message