[ 
https://issues.apache.org/jira/browse/JENA-1956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17205602#comment-17205602
 ] 

Adam Soroka commented on JENA-1956:
-----------------------------------

Yes, that is why wrote "similar" :). In both cases, a change that is positive 
in itself might have unintended consequences wrt user experience (binary-compat 
or not, warnings appear or no). I would also be a little cautious about the 
fact that you might get only one iterator from a {{ResultSet}} (it might be 
remote). That's completely within the contract, but how do we want to signal 
that we can't re-iterate? Throw an exception after the first call to 
{{iterator()}}? Just return an empty {{Iterator}}?

> ResultSet should implement Iterable
> -----------------------------------
>
>                 Key: JENA-1956
>                 URL: https://issues.apache.org/jira/browse/JENA-1956
>             Project: Apache Jena
>          Issue Type: Improvement
>            Reporter: Jan Martin Keil
>            Priority: Major
>
> The class {{ResultSet}} should implement {{Iterable<QuerySolution>}}. That 
> would significantly ease query result processing. It would allow to write
> {code:java}
> for (QuerySolution result : QueryExecutionFactory.create(query, 
> model).execSelect()) {
>   …
> }
> {code}
> instead of
> {code:java}
> ResultSet results = QueryExecutionFactory.create(query, model).execSelect();
> while (results.hasNext()) {
>   QuerySolution result = results.next();
>   …
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to