jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1401248 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ValueImpl.java
Date Tue, 23 Oct 2012 11:23:08 GMT
Author: mduerig
Date: Tue Oct 23 11:23:07 2012
New Revision: 1401248

URL: http://svn.apache.org/viewvc?rev=1401248&view=rev
Log:
OAK-380: Define conversion of property values
Simplify ValueImpl

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ValueImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ValueImpl.java?rev=1401248&r1=1401247&r2=1401248&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ValueImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/value/ValueImpl.java
Tue Oct 23 11:23:07 2012
@@ -16,7 +16,6 @@
  */
 package org.apache.jackrabbit.oak.plugins.value;
 
-import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.math.BigDecimal;
 import java.util.Calendar;
@@ -27,7 +26,6 @@ import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 import javax.jcr.ValueFormatException;
 
-import com.google.common.base.Charsets;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
@@ -236,13 +234,7 @@ public class ValueImpl implements Value 
     }
 
     InputStream getNewStream() throws RepositoryException {
-        switch (getType()) {
-            case PropertyType.NAME:
-            case PropertyType.PATH:
-                return new ByteArrayInputStream(getString().getBytes(Charsets.UTF_8));
-            default:
-                return propertyState.getValue(Type.BINARY, index).getNewStream();
-        }
+        return propertyState.getValue(Type.BINARY, index).getNewStream();
     }
 
     long getStreamLength() {



Mime
View raw message