[jira] [Commented] (JENA-966) LazyIterator

2015-07-30 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14647612#comment-14647612
 ] 

ASF GitHub Bot commented on JENA-966:
-

Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/90#discussion_r35869523
  
--- Diff: jena-base/src/main/java/org/apache/jena/atlas/iterator/Iter.java 
---
@@ -29,6 +29,14 @@
 import org.apache.jena.atlas.lib.Closeable ;
 import org.apache.jena.atlas.lib.Sink ;
 
+/**
+ * Iter provides utilities for working with {@link Iterator}s.
+ *
+ * Iter should never be used as a return type or parameter type in the 
public contract of a class. It is only to be used
+ * inside implementation code and is instantiated only to allow 
method-chaining as part of a calculation.
--- End diff --

What I meant by difference was context of use. In other words, what I 
have been trying to get at with this conversation, as I have written, is the 
answer to When should one use `Iter`, and when should one use 
`ExtendedIterator`? I tried to use `Iter` inside an `ExtendedIterator` during 
JENA-966 and you explained that this was wrong, and I am trying to get Javadocs 
into these classes so that other people don't have the same confusion. 

I still have no idea when to use either. If the difference is purely 
historical, then there is no inherent need for both, and perhaps I should open 
a ticket for a slow, careful, un-disruptive migration towards a single type for 
these purposes?


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren
 Fix For: Jena 3.0.0


 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-07-29 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14646710#comment-14646710
 ] 

ASF GitHub Bot commented on JENA-966:
-

Github user ajs6f commented on a diff in the pull request:

https://github.com/apache/jena/pull/90#discussion_r35807971
  
--- Diff: jena-base/src/main/java/org/apache/jena/atlas/iterator/Iter.java 
---
@@ -29,6 +29,14 @@
 import org.apache.jena.atlas.lib.Closeable ;
 import org.apache.jena.atlas.lib.Sink ;
 
+/**
+ * Iter provides utilities for working with {@link Iterator}s.
+ *
+ * Iter should never be used as a return type or parameter type in the 
public contract of a class. It is only to be used
+ * inside implementation code and is instantiated only to allow 
method-chaining as part of a calculation.
--- End diff --

Yes, that's why the note is useful. If `Iter` actually imposed that in the 
code there would be no need for documentation.

Is there in fact any difference between `Iter` and `ExtendedIterator`? They 
are both subtypes of `java.util.Iterator` that provide convenient methods, with 
the functionality of `Iter` entirely overlapping that of `ExtendedIterator`. 
I've tried repeatedly to discover this information, and my experience shows 
that it is quite possible to confuse them. You were quite explicit in 
explaining to me in connection with JENA-966 that they are not to be used in 
the same circumstances, and all I'm trying to do here is determine what those 
circumstances actually are and record them.


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren
 Fix For: Jena 3.0.0


 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-07-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14627974#comment-14627974
 ] 

ASF GitHub Bot commented on JENA-966:
-

Github user ajs6f closed the pull request at:

https://github.com/apache/jena/pull/80


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren
 Fix For: Jena 3.0.0


 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-07-13 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14624531#comment-14624531
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit 71363fc1bf5465a3126c601f1331f812e9a8e19d in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=71363fc ]

This closes #80. See JENA-966.


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren
 Fix For: Jena 3.0.0


 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-07-12 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14623937#comment-14623937
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit 764cf529257f3b180e5b6f456a5464813fe47628 in jena's branch 
refs/heads/master from [~cla...@xenei.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=764cf52 ]

Removed EarlyBindingIterator, UniqueExtendedIterator, and LateBindingIterator.
Part of a fix for JENA-966
Should complete the fix.


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren
 Fix For: Jena 3.0.0


 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-07-03 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14613322#comment-14613322
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit 66ceff0cb1b2aaddf4477993dda60a1e32026ebf in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=66ceff0 ]

JENA-966: Deprecate EarlyBindingIterator and UniqueExtendedIterator


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren
 Fix For: Jena 3.0.0


 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-30 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14608023#comment-14608023
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit 434bb59fb8e13370869256463369156dfb0f1408 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=434bb59 ]

JENA-966 : LazyInterator extends NiceIterator.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-30 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14608025#comment-14608025
 ] 

Andy Seaborne commented on JENA-966:


Option 1 used to DRY the code.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-30 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14608035#comment-14608035
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit 21b5e602e7411735ba22a716f84b136cdb709169 in jena's branch 
refs/heads/jena2 from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=21b5e60 ]

JENA-966: backport LazyIterator changes


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-28 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14604610#comment-14604610
 ] 

Andy Seaborne commented on JENA-966:


There is a quicker build for testing the main modules:

{noformat}
mvn install -Pdev
{noformat}

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-28 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14604606#comment-14604606
 ] 

Andy Seaborne commented on JENA-966:


The Jenkins test job has got failures:

https://builds.apache.org/view/H-L/view/Jena/job/Jena_Development_Deploy/org.apache.jena$jena-arq/968/testReport/junit/org.apache.jena.riot.writer/TestRiotWriterGraph/writer00_8__RDF_XML_pretty_/

NPE in LazyIterator. ARQ and Elephas affected.

{noformat}
java.lang.NullPointerException: null
at 
org.apache.jena.rdfxml.xmloutput.impl.Unparser$6.create(Unparser.java:1549)
at 
org.apache.jena.util.iterator.LazyIterator.lazy(LazyIterator.java:113)
at 
org.apache.jena.util.iterator.LazyIterator.filterKeep(LazyIterator.java:67)
at 
org.apache.jena.rdfxml.xmloutput.impl.Unparser.listSubjects(Unparser.java:1658)
at 
org.apache.jena.rdfxml.xmloutput.impl.Unparser.wObjStar(Unparser.java:358)
at 
org.apache.jena.rdfxml.xmloutput.impl.Unparser.wRDF(Unparser.java:345)
at 
org.apache.jena.rdfxml.xmloutput.impl.Unparser.write(Unparser.java:247)
at 
org.apache.jena.rdfxml.xmloutput.impl.Abbreviated.writeBody(Abbreviated.java:140)
at 
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:501)
at 
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:473)
at 
org.apache.jena.rdfxml.xmloutput.impl.Abbreviated.write(Abbreviated.java:125)
at 
org.apache.jena.rdfxml.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:460)
at 
org.apache.jena.riot.adapters.AdapterRDFWriter.write(AdapterRDFWriter.java:51)
at org.apache.jena.riot.RDFDataMgr.write$(RDFDataMgr.java:1318)
at org.apache.jena.riot.RDFDataMgr.write(RDFDataMgr.java:1084)
at org.apache.jena.riot.RDFDataMgr.write(RDFDataMgr.java:1018)
at 
org.apache.jena.riot.writer.TestRiotWriterGraph.test(TestRiotWriterGraph.java:120)
at 
org.apache.jena.riot.writer.TestRiotWriterGraph.writer00(TestRiotWriterGraph.java:79)
{noformat}


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-28 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14604886#comment-14604886
 ] 

Andy Seaborne commented on JENA-966:


In {{Unparser.listSubjects}} the iterator {{firstChoiceCyclic}} is setup with:

{noformat}
IteratorResource firstChoiceCyclic = allInfiniteLeft()
.filterKeep(r - {
codeCoverage[4]++;
if (r.isAnon())
return false;
Integer cnt = objectTable.get(r);
if (cnt == null || cnt.intValue() = 1)
return false;
return true;
});
{noformat}

{{allInfiniteLeft}} with the old code, {{LateBindingIterator}} calls 
{{NiceIterator.filterKeep}} which itself creates a {{FilterIterator}} and the 
unlazy operation is first called at the hasNext stage - i.e. first use in the 
iterator of iterators, and after {{fakeLazyEvaluator}} which is the 
initialization of {{infinite}}.

{{allInfiniteLeft} with the new code, {{LazyIterator}} calls the unlazy 
operation during {{LazyIterator.filterKeep}} hence it's called at setup time 
assigning to {{firstChoiceCyclic}}.

Temporary fix applied to {{LazyIterator}} : the NiceIterator code for 
filterKeep, filterDrop copied to LazyIterator.

NB It looks like {{LazyIterator.mapWith}} is also wrong. Fix applied for 
review. It uses {Map1Iterator}}.

Possible proper solutions:

# {{LazyIterator}} extends {{NiceIterator}} and only override hasNext, next, 
remove.
# Drop {{LazyIterator}}, use {{LateBindingIterator}} (renamed?)
# Drop both, put a copy of {{LateBindingIterator}} into package-scoped in the 
unparser package as {{UnparserLateBindingIterator}} for unparser use only.

Comments?

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-28 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14604892#comment-14604892
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit 6f54f643125ee356b9694da51b70b50342abcd49 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=6f54f64 ]

JENA-966 : filterKeep/filterDrop : Fix for laziness to apply on use.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-26 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14603311#comment-14603311
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit e9a976bae67be635047b52d7fa598e144015553b in jena's branch 
refs/heads/master from [~cla...@xenei.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=e9a976b ]

Fix for JENA-966

Added removeNext(), andThen(), toList() and toSet() implementations to 
LazyIterator.

Deprecated LateBindingIterator which had much the same.
Modified Unparser to use LazyIterator rather than LateBindingIterator


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-26 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14603345#comment-14603345
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit 480706bdcff37bf740c9b66d3c6a5ed8f6d17709 in jena's branch 
refs/heads/jena2 from [~cla...@xenei.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=480706b ]

Fix for JENA-966

Added removeNext(), andThen(), toList() and toSet() implementations to 
LazyIterator.

Deprecated LateBindingIterator which had much the same.
Modified Unparser to use LazyIterator rather than LateBindingIterator


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-26 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14603365#comment-14603365
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit cba80269fd4848cc35bf5f102cbb6bace923f3d5 in jena's branch 
refs/heads/jena2 from [~cla...@xenei.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=cba8026 ]

removed  {{public ExtendedIteratorT andThen(ClosableIterator? extends T 
other) }}
as it was the same as the other andThen().

part of JENA-966 fix


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-26 Thread Claude Warren (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14603372#comment-14603372
 ] 

Claude Warren commented on JENA-966:


I think we should deprecate them now and remove them for 3.1.0 -- give people 
more time to make the changes.  Perhaps I am being too cautious.


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-26 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14603369#comment-14603369
 ] 

ASF subversion and git services commented on JENA-966:
--

Commit 73f42cad91d6e92816d6c0b790c38cfc1ab15650 in jena's branch 
refs/heads/master from [~cla...@xenei.org]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=73f42ca ]

removed removed  {{public ExtendedIteratorT andThen(ClosableIterator? 
extends T other) }}
as it has the wrong signature

part of JENA-966


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-26 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14603324#comment-14603324
 ] 

Andy Seaborne commented on JENA-966:


Let's delete unused LateBindingIterator and EarlyBindingIterator.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-26 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14603448#comment-14603448
 ] 

Andy Seaborne commented on JENA-966:


Not critical either way but, yes, that's pretty cautious even by my standards 
:-) Jena3 is a chance to accelerate deprecation. In tis case, I doubt anyone 
uses them (they are not contract).

The code does not use them, LateBindingIterator isn't even an ExtendedIterator. 
EarlyBindingIterator has no tests and isn't very important anyway.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-25 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14601203#comment-14601203
 ] 

A. Soroka commented on JENA-966:


Okay, I had that misapprehension based on some comments you ([~andy.seaborne]) 
made during the introduction of Java 8 syntax a while ago. Clearly I 
misunderstood you, for which I apologize. I certainly am _not_ trying to 
introduce Changes for change sake-- no one has enough time for that, 
especially on an unpaid basis. {grin}

[~andy.seaborne] or [~claudenw], can I ask you to clarify when it is 
appropriate to use {{ExtendedIterator}} and when it is better to use {{Iter}}? 
{{Iter}} features all of the functionality of {{ExtendedIterator}} and more. 
Since {{Iter}} is in {{jena-base}} and {{ExtendedIterator}} is in 
{{jena-core}}, {{Iter}} will be available any time {{ExtendedIterator}} is. 
That's another reason I assumed we would want to shift to {{Iter}}-- from a 
naive point of view, they look like flat-out duplication. If you can unpack 
this a bit for me, I will send a PR with some Javadocs additions for both that 
will prevent anyone else from going down the mistaken road I just wasted my 
time on.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14600155#comment-14600155
 ] 

Andy Seaborne commented on JENA-966:


There is no strategy to move {{org.apache.jena.util.iterator.*}} to jena-base 
from my point of view.

{{Iter}}, which is not tied into {{ExtendedIterator}} and is not just some 
utilities for Iterators, is in jena-base and is used in severals modules.

My point of view is that the iterators in jena-core work perfectly well and can 
be left alone now the functional idioms are in use.  Changes for change sake 
adds nothing for users and costs the project. Adding wrappers to put back 
functionality taken out of working code seems rather odd.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599460#comment-14599460
 ] 

A. Soroka commented on JENA-966:


That's very true-- I should not have been so brash about it. But then we just 
need a subtype with the right semantic (say {{ConstantSupplier}}). It's still a 
SAM type.

I didn't mean to belabor this so long-- my only point (which I clearly didn't 
make very well) is that when you can extend with methods or with types, Java 
8's lambdas make methods much more attractive than they used to be, because a 
single {{ConstantSupplier}} (or whatever) type could be used to support 
laziness in any number of methods, as opposed to a new LazyX type for every 
case.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599547#comment-14599547
 ] 

A. Soroka commented on JENA-966:


Is there any difference between {{LateBindingIterator}} and {{LazyIterator}}?

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599624#comment-14599624
 ] 

A. Soroka commented on JENA-966:


As per comment on the dev mailing list, [~claudenw] is going to wrangle 
{{LazyIterator}} and {{LateBindingIterator}}.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread aj...@virginia.edu
Right, I updated my comment right after I made it, when I noticed the 
difference.

I shouldn't think it matters which one to keep. LazyIterator is a little 
shorter to write. :)

There are a number of other Iterators (noted in the comments to that ticket) 
that seem to be depreciate-able. E.g. SingletonIterator has equivalent Guava 
functionality, and UniqueExtendedIterator has its own comments suggesting that 
it be deprecated (New development should use use codeUniqueFilter/code…). 
As I said in an earlier message, I will issue a reworked PR #79 with those 
suggestions, but I will not touch the lazy iterators.

---
A. Soroka
The University of Virginia Library

On Jun 24, 2015, at 11:32 AM, Claude Warren cla...@xenei.com wrote:

 Yes.  LazyIterator implements ExtendedIterator.  LateBindingIterator
 implements Iterator
 
 My plan -- probably won't execute until tomorrow night -- is to complete
 the implementation of LazyIterator for both (2.13.1 and 3.0.0) and then
 deprecate LateBinding in favor of Lazy as ExtendedIterator implements
 Iterator.
 
 Though I could very easily be swayed to alter LateBindingIterator to
 implement ExtendedIterator and deprecate LazyIterator.
 
 Claude
 
 On Wed, Jun 24, 2015 at 4:13 PM, A. Soroka (JIRA) j...@apache.org wrote:
 
 
[
 https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599547#comment-14599547
 ]
 
 A. Soroka commented on JENA-966:
 
 
 Is there any difference between {{LateBindingIterator}} and
 {{LazyIterator}}?
 
 LazyIterator
 
 
Key: JENA-966
URL: https://issues.apache.org/jira/browse/JENA-966
Project: Apache Jena
 Issue Type: Bug
 Components: Core
   Affects Versions: Jena 3.0.0
   Reporter: Claude Warren
   Assignee: Claude Warren
 
 LazyIterator is an abstract class.  The documentation indicates that the
 create() method needs to be overridden to create an instance.  From this I
 would expect that
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
  ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.
 
 
 
 --
 This message was sent by Atlassian JIRA
 (v6.3.4#6332)
 
 
 
 
 -- 
 I like: Like Like - The likeliest place on the web
 http://like-like.xenei.com
 LinkedIn: http://www.linkedin.com/in/claudewarren



[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599637#comment-14599637
 ] 

A. Soroka commented on JENA-966:


[~andy.seaborne], I am still not clear about your objection to deprecating 
{{Map1Iterator}} in favor of {{Iter::map}}. Are you entirely against this or is 
there something I can do to make it more attractive? My hope is to find those 
places where an {{ExtendedIterator}} is not in fact needed and replace them 
with a simple use of {{Iter::map}} and for the rest, use {{WrappedIterator}} 
around a call to {{Iter::map}}. There would be no direct connection from 
{{Iter}} to the classes in {{jena-core/org.apache.jena.util.iterator}}, 
although there would be a connection the other way. I thought the larger 
strategy was indeed to shift from {{jena-core/org.apache.jena.util}} to 
Atlas, in {{jena-base}}?

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread Claude Warren
Yes.  LazyIterator implements ExtendedIterator.  LateBindingIterator
implements Iterator

My plan -- probably won't execute until tomorrow night -- is to complete
the implementation of LazyIterator for both (2.13.1 and 3.0.0) and then
deprecate LateBinding in favor of Lazy as ExtendedIterator implements
Iterator.

Though I could very easily be swayed to alter LateBindingIterator to
implement ExtendedIterator and deprecate LazyIterator.

Claude

On Wed, Jun 24, 2015 at 4:13 PM, A. Soroka (JIRA) j...@apache.org wrote:


 [
 https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599547#comment-14599547
 ]

 A. Soroka commented on JENA-966:
 

 Is there any difference between {{LateBindingIterator}} and
 {{LazyIterator}}?

  LazyIterator
  
 
  Key: JENA-966
  URL: https://issues.apache.org/jira/browse/JENA-966
  Project: Apache Jena
   Issue Type: Bug
   Components: Core
 Affects Versions: Jena 3.0.0
 Reporter: Claude Warren
 Assignee: Claude Warren
 
  LazyIterator is an abstract class.  The documentation indicates that the
 create() method needs to be overridden to create an instance.  From this I
 would expect that
  now LazyIterator(){
  @Override
  public ExtendedIteratorModel create() {
...
  }};
  Would work however LazyIterator does not override:
  remoteNext(), andThen(), toList(), and toSet().
  I believe these should be implemented in the class.



 --
 This message was sent by Atlassian JIRA
 (v6.3.4#6332)




-- 
I like: Like Like - The likeliest place on the web
http://like-like.xenei.com
LinkedIn: http://www.linkedin.com/in/claudewarren


[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599851#comment-14599851
 ] 

ASF GitHub Bot commented on JENA-966:
-

GitHub user ajs6f opened a pull request:

https://github.com/apache/jena/pull/80

Deprecating and removing some iterators from jena-core

https://issues.apache.org/jira/browse/JENA-966

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ajs6f/jena DeprecateSomeIterators

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/80.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #80


commit b58fe263c97da3c51f66872e8e99b07b2d49fcf7
Author: ajs6f aj...@virginia.edu
Date:   2015-06-24T18:04:30Z

Deprecating and removing some iterators from jena-core




 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599856#comment-14599856
 ] 

ASF GitHub Bot commented on JENA-966:
-

Github user ajs6f commented on the pull request:

https://github.com/apache/jena/pull/79#issuecomment-114963573
  
Closed in favor of #80 .


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599857#comment-14599857
 ] 

ASF GitHub Bot commented on JENA-966:
-

Github user ajs6f closed the pull request at:

https://github.com/apache/jena/pull/79


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-24 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14599853#comment-14599853
 ] 

ASF GitHub Bot commented on JENA-966:
-

Github user ajs6f commented on the pull request:

https://github.com/apache/jena/pull/79#issuecomment-114963486
  
Closed in favor of #80 .


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-23 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14598364#comment-14598364
 ] 

Andy Seaborne commented on JENA-966:


The contract for {{Supplier}} is not specific enough for that use.

{{Supplier::get}} can return a different object each time or not.  It may be a 
factory pattern, it may be container, it may be a delayed slot . The javadoc 
contract does not say it is not the same object each time. When the result is 
stateful, like an iterator, that matters.

For example: {{first.andThen(() - bigThing.createIterator())}}. So I think 
that {{Supplier::get}} must be called only once to be safe.



 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-23 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14597501#comment-14597501
 ] 

A. Soroka commented on JENA-966:


I'm happy to leave this to y'all. I understand the desire to keep the interface 
as narrow as possible, although I really do think that laziness is a natural 
pairing.

On that minor point: I'm afraid you're wrong about the laziness of my design, 
[@andy.seaborne]. If you look at the sample I give above, you will see that 
every execution path containing {{Supplier::get}} goes through an {{Iterator}} 
method. So it's fully lazy: {{Supplier:: get}} isn't called until an 
{{Iterator}} method is called. {{Supllier}} is a very good way to induce 
laziness. :)

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596485#comment-14596485
 ] 

A. Soroka commented on JENA-966:


I would rather actually remove the {{LazyIterator}} class and use built-in Java 
8 functionality (i.e. {{Supplier}}.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596545#comment-14596545
 ] 

A. Soroka commented on JENA-966:


Just as a sidenote for anyone following this who is not familiar with the use 
of {{Supplier}}: {{Supplier}} is not part of the Java 8 Stream API, it's part 
of the Function API. It is a very simple SAM interface that is intended to hold 
a computation. So one might do:

{code}
# the only cost of the line below is an assignment
SupplierFoo fooForLater = () - expensiveCompution();

# do some other stuff

# the line below is where we pay the cost of expensiveCompution()
Foo myFoo = fooForLater.get();
{/code}

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596710#comment-14596710
 ] 

Andy Seaborne commented on JENA-966:


Adding {{andThen(SupplierIteratorT)}} to {{ExtendedIterator}} complicates 
the {{ExtendedIterator}} interface. Some of the {{ExtendedIterator}} uses are 
in the visible graph SPI so this is not just clearing up.

Better to build around the concept of iterators and have an (extended) 
iterator that provides the delay.  i.e. a {{LazyIterator}} which internally 
delays is cleaner IMO because it encapsulates the supplier in a class, not a 
general interface.

So minimal change:  
{{public LazyIterator(SupplierExtendedIteratorT)}} rather than LazyIterator 
being abstract with {{create()}}.  {{Supplier.get()}} is called when 
{{lazy()}} is called.  Then have {{create() { return supplier.get();} }}.
Fixing up {{LazyIterator}} is a point-wise issue, especially as 
{{LazyIterator}} isn't currently in-use.  

I'm unclear about the idea of an epic for iterators in general.  If it is all 
(Extended)Iterators, it sounds like a major undertaking with wide repercussions 
yet there is no obvious benefit driven by changes to a class not in use.  If 
the epic is for LazyIterator, I don't care.  Or remove LazyIterator from 
jena-core and take the code where it is wanted.



Minor observations:

{{LazyIterator}} delays until first call, typically {{hasNext}] or {{next}} ; 
{{andThen(SupplierExtendedIteratorT)}} delays only until creation of the 
andThen step.  That's not quite the same.  (Note the {{Supplier}} generic 
signature.)

{{LazyIterator}} already has andThen, but it's got the wrong signature, so 
that leaves toSet and toList.  

If {{LazyIterator}} becomes concrete, then that needs fixing. As a abstract 
class leaving toSet and toList (terminal operations) to the concrete 
implementation makes sense to me but if someone wants to make {{LazyIterator}} 
concrete, they will be needed. Or extend {{NiceIteratorT}}.



 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596588#comment-14596588
 ] 

A. Soroka commented on JENA-966:


[~claudenw], would it be useful to you for me to send a PR showing my proposal 
(adding {{andThen(SupplierIteratorT)}} to {{ExtendedIterator}}? It would 
look something like:

{code}

ExtendedIterator andThen(final SupplierIteratorT nextIterator) {
return andThen(new IteratorT() {

public T next() { return nextIterator.get().next(); }

public boolean hasNext() { return nextIterator.get().hasNext(); }

public void remove() { nextIterator.get().remove); }

} );
}

{code}

and you would invoke it like {{ExtendedIterator joined = first.andThen(() - 
second);}}.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread Claude Warren
My thought was to implement the methods mentioned in the bug using the
NiceIterator.  and leave the create() as abstract so one could simply
implement create() and be done.  And with one simple method it could be
impelemented in an anonymous class ala Map1.

Claude

On Mon, Jun 22, 2015 at 10:48 PM, Andy Seaborne (JIRA) j...@apache.org
wrote:


 [
 https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596710#comment-14596710
 ]

 Andy Seaborne commented on JENA-966:
 

 Adding {{andThen(SupplierIteratorT)}} to {{ExtendedIterator}}
 complicates the {{ExtendedIterator}} interface. Some of the
 {{ExtendedIterator}} uses are in the visible graph SPI so this is not just
 clearing up.

 Better to build around the concept of iterators and have an (extended)
 iterator that provides the delay.  i.e. a {{LazyIterator}} which internally
 delays is cleaner IMO because it encapsulates the supplier in a class, not
 a general interface.

 So minimal change:
 {{public LazyIterator(SupplierExtendedIteratorT)}} rather than
 LazyIterator being abstract with {{create()}}.  {{Supplier.get()}} is
 called when {{lazy()}} is called.  Then have {{create() { return
 supplier.get();} }}.
 Fixing up {{LazyIterator}} is a point-wise issue, especially as
 {{LazyIterator}} isn't currently in-use.

 I'm unclear about the idea of an epic for iterators in general.  If it is
 all (Extended)Iterators, it sounds like a major undertaking with wide
 repercussions yet there is no obvious benefit driven by changes to a class
 not in use.  If the epic is for LazyIterator, I don't care.  Or remove
 LazyIterator from jena-core and take the code where it is wanted.

 

 Minor observations:

 {{LazyIterator}} delays until first call, typically {{hasNext}] or
 {{next}} ; {{andThen(SupplierExtendedIteratorT)}} delays only until
 creation of the andThen step.  That's not quite the same.  (Note the
 {{Supplier}} generic signature.)

 {{LazyIterator}} already has andThen, but it's got the wrong signature,
 so that leaves toSet and toList.

 If {{LazyIterator}} becomes concrete, then that needs fixing. As a
 abstract class leaving toSet and toList (terminal operations) to the
 concrete implementation makes sense to me but if someone wants to make
 {{LazyIterator}} concrete, they will be needed. Or extend
 {{NiceIteratorT}}.



  LazyIterator
  
 
  Key: JENA-966
  URL: https://issues.apache.org/jira/browse/JENA-966
  Project: Apache Jena
   Issue Type: Bug
   Components: Core
 Affects Versions: Jena 3.0.0
 Reporter: Claude Warren
 Assignee: Claude Warren
 
  LazyIterator is an abstract class.  The documentation indicates that the
 create() method needs to be overridden to create an instance.  From this I
 would expect that
  now LazyIterator(){
  @Override
  public ExtendedIteratorModel create() {
...
  }};
  Would work however LazyIterator does not override:
  remoteNext(), andThen(), toList(), and toSet().
  I believe these should be implemented in the class.



 --
 This message was sent by Atlassian JIRA
 (v6.3.4#6332)




-- 
I like: Like Like - The likeliest place on the web
http://like-like.xenei.com
LinkedIn: http://www.linkedin.com/in/claudewarren


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread Claude Warren (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596500#comment-14596500
 ] 

Claude Warren commented on JENA-966:


I don't see how to quickly implement LazyIterator as a Supplier.  How do I 
implement:

ExtendedIterator.andThen( new LazyIterator() ) where the contents of the lazy 
iterator are determined during the processing of the ExtendedIterator.next().

Claude



 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596530#comment-14596530
 ] 

A. Soroka commented on JENA-966:


There's a few points here: 

- I have _not _suggested anything about {{Stream}}s. They just don't have 
anything to do with this. As [~afs] pointed out, {{Stream}}s are not 
{{Iterator}}s, period. They just have no relevance here, so I'm not sure what 
your objection is, in that regard.

- Are you proposing we leave the entire installed base and extended code base 
behind at the 3.0 juncture? I think that's a bit disingenuous. I'm suggesting, 
as I said above, getting rid of three or four types that are either not used 
anywhere in the code base or used only once. That's hardly leaving the entire 
installed base behind, is it? And if a major version change _isn't_ the time 
to make this kind of clean-up, when is? Are all unused but released classes in 
Jena eternal and indestructible? 

- Getting an {{Iterator}} out of a {{SupplierIterator}} is as hard as calling 
{{Supplier::get}}. One method. It is exactly the timing of that method call 
that introduces the laziness. 

I'm happy to let this be. I just don't see as much value in the effort spent 
filling out a class that has never been used as I do in taking advantage of the 
much more idiomatic approach now available in Java 8, as well as removing some 
unused code.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread Claude Warren (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596509#comment-14596509
 ] 

Claude Warren commented on JENA-966:


My other concern is the distance between 2.13 and 3.0  I understand there 
will be refactoring of code involved in the move but to remove all iterators 
and replace them with streams (even if there is a good technical answer for 
Andy's objection) seems like a step (or several) too far.  If I was to approach 
migrating an application from 2.13 and I had to replace all iterators in my 
code I think I would shy away.  Furthermore, older code which will otherwise 
compile under Java 8, will require deep reworking to make it function with Jean 
3.0.

Is there a shim that will turn a Supplier into an Iterator?  Are you proposing 
we leave the entire installed base and extended code base behind at the 3.0 
juncture?   

Claude

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596501#comment-14596501
 ] 

A. Soroka commented on JENA-966:


I'm suggesting that I'd rather remove {{LazyIterator}} and add 
{{andThen(SupplierIteratorT)}}. It seems to me to be a better pattern.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-22 Thread Claude Warren (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14596484#comment-14596484
 ] 

Claude Warren commented on JENA-966:


This bug is for the LazyIterator.  I think we should add the missing 
functionality to bring it up to what I expected (see original report).  All 
discussions about refactoring and deprecating iterators should be on an Jira 
epic.  If there are no objections I will implement the missing functionality 
tomorrow evening and will open the Epic at the same time.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-18 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591752#comment-14591752
 ] 

A. Soroka commented on JENA-966:


Yes. Is that problematic? Isn't the larger strategy to shift non-Jena-specific 
stuff into {{jena-base}} and Atlas?

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-18 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14591746#comment-14591746
 ] 

A. Soroka commented on JENA-966:


I don't think iterator refactoring is what is being discussed here. I think 
what is being discussed is removing classes that aren't ever used and show no 
likelihood of being used. But maybe I'm misinterpreting [~claudenw]'s remarks.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590304#comment-14590304
 ] 

ASF GitHub Bot commented on JENA-966:
-

GitHub user ajs6f opened a pull request:

https://github.com/apache/jena/pull/79

JENA-966: Eliminating some unnecessary iterator types



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/ajs6f/jena JENA-966

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/79.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #79


commit 86588743ad64f8d736278889bc8b0677d8d9fe87
Author: ajs6f aj...@virginia.edu
Date:   2015-06-17T18:43:35Z

JENA-966: Eliminating some unnecessary iterator types




 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590306#comment-14590306
 ] 

A. Soroka commented on JENA-966:


The PR above actually removes the types in question. If it's deemed better to 
merely deprecate them for now, I can add them back in deprecated. It does seem 
to me that a major version bump is actually a _good_ time to remove stuff, but 
I don't have a great sense of how responsive the Jena community is.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590674#comment-14590674
 ] 

Andy Seaborne commented on JENA-966:


{{NiceIterator}} now uses {{Iter.map}} via {{WrappedIterator.create(map(this, 
map1));}}

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590523#comment-14590523
 ] 

Andy Seaborne commented on JENA-966:


I agree - delete it.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590522#comment-14590522
 ] 

Andy Seaborne commented on JENA-966:


I don't think that is a good idea.


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590530#comment-14590530
 ] 

A. Soroka commented on JENA-966:


Re: `Map1Iterator`, I didn't connect it to `Iter::map`, I got rid of it 
completely, with no bad effect. Do you think we should keep it around, and if 
so, when should it be used in preference to `Iter::map`?

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590570#comment-14590570
 ] 

Andy Seaborne commented on JENA-966:


Why is iterator refactoring important?

(and Java8 streams do not replace iterators : they behave differently (no 
.remove, potentially parallel execution, either now or in some future Java 
version))


 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14589458#comment-14589458
 ] 

Andy Seaborne commented on JENA-966:


There are no uses of this class in the codebase anymore.  We can remove it.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


Re: [jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread Claude Warren
I wanted to use it in an application.  Is there a replacement?

On Wed, Jun 17, 2015 at 9:10 AM, Andy Seaborne (JIRA) j...@apache.org
wrote:


 [
 https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14589458#comment-14589458
 ]

 Andy Seaborne commented on JENA-966:
 

 There are no uses of this class in the codebase anymore.  We can remove it.

  LazyIterator
  
 
  Key: JENA-966
  URL: https://issues.apache.org/jira/browse/JENA-966
  Project: Apache Jena
   Issue Type: Bug
   Components: Core
 Affects Versions: Jena 3.0.0
 Reporter: Claude Warren
 Assignee: Claude Warren
 
  LazyIterator is an abstract class.  The documentation indicates that the
 create() method needs to be overridden to create an instance.  From this I
 would expect that
  now LazyIterator(){
  @Override
  public ExtendedIteratorModel create() {
...
  }};
  Would work however LazyIterator does not override:
  remoteNext(), andThen(), toList(), and toSet().
  I believe these should be implemented in the class.



 --
 This message was sent by Atlassian JIRA
 (v6.3.4#6332)




-- 
I like: Like Like - The likeliest place on the web
http://like-like.xenei.com
LinkedIn: http://www.linkedin.com/in/claudewarren


Re: [jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread Andy Seaborne

On 17/06/15 10:07, Claude Warren wrote:

I wanted to use it in an application.  Is there a replacement?


I just found IteratorDelayedInitialization in jena-base.

What also springs to mind is looking at the iterators in Commons.  They 
added forms at your suggestion of looking at jena-core iterators.


Andy




On Wed, Jun 17, 2015 at 9:10 AM, Andy Seaborne (JIRA) j...@apache.org
wrote:



 [
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14589458#comment-14589458
]

Andy Seaborne commented on JENA-966:


There are no uses of this class in the codebase anymore.  We can remove it.


LazyIterator


 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

LazyIterator is an abstract class.  The documentation indicates that the

create() method needs to be overridden to create an instance.  From this I
would expect that

now LazyIterator(){
@Override
public ExtendedIteratorModel create() {
   ...
}};
Would work however LazyIterator does not override:
remoteNext(), andThen(), toList(), and toSet().
I believe these should be implemented in the class.




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)









Re: [jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread Bruno P. Kinoshita
I think there are interesting iterators in Commons Collections and some utility 
code in Commons Functor (unreleased) too.
HTH
Bruno

  From: Andy Seaborne a...@apache.org
 To: dev@jena.apache.org 
 Sent: Wednesday, June 17, 2015 9:50 PM
 Subject: Re: [jira] [Commented] (JENA-966) LazyIterator
   
On 17/06/15 10:07, Claude Warren wrote:
 I wanted to use it in an application.  Is there a replacement?

I just found IteratorDelayedInitialization in jena-base.

What also springs to mind is looking at the iterators in Commons.  They 
added forms at your suggestion of looking at jena-core iterators.

    Andy





 On Wed, Jun 17, 2015 at 9:10 AM, Andy Seaborne (JIRA) j...@apache.org
 wrote:


      [
 https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14589458#comment-14589458
 ]

 Andy Seaborne commented on JENA-966:
 

 There are no uses of this class in the codebase anymore.  We can remove it.

 LazyIterator
 

                  Key: JENA-966
                  URL: https://issues.apache.org/jira/browse/JENA-966
              Project: Apache Jena
          Issue Type: Bug
          Components: Core
    Affects Versions: Jena 3.0.0
            Reporter: Claude Warren
            Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the
 create() method needs to be overridden to create an instance.  From this I
 would expect that
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
                        ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



 --
 This message was sent by Atlassian JIRA
 (v6.3.4#6332)







   


Re: [jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread aj...@virginia.edu
How about using a Java 8 SupplierIteratorT? That's pretty lazy.

---
A. Soroka
The University of Virginia Library

On Jun 17, 2015, at 5:07 AM, Claude Warren cla...@xenei.com wrote:

 I wanted to use it in an application.  Is there a replacement?
 
 On Wed, Jun 17, 2015 at 9:10 AM, Andy Seaborne (JIRA) j...@apache.org
 wrote:
 
 
[
 https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14589458#comment-14589458
 ]
 
 Andy Seaborne commented on JENA-966:
 
 
 There are no uses of this class in the codebase anymore.  We can remove it.
 
 LazyIterator
 
 
Key: JENA-966
URL: https://issues.apache.org/jira/browse/JENA-966
Project: Apache Jena
 Issue Type: Bug
 Components: Core
   Affects Versions: Jena 3.0.0
   Reporter: Claude Warren
   Assignee: Claude Warren
 
 LazyIterator is an abstract class.  The documentation indicates that the
 create() method needs to be overridden to create an instance.  From this I
 would expect that
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
  ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.
 
 
 
 --
 This message was sent by Atlassian JIRA
 (v6.3.4#6332)
 
 
 
 
 -- 
 I like: Like Like - The likeliest place on the web
 http://like-like.xenei.com
 LinkedIn: http://www.linkedin.com/in/claudewarren



[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590002#comment-14590002
 ] 

A. Soroka commented on JENA-966:


There is also {{LateBindingIterator}} which is only used by {{Unparser}}, and 
its use there could be replaced with a {{SupplierIteratorResource}}.

There is also {{EarlyBindingIterator}}, which is used nowhere and is a little 
bit confusing, too.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590012#comment-14590012
 ] 

A. Soroka commented on JENA-966:


I think it could be argued that {{Map1Iterator}} should be deprecated in favor 
of using {{Iter::map}}.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590036#comment-14590036
 ] 

A. Soroka commented on JENA-966:


{{SingletonIterator}} could be plausibly be deprecated in favor of Guava's 
{{Iterators::singletonIterator}}.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-966) LazyIterator

2015-06-17 Thread A. Soroka (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-966?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14590038#comment-14590038
 ] 

A. Soroka commented on JENA-966:


{{UniqueExtendedIterator}} is not used anywhere, and even its own comments say, 
This class may be deprecated in the future.  New development should use use 
codeUniqueFilter/code for simple filtering of an ExtendedIterator, for more 
complex filtering implement a custom codeFilter/code.

 LazyIterator
 

 Key: JENA-966
 URL: https://issues.apache.org/jira/browse/JENA-966
 Project: Apache Jena
  Issue Type: Bug
  Components: Core
Affects Versions: Jena 3.0.0
Reporter: Claude Warren
Assignee: Claude Warren

 LazyIterator is an abstract class.  The documentation indicates that the 
 create() method needs to be overridden to create an instance.  From this I 
 would expect that 
 now LazyIterator(){
 @Override
 public ExtendedIteratorModel create() {
   ...
 }};
 Would work however LazyIterator does not override:
 remoteNext(), andThen(), toList(), and toSet().
 I believe these should be implemented in the class.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)