commonsrdf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject [1/5] incubator-commonsrdf git commit: Avoid concurrency issues in JsonLdDataset.size()
Date Fri, 04 Nov 2016 09:02:01 GMT
Repository: incubator-commonsrdf
Updated Branches:
  refs/heads/master 89f532838 -> c6fe35a03


Avoid concurrency issues in JsonLdDataset.size()

Added JsonLdDatasetTest


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

Branch: refs/heads/master
Commit: ecdcd23169d983ec19d592a7925268984993197d
Parents: 89f5328
Author: Stian Soiland-Reyes <stain@apache.org>
Authored: Fri Nov 4 09:21:21 2016 +0100
Committer: Stian Soiland-Reyes <stain@apache.org>
Committed: Fri Nov 4 09:22:29 2016 +0100

----------------------------------------------------------------------
 .../commons/rdf/jsonldjava/JsonLdDataset.java   |  2 +-
 .../rdf/jsonldjava/JsonLdDatasetTest.java       | 30 ++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/ecdcd231/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdDataset.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdDataset.java
b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdDataset.java
index 72aadc2..b191745 100644
--- a/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdDataset.java
+++ b/jsonld-java/src/main/java/org/apache/commons/rdf/jsonldjava/JsonLdDataset.java
@@ -98,7 +98,7 @@ class JsonLdDatasetImpl extends AbstractJsonLdGraphLike<org.apache.commons.rdf.a
 
     @Override
     public long size() {
-        return rdfDataSet.graphNames().parallelStream().map(rdfDataSet::getQuads)
+        return rdfDataSet.graphNames().stream().map(rdfDataSet::getQuads)
                 .collect(Collectors.summingLong(List::size));
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-commonsrdf/blob/ecdcd231/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdDatasetTest.java
----------------------------------------------------------------------
diff --git a/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdDatasetTest.java
b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdDatasetTest.java
new file mode 100644
index 0000000..d5e6309
--- /dev/null
+++ b/jsonld-java/src/test/java/org/apache/commons/rdf/jsonldjava/JsonLdDatasetTest.java
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.rdf.jsonldjava;
+
+import org.apache.commons.rdf.api.AbstractDatasetTest;
+import org.apache.commons.rdf.api.RDF;
+
+public class JsonLdDatasetTest extends AbstractDatasetTest {
+
+    @Override
+    public RDF createFactory() {
+        return new JsonLdRDF();
+    }
+
+}


Mime
View raw message