You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2012/09/18 00:17:33 UTC

svn commit: r1386875 - /incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/values/XDMConstants.java

Author: prestonc
Date: Mon Sep 17 22:17:32 2012
New Revision: 1386875

URL: http://svn.apache.org/viewvc?rev=1386875&view=rev
Log:
Added an empty string to the constants class.

Modified:
    incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/values/XDMConstants.java

Modified: incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/values/XDMConstants.java
URL: http://svn.apache.org/viewvc/incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/values/XDMConstants.java?rev=1386875&r1=1386874&r2=1386875&view=diff
==============================================================================
--- incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/values/XDMConstants.java (original)
+++ incubator/vxquery/trunk/vxquery/vxquery-core/src/main/java/org/apache/vxquery/datamodel/values/XDMConstants.java Mon Sep 17 22:17:32 2012
@@ -32,6 +32,8 @@ public class XDMConstants {
 
     private static final byte[] EMPTY_SEQUENCE;
 
+    private static final byte[] EMPTY_STRING;
+
     static {
         BOOLEAN_TRUE_CONSTANT = new byte[2];
         BOOLEAN_TRUE_CONSTANT[0] = ValueTag.XS_BOOLEAN_TAG;
@@ -50,6 +52,11 @@ public class XDMConstants {
             throw new RuntimeException(e);
         }
         EMPTY_SEQUENCE = Arrays.copyOf(abvs.getByteArray(), abvs.getLength());
+        
+        EMPTY_STRING = new byte[3];
+        EMPTY_STRING[0] = ValueTag.XS_STRING_TAG;
+        EMPTY_STRING[1] = 0;
+        EMPTY_STRING[2] = 0;
     }
 
     public static void setTrue(IPointable p) {
@@ -64,6 +71,10 @@ public class XDMConstants {
         set(p, EMPTY_SEQUENCE);
     }
 
+    public static void setEmptyString(IPointable p) {
+        set(p, EMPTY_STRING);
+    }
+
     private static void set(IPointable p, byte[] array) {
         p.set(array, 0, array.length);
     }