You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2013/09/26 13:00:17 UTC

svn commit: r1526440 - /jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Substitute.java

Author: andy
Date: Thu Sep 26 11:00:17 2013
New Revision: 1526440

URL: http://svn.apache.org/r1526440
Log:
No need to create duplicate PropFuncArg if already a non-variable node.

Modified:
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Substitute.java

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Substitute.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Substitute.java?rev=1526440&r1=1526439&r2=1526440&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Substitute.java (original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/core/Substitute.java Thu Sep 26 11:00:17 2013
@@ -127,8 +127,13 @@ public class Substitute
     {
         if ( isNotNeeded(binding) ) return propFuncArg ;
         
-        if ( propFuncArg.isNode() )
+        if ( propFuncArg.isNode() ) {
+            Node n = propFuncArg.getArg() ;
+            if ( ! Var.isVar(n) )
+                // Not a Var, no substitute needed. 
+                return propFuncArg ;
             return new PropFuncArg(substitute(propFuncArg.getArg(), binding)) ;
+        }
         
         List<Node> newArgList = new ArrayList<Node>() ;
         for ( Node n : propFuncArg.getArgList() )
@@ -148,8 +153,6 @@ public class Substitute
         return exprList.copySubstitute(binding) ;  
     }
     
-    
-
     private static boolean isNotNeeded(Binding b)
     {
         return b.isEmpty() ;