jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [3/6] jena git commit: Some java8 streams usage.
Date Sat, 25 Apr 2015 23:23:46 GMT
Some java8 streams usage.

Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/59ae38d5
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/59ae38d5
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/59ae38d5

Branch: refs/heads/jena3
Commit: 59ae38d5843cd9e02377b47554911a94d7abef78
Parents: b5a2f73
Author: Andy Seaborne <andy@apache.org>
Authored: Sun Apr 26 00:12:59 2015 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Sun Apr 26 00:12:59 2015 +0100

----------------------------------------------------------------------
 .../java/org/apache/jena/sparql/path/eval/PathEngine1.java    | 7 ++++---
 .../java/org/apache/jena/sparql/path/eval/PathEngineN.java    | 3 +--
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/59ae38d5/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine1.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine1.java b/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine1.java
index c71861c..476af77 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine1.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngine1.java
@@ -160,16 +160,17 @@ final class PathEngine1 extends PathEngine
         }
         if ( fixedLength == 1 ) {
             Iter<Node> iter = eval(pathStep, node) ;
-            for (Node n : iter) {
+            iter.forEachRemaining(n->{
                 if ( !output.contains(n) )
                     output.add(n) ;
-            }
+            });
             return ;
         }
         // Loop, not recurse.
         Iter<Node> iter = eval(pathStep, node) ;
-        for (Node n : iter)
+        iter.forEachRemaining(n->{
             doFixedLengthPath(pathStep, n, fixedLength - 1, output) ;
+        }) ;
         return ;
     }
 

http://git-wip-us.apache.org/repos/asf/jena/blob/59ae38d5/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngineN.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngineN.java b/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngineN.java
index 54f91fd..0275205 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngineN.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/path/eval/PathEngineN.java
@@ -87,8 +87,7 @@ final class PathEngineN extends PathEngine
 
         // Feed one side into the other
         Iter<Node> iter = eval(part1, node) ;
-        for (Node n : iter)
-            eval(part2, n, output) ;
+        iter.forEachRemaining((n)->eval(part2, n, output)) ;
     }
 
     @Override


Mime
View raw message