jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1304278 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelPropertyState.java
Date Fri, 23 Mar 2012 10:56:11 GMT
Author: mduerig
Date: Fri Mar 23 10:56:10 2012
New Revision: 1304278

URL: http://svn.apache.org/viewvc?rev=1304278&view=rev
Log:
OAK-33: Values in oak-core (WIP)
initial implementation of Scalar

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelPropertyState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelPropertyState.java?rev=1304278&r1=1304277&r2=1304278&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelPropertyState.java
Fri Mar 23 10:56:10 2012
@@ -55,23 +55,13 @@ public class KernelPropertyState extends
             for (Scalar s : values) {
                 sb.append(sep);
                 sep = ",";
-                if (s.getType() == Scalar.STRING) {
-                    sb.append('"' + s.getString() + '"');
-                }
-                else {
-                    sb.append(s.getString());
-                }
+                sb.append(encodeValue(s));
             }
             sb.append(']');
             return sb.toString();
         }
         else {
-            if (value.getType() == Scalar.STRING) {
-                return '"' + value.getString() + '"';
-            }
-            else {
-                return value.getString();
-            }
+            return encodeValue(value);
         }
     }
 
@@ -86,4 +76,15 @@ public class KernelPropertyState extends
     public List<Scalar> getValues() {
         return values;
     }
+    
+    //------------------------------------------------------------< private >--- 
+    
+    private static String encodeValue(Scalar value) {
+        if (value.getType() == Scalar.STRING) {
+            return '"' + value.getString() + '"';
+        }
+        else {
+            return value.getString();
+        }
+    }
 }



Mime
View raw message