Repository: asterixdb
Updated Branches:
  refs/heads/master 8549db8ad -> 7ccbdb6f1


Fix potential race condition in ATypeHierarchy

Change-Id: I804ae58571ecdf5829b70073457480c4540657db
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1781
Reviewed-by: Yingyi Bu <[email protected]>
Sonar-Qube: Jenkins <[email protected]>
Tested-by: Jenkins <[email protected]>
BAD: Jenkins <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/asterixdb/commit/7ccbdb6f
Tree: http://git-wip-us.apache.org/repos/asf/asterixdb/tree/7ccbdb6f
Diff: http://git-wip-us.apache.org/repos/asf/asterixdb/diff/7ccbdb6f

Branch: refs/heads/master
Commit: 7ccbdb6f1c030f9715108829db0a1877a9021d8a
Parents: 8549db8
Author: Dmitry Lychagin <[email protected]>
Authored: Fri May 26 16:25:02 2017 -0700
Committer: Till Westmann <[email protected]>
Committed: Fri May 26 18:13:09 2017 -0700

----------------------------------------------------------------------
 .../org/apache/asterix/om/types/hierachy/ATypeHierarchy.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/7ccbdb6f/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
----------------------------------------------------------------------
diff --git 
a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
 
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
index 8b43fa8..2893a0c 100644
--- 
a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
+++ 
b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/types/hierachy/ATypeHierarchy.java
@@ -52,7 +52,6 @@ public class ATypeHierarchy {
     private static HashMap<Integer, ITypeConvertComputer> promoteComputerMap = 
new HashMap<Integer, ITypeConvertComputer>();
     private static HashMap<Integer, ITypeConvertComputer> demoteComputerMap = 
new HashMap<Integer, ITypeConvertComputer>();
     private static Map<ATypeTag, Domain> hierarchyDomains = new 
HashMap<ATypeTag, Domain>();
-    private static ITypeConvertComputer convertComputer;
 
     // allow type promotion or demotion to the type itself
     static {
@@ -633,11 +632,13 @@ public class ATypeHierarchy {
         if (sourceTypeTag != targetTypeTag) {
             // source tag can be promoted to target tag (e.g. tag1: SMALLINT, 
tag2: INTEGER)
             if (ATypeHierarchy.canPromote(sourceTypeTag, targetTypeTag)) {
-                convertComputer = 
ATypeHierarchy.getTypePromoteComputer(sourceTypeTag, targetTypeTag);;
+                ITypeConvertComputer convertComputer =
+                        ATypeHierarchy.getTypePromoteComputer(sourceTypeTag, 
targetTypeTag);
                 convertComputer.convertType(sourceByteArray, s1 + 1, l1 - 1, 
out);
                 // source tag can be demoted to target tag
             } else if (ATypeHierarchy.canDemote(sourceTypeTag, targetTypeTag)) 
{
-                convertComputer = 
ATypeHierarchy.getTypeDemoteComputer(sourceTypeTag, targetTypeTag);;
+                ITypeConvertComputer convertComputer =
+                        ATypeHierarchy.getTypeDemoteComputer(sourceTypeTag, 
targetTypeTag);
                 convertComputer.convertType(sourceByteArray, s1 + 1, l1 - 1, 
out);
             } else {
                 throw new IOException(

Reply via email to