jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r1421246 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype: NodeTypeTemplateImpl.java PropertyDefinitionTemplateImpl.java
Date Thu, 13 Dec 2012 12:29:27 GMT
Author: mreutegg
Date: Thu Dec 13 12:29:27 2012
New Revision: 1421246

URL: http://svn.apache.org/viewvc?rev=1421246&view=rev
Log:
OAK-513: Registering a property type does not retain the type

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeTemplateImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/PropertyDefinitionTemplateImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeTemplateImpl.java?rev=1421246&r1=1421245&r2=1421246&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeTemplateImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/NodeTypeTemplateImpl.java
Thu Dec 13 12:29:27 2012
@@ -22,6 +22,7 @@ import java.util.List;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFactory;
+import javax.jcr.ValueFormatException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeDefinitionTemplate;
@@ -125,8 +126,9 @@ final class NodeTypeTemplateImpl
     public PropertyDefinitionTemplateImpl newPropertyDefinitionBuilder() {
         return new PropertyDefinitionTemplateImpl(mapper) {
             @Override
-            protected Value createValue(String value) {
-                return factory.createValue(value);
+            protected Value createValue(String value, int type)
+                    throws ValueFormatException {
+                return factory.createValue(value, type);
             }
             @Override
             public void build() {

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/PropertyDefinitionTemplateImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/PropertyDefinitionTemplateImpl.java?rev=1421246&r1=1421245&r2=1421246&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/PropertyDefinitionTemplateImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/PropertyDefinitionTemplateImpl.java
Thu Dec 13 12:29:27 2012
@@ -45,7 +45,8 @@ class PropertyDefinitionTemplateImpl
         requiredType = PropertyType.STRING;
     }
 
-    protected Value createValue(String value) throws RepositoryException {
+    protected Value createValue(String value, int type)
+            throws RepositoryException {
         throw new UnsupportedRepositoryOperationException();
     }
 
@@ -168,11 +169,11 @@ class PropertyDefinitionTemplateImpl
     @Override
     public void addDefaultValues(String value) throws RepositoryException {
         if (defaultValues == null) {
-            defaultValues = new Value[] { createValue(value) };
+            defaultValues = new Value[] { createValue(value, getRequiredType()) };
         } else {
             Value[] values = new Value[defaultValues.length + 1];
             System.arraycopy(defaultValues, 0, values, 0, defaultValues.length);
-            values[defaultValues.length] = createValue(value);
+            values[defaultValues.length] = createValue(value, getRequiredType());
             defaultValues = values;
         }
     }



Mime
View raw message