jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1588702 - /jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformReorder.java
Date Sat, 19 Apr 2014 20:11:00 GMT
Author: andy
Date: Sat Apr 19 20:10:59 2014
New Revision: 1588702

URL: http://svn.apache.org/r1588702
Log:
JENA-685 : Don't try to reorder pattern of 0 or 1 triple patterns

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

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformReorder.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformReorder.java?rev=1588702&r1=1588701&r2=1588702&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformReorder.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformReorder.java
Sat Apr 19 20:10:59 2014
@@ -60,7 +60,9 @@ public class TransformReorder extends Tr
 	@Override
 	public Op transform(OpBGP opBGP) {
 		BasicPattern pattern = opBGP.getPattern();
-		BasicPattern pattern2 = this.reorder.reorder(pattern);
+		if ( pattern.size() < 2 ) 
+		    return opBGP ; 
+		BasicPattern pattern2 = reorder.reorder(pattern);
 		return new OpBGP(pattern2);
 	}
 
@@ -70,7 +72,9 @@ public class TransformReorder extends Tr
 	@Override
 	public Op transform(OpQuadPattern opQuadPattern) {
 		BasicPattern pattern = opQuadPattern.getBasicPattern();
-		BasicPattern pattern2 = this.reorder.reorder(pattern);
+        if ( pattern.size() < 2 ) 
+            return opQuadPattern ; 
+		BasicPattern pattern2 = reorder.reorder(pattern);
 		return new OpQuadPattern(opQuadPattern.getGraphNode(), pattern2);
 	}
 



Mime
View raw message