jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1349204 - /jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/path/eval/PathEngineSPARQL.java
Date Tue, 12 Jun 2012 09:14:04 GMT
Author: andy
Date: Tue Jun 12 09:14:04 2012
New Revision: 1349204

URL: http://svn.apache.org/viewvc?rev=1349204&view=rev
Log:
Evaluation of path? was not careful enough about duplicates.

Modified:
    jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/path/eval/PathEngineSPARQL.java

Modified: jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/path/eval/PathEngineSPARQL.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/path/eval/PathEngineSPARQL.java?rev=1349204&r1=1349203&r2=1349204&view=diff
==============================================================================
--- jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/path/eval/PathEngineSPARQL.java
(original)
+++ jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/path/eval/PathEngineSPARQL.java
Tue Jun 12 09:14:04 2012
@@ -82,10 +82,11 @@ public class PathEngineSPARQL extends Pa
     @Override
     protected void doZeroOrOne(Path pathStep, Node node, Collection<Node> output)
     {
-        // Unique.
-        eval(graph, pathStep, node, output) ;
-        if ( ! output.contains(node) )
-            output.add(node) ;
+        // Force unique evaluation.
+        Collection<Node> x = new HashSet<Node>() ;
+        eval(graph, pathStep, node, x) ;
+        x.add(node) ;
+        output.addAll(x) ;
     }
 
     @Override



Mime
View raw message