ASTERIXDB-1164 Fix the racing condition in CodePointToStringDescriptor

The following commits from your working branch will be included:

commit 3074d479468f5f1d512e48c03eb209a45e482f2d
Author: JavierJia <jianfeng.jia@gmail.com>
Date:   Wed Nov 11 20:40:00 2015 -0800

    fix the racing condition in CodePointToStringDescriptor

Change-Id: I7c440731798e2ec8a4f0ab51be06ef7032835193
Reviewed-on: https://asterix-gerrit.ics.uci.edu/484
Reviewed-by: Cameron Samak <csamak@apache.org>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
index ca2557a..b2cb477 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/serde/AObjectSerializerDeserializer.java
@@ -210,6 +210,7 @@
             }
             case BINARY: {
                 aBinarySerDer.serialize((ABinary) instance, out);
+                break;
             }
             case DATE: {
                 ADateSerializerDeserializer.INSTANCE.serialize((ADate) instance, out);
@@ -261,12 +262,15 @@
             }
             case ORDEREDLIST: {
                 AOrderedListSerializerDeserializer.SCHEMALESS_INSTANCE.serialize((AOrderedList) instance, out);
+                break;
             }
             case UNORDEREDLIST: {
                 AUnorderedListSerializerDeserializer.SCHEMALESS_INSTANCE.serialize((AUnorderedList) instance, out);
+                break;
             }
             case TYPE: {
                 ATypeSerializerDeserializer.INSTANCE.serialize((IAType) instance, out);
+                break;
             }
             default: {
                 throw new NotImplementedException("No serializer/deserializer implemented for type " + t.getTypeTag()
diff --git a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
index 42c5c49..3b89eba 100644
--- a/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
+++ b/asterix-runtime/src/main/java/org/apache/asterix/runtime/evaluators/functions/CodePointToStringDescriptor.java
@@ -48,10 +48,6 @@
         }
     };
 
-    private final static byte[] currentUTF8 = new byte[6];
-    private final static byte[] tempStoreForLength = new byte[5];
-    private final byte stringTypeTag = ATypeTag.STRING.serialize();
-
     @Override
     public ICopyEvaluatorFactory createEvaluatorFactory(final ICopyEvaluatorFactory[] args) {
         return new ICopyEvaluatorFactory() {
@@ -67,6 +63,10 @@
                     private ArrayBackedValueStorage outInputList = new ArrayBackedValueStorage();
                     private ICopyEvaluator evalList = listEvalFactory.createEvaluator(outInputList);
 
+                    private final byte[] currentUTF8 = new byte[6];
+                    private final byte[] tempStoreForLength = new byte[5];
+                    private final byte stringTypeTag = ATypeTag.STRING.serialize();
+
                     @Override
                     public void evaluate(IFrameTupleReference tuple) throws AlgebricksException {
                         try {