jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r470486 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/PropertyDefinitionImpl.java
Date Thu, 02 Nov 2006 19:30:49 GMT
Author: angela
Date: Thu Nov  2 11:30:47 2006
New Revision: 470486

URL: http://svn.apache.org/viewvc?view=rev&rev=470486
Log:
work in progress

- lost check for default values being null

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/PropertyDefinitionImpl.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/PropertyDefinitionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/PropertyDefinitionImpl.java?view=diff&rev=470486&r1=470485&r2=470486
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/PropertyDefinitionImpl.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/nodetype/PropertyDefinitionImpl.java
Thu Nov  2 11:30:47 2006
@@ -29,6 +29,7 @@
 import javax.jcr.PropertyType;
 import javax.jcr.nodetype.PropertyDefinition;
 import java.io.IOException;
+import java.io.InputStream;
 
 /**
  * This class implements the <code>PropertyDefinition</code> interface.
@@ -67,14 +68,24 @@
         QValue[] defVals;
         if (pDef.getRequiredType() == PropertyType.BINARY) {
             try {
-                defVals = QValue.create(pDef.getDefaultValuesAsStream(), pDef.getRequiredType());
+                InputStream[] ins = pDef.getDefaultValuesAsStream();
+                if (ins == null) {
+                    return null;
+                } else {
+                    defVals = QValue.create(ins, pDef.getRequiredType());
+                }
             } catch (IOException e) {
                 String propName = (getName() == null) ? "[null]" : getName();
                 log.error("Illegal default value specified for property " + propName + "
in node type " + getDeclaringNodeType(), e);
                 return null;
             }
         } else {
-            defVals = QValue.create(pDef.getDefaultValues(), pDef.getRequiredType());
+            String[] ss = pDef.getDefaultValues();
+            if (ss == null) {
+                return null;
+            } else {
+                defVals = QValue.create(ss, pDef.getRequiredType());
+            }
         }
 
         Value[] values = new Value[defVals.length];



Mime
View raw message