jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tri...@apache.org
Subject svn commit: r801825 - in /jackrabbit/trunk: jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/ jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/
Date Thu, 06 Aug 2009 22:19:11 GMT
Author: tripod
Date: Thu Aug  6 22:19:11 2009
New Revision: 801825

URL: http://svn.apache.org/viewvc?rev=801825&view=rev
Log:
JCR-2244 NodeDefinitionTemplateImpl.setDefaultPrimaryTypeName(null) throws exception

Modified:
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeCreationTest.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionTemplateImpl.java

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeCreationTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeCreationTest.java?rev=801825&r1=801824&r2=801825&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeCreationTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/nodetype/NodeTypeCreationTest.java
Thu Aug  6 22:19:11 2009
@@ -336,12 +336,8 @@
         ndt.setDefaultPrimaryTypeName(expandedName);
         assertEquals(jcrName, ndt.getDefaultPrimaryTypeName());
 
-        try {
-            ndt.setDefaultPrimaryTypeName(null);
-            fail("null isn't a valid jcr name");
-        } catch (ConstraintViolationException e) {
-            // success
-        }
+        ndt.setDefaultPrimaryTypeName(null);
+        assertEquals("setting null must clear the name.", null, ndt.getDefaultPrimaryTypeName());
 
         ndt.setRequiredPrimaryTypeNames(new String[] {expandedName});
         assertNotNull(ndt.getRequiredPrimaryTypeNames());

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionTemplateImpl.java?rev=801825&r1=801824&r2=801825&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionTemplateImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/nodetype/NodeDefinitionTemplateImpl.java
Thu Aug  6 22:19:11 2009
@@ -102,7 +102,9 @@
      */
     public void setDefaultPrimaryTypeName(String defaultPrimaryType) throws ConstraintViolationException
{
         try {
-            this.defaultPrimaryTypeName = resolver.getQName(defaultPrimaryType);
+            this.defaultPrimaryTypeName = defaultPrimaryType == null
+                    ? null
+                    : resolver.getQName(defaultPrimaryType);
         } catch (RepositoryException e) {
             throw new ConstraintViolationException(e);
         }



Mime
View raw message