Aklakan commented on issue #3751:
URL: https://github.com/apache/jena/issues/3751#issuecomment-3903560694
Overall it's ok to wrap the whole body - the relevant bit is that any
iterator created inside of the body must not be left dangling if anything goes
wrong - but that's prevented by `input = peek`:
```java
protected QueryIterator execute(BasicPattern pattern,
ReorderTransformation reorder,
QueryIterator input, ExecutionContext
execCxt) {
try {
// ...
QueryIterPeek peek = QueryIterPeek.create(input,
execCxt) ;
input = peek ;
// ...
} catch (Exception e) { return new QueryIterFailed(input, execCxt,
e); }
}
```
On the PR discussion I also added try-catch on the whole body:
https://github.com/apache/jena/pull/3753#issuecomment-3900352596
Dangling iterators cause open iterator warnings by `QueryIterCheck`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]