add NullableTypeComputer to avoid NPE

Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/c13ad120
Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/c13ad120
Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/c13ad120

Branch: refs/heads/vxquery_0_3_staging
Commit: c13ad1202af4da31406b0ac2e83d833e87a4c64d
Parents: 3f4797b
Author: Till Westmann <[email protected]>
Authored: Thu Apr 3 10:47:21 2014 -0700
Committer: Preston Carman <[email protected]>
Committed: Sun Apr 6 09:50:42 2014 -0700

----------------------------------------------------------------------
 .../org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java   | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/c13ad120/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
----------------------------------------------------------------------
diff --git 
a/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
 
b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
index 91c7764..2fdfbea 100644
--- 
a/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
+++ 
b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/XMLQueryCompiler.java
@@ -41,6 +41,7 @@ import org.apache.vxquery.xmlquery.ast.ModuleNode;
 import org.apache.vxquery.xmlquery.translator.XMLQueryTranslator;
 
 import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import 
edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
 import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
 import 
edu.uci.ics.hyracks.algebricks.compiler.api.HeuristicCompilerFactoryBuilder;
 import edu.uci.ics.hyracks.algebricks.compiler.api.ICompiler;
@@ -149,6 +150,12 @@ public class XMLQueryCompiler {
                 return null;
             }
         });
+        builder.setNullableTypeComputer(new INullableTypeComputer() {
+            @Override
+            public Object makeNullableType(Object type) throws 
AlgebricksException {
+                throw new NotImplementedException("NullableTypeComputer is not 
implented");
+            }
+        });
         builder.setNullWriterFactory(new VXQueryNullWriterFactory());
         if (availableProcessors < 1) {
             
builder.setClusterLocations(VXQueryMetadataProvider.getClusterLocations(nodeList));

Reply via email to