You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commonsrdf.apache.org by st...@apache.org on 2016/10/07 14:23:31 UTC

[37/50] incubator-commonsrdf git commit: javadoc: when to close the stream/iterable

javadoc: when to close the stream/iterable


Project: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/commit/f4bee879
Tree: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/tree/f4bee879
Diff: http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/diff/f4bee879

Branch: refs/heads/rdf4j
Commit: f4bee8799adc29d58bee4a4d441d7304f56d844b
Parents: 7f4fe0b
Author: Stian Soiland-Reyes <st...@apache.org>
Authored: Fri Oct 7 09:12:56 2016 +0100
Committer: Stian Soiland-Reyes <st...@apache.org>
Committed: Fri Oct 7 09:12:56 2016 +0100

----------------------------------------------------------------------
 .../apache/commons/rdf/rdf4j/RDF4JDataset.java  | 29 +++++++++++---------
 .../apache/commons/rdf/rdf4j/RDF4JGraph.java    | 19 +++++++------
 2 files changed, 27 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/f4bee879/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JDataset.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JDataset.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JDataset.java
index 8ed5d4d..262233e 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JDataset.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JDataset.java
@@ -25,8 +25,6 @@ import org.apache.commons.rdf.api.Dataset;
 import org.apache.commons.rdf.api.IRI;
 import org.apache.commons.rdf.api.Quad;
 import org.apache.commons.rdf.api.RDFTerm;
-import org.apache.commons.rdf.api.Triple;
-import org.eclipse.rdf4j.repository.RepositoryConnection;
 
 
 /**
@@ -40,8 +38,10 @@ public interface RDF4JDataset extends Dataset, RDF4JGraphLike<Quad> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the stream must be closed with {@link Stream#close()} to ensure
-	 * the underlying {@link RepositoryConnection} is closed.
+	 * <p>
+	 * Note that for datasets backed by a repository ({@link #asRepository()} is
+	 * present), the stream <strong>must be closed</strong> with
+	 * {@link Stream#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
 	 * <pre>
@@ -57,7 +57,8 @@ public interface RDF4JDataset extends Dataset, RDF4JGraphLike<Quad> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the stream <strong>must be closed</strong> with
+	 * Note that for datasets backed by a repository ({@link #asRepository()} is
+	 * present), the stream <strong>must be closed</strong> with
 	 * {@link Stream#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
@@ -75,8 +76,10 @@ public interface RDF4JDataset extends Dataset, RDF4JGraphLike<Quad> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the stream must be closed with {@link Stream#close()} to ensure
-	 * the underlying {@link RepositoryConnection} is closed.
+	 * <p>
+	 * Note that for datasets backed by a repository ({@link #asRepository()} is
+	 * present), the stream <strong>must be closed</strong> with
+	 * {@link Stream#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
 	 * <pre>
@@ -93,9 +96,9 @@ public interface RDF4JDataset extends Dataset, RDF4JGraphLike<Quad> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the iterable <strong>must be closed</strong> with
-	 * {@link ClosableIterable#close()}. 
-	 * call 
+	 * Note that for datasets backed by a repository ({@link #asRepository()} is
+	 * present), the iterable <strong>must be closed</strong> with
+	 * {@link ClosableIterable#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
 	 * <pre>
@@ -116,9 +119,9 @@ public interface RDF4JDataset extends Dataset, RDF4JGraphLike<Quad> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the iterable <strong>must be closed</strong> with
-	 * {@link ClosableIterable#close()}. 
-	 * call 
+	 * Note that for datasets backed by a repository ({@link #asRepository()} is
+	 * present), the iterable <strong>must be closed</strong> with
+	 * {@link ClosableIterable#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
 	 * <pre>

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/f4bee879/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java
----------------------------------------------------------------------
diff --git a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java
index c19e14a..6425758 100644
--- a/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java
+++ b/rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/RDF4JGraph.java
@@ -75,10 +75,12 @@ public interface RDF4JGraph extends Graph, RDF4JGraphLike<Triple> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the stream <strong>must be closed</strong> with
+	 * Note that for graphs backed by a repository ({@link #asRepository()} is
+	 * present), the stream <strong>must be closed</strong> with
 	 * {@link Stream#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
+	 * 
 	 * <pre>
 	 * int subjects;
 	 * try (Stream&lt;RDF4JTriple&gt; s : graph.stream()) {
@@ -92,7 +94,8 @@ public interface RDF4JGraph extends Graph, RDF4JGraphLike<Triple> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the stream <strong>must be closed</strong> with
+	 * Note that for graphs backed by a repository ({@link #asRepository()} is
+	 * present), the stream <strong>must be closed</strong> with
 	 * {@link Stream#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
@@ -110,9 +113,9 @@ public interface RDF4JGraph extends Graph, RDF4JGraphLike<Triple> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the iterable <strong>must be closed</strong> with
-	 * {@link ClosableIterable#close()}. 
-	 * call 
+	 * Note that for graphs backed by a repository ({@link #asRepository()} is
+	 * present), the iterable <strong>must be closed</strong> with
+	 * {@link ClosableIterable#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
 	 * <pre>
@@ -132,9 +135,9 @@ public interface RDF4JGraph extends Graph, RDF4JGraphLike<Triple> {
 	/**
 	 * {@inheritDoc}
 	 * <p>
-	 * Note that the iterable <strong>must be closed</strong> with
-	 * {@link ClosableIterable#close()}. 
-	 * call 
+	 * Note that for graphs backed by a repository ({@link #asRepository()} is
+	 * present), the iterable <strong>must be closed</strong> with
+	 * {@link ClosableIterable#close()}.
 	 * <p>
 	 * This can generally achieved using a try-with-resources block, e.g.:
 	 * <pre>