You can check if it implements the interface.
Other than that the general rule of thumb is that if something is backed by disk or network then it should probably be closed in order to release system resources. Another case is where there is a dependency of some sorts, such as a lock that needs to be released.
Håvard
On 5 Apr 2023, at 10:45, Matthew Nguyen <nguyenm9@xxxxxxx> wrote:
Should they be? If you are querying for triples, how or why do we differentiate whether the returned iterator is AutoCoseable or not?
On Wednesday, April 5, 2023 at 01:48:33 AM EDT, Håvard Ottestad <hmottestad@xxxxxxxxx> wrote:
I don’t think that iterators on models are AutoCloseable.
Håvard
On 4 Apr 2023, at 22:36, Matthew Nguyen via rdf4j-dev <rdf4j-dev@xxxxxxxxxxx> wrote:
Hey folks,
Think there may be an iterator leak around repository handling. Statements are pulled and filtered but not seeing how the returned iterator is ever closed. Relevant code:
https://github.com/eclipse/rdf4j/blob/main/core/repository/api/src/main/java/org/eclipse/rdf4j/repository/config/RepositoryConfig.java#L155
https://github.com/eclipse/rdf4j/blob/main/core/model/src/main/java/org/eclipse/rdf4j/model/util/Models.java#L97
Can someone more knowledgeable about this code comment?
thx, matt
_______________________________________________rdf4j-dev mailing listrdf4j-dev@xxxxxxxxxxxTo unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/rdf4j-dev