jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rve...@apache.org
Subject svn commit: r1585883 - in /jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql: algebra/optimize/Optimize.java expr/ExprFunctionN.java
Date Wed, 09 Apr 2014 03:00:15 GMT
Author: rvesse
Date: Wed Apr  9 03:00:15 2014
New Revision: 1585883

URL: http://svn.apache.org/r1585883
Log:
Enable Constant Folding in standard optimizer (JENA-630)

Modified:
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/Optimize.java
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/Optimize.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/Optimize.java?rev=1585883&r1=1585882&r2=1585883&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/Optimize.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/Optimize.java
Wed Apr  9 03:00:15 2014
@@ -155,7 +155,7 @@ public class Optimize implements Rewrite
         OpWalker.walk(op, new OpVisitorExprPrepare(context)) ;
         
         // Expression constant folding
-        if ( context.isTrue(ARQ.optExprConstantFolding) )
+        if ( context.isTrueOrUndef(ARQ.optExprConstantFolding) )
             op = Transformer.transform(new TransformCopy(), new ExprTransformConstantFold(),
op);
         
         // Need to allow subsystems to play with this list.

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java?rev=1585883&r1=1585882&r2=1585883&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java (original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/expr/ExprFunctionN.java Wed Apr
 9 03:00:15 2014
@@ -21,6 +21,7 @@ package com.hp.hpl.jena.sparql.expr;
 import java.util.ArrayList ;
 import java.util.List ;
 
+import com.hp.hpl.jena.sparql.ARQInternalErrorException;
 import com.hp.hpl.jena.sparql.engine.binding.Binding ;
 import com.hp.hpl.jena.sparql.function.FunctionEnv ;
 import com.hp.hpl.jena.sparql.graph.NodeTransform ;
@@ -94,6 +95,9 @@ public abstract class ExprFunctionN exte
             return eval(values);
         } catch (ExprEvalException ex) {
             return copy(newArgs);
+        } catch (ARQInternalErrorException ex) {
+            // May show up when trying to fold certain things
+            return copy(newArgs);
         }
     }
 



Mime
View raw message