You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2016/09/16 08:44:48 UTC
[2/3] jena git commit: play safe in case some future subclass of
WrappedGraph needs sync.
play safe in case some future subclass of WrappedGraph needs sync.
Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/98320b5c
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/98320b5c
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/98320b5c
Branch: refs/heads/master
Commit: 98320b5c73b15d63f2aeb599d9155fe77ed10f78
Parents: a1c0532
Author: Andy Seaborne <an...@apache.org>
Authored: Thu Sep 15 20:15:02 2016 +0100
Committer: Andy Seaborne <an...@apache.org>
Committed: Thu Sep 15 20:15:02 2016 +0100
----------------------------------------------------------------------
.../src/main/java/org/apache/jena/sparql/SystemARQ.java | 9 ++++-----
.../main/java/org/apache/jena/graph/impl/WrappedGraph.java | 4 +++-
2 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/jena/blob/98320b5c/jena-arq/src/main/java/org/apache/jena/sparql/SystemARQ.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/sparql/SystemARQ.java b/jena-arq/src/main/java/org/apache/jena/sparql/SystemARQ.java
index d84a164..173e957 100644
--- a/jena-arq/src/main/java/org/apache/jena/sparql/SystemARQ.java
+++ b/jena-arq/src/main/java/org/apache/jena/sparql/SystemARQ.java
@@ -25,6 +25,7 @@ import java.util.List ;
import org.apache.jena.atlas.lib.Sync ;
import org.apache.jena.graph.Graph ;
import org.apache.jena.graph.compose.Polyadic ;
+import org.apache.jena.graph.impl.WrappedGraph ;
import org.apache.jena.query.ARQ ;
import org.apache.jena.query.Dataset ;
import org.apache.jena.rdf.model.Model ;
@@ -94,9 +95,8 @@ public class SystemARQ
syncGraph(((Polyadic)graph).getBaseGraph()) ;
else if ( graph instanceof GraphWrapper )
syncGraph(((GraphWrapper)graph).get()) ;
-// else if ( graph instanceof WrappedGraph )
-// // Does not expose the WrappedGraph : checking, no subclass needs a sync().
-// syncGraph(((WrappedGraph)graph).get()) ;
+ else if ( graph instanceof WrappedGraph )
+ syncGraph(((WrappedGraph)graph).getWrapped()) ;
else
syncObject(graph) ;
}
@@ -113,7 +113,6 @@ public class SystemARQ
return ;
} else {
Graph gDft = dataset.getDefaultGraph() ;
- // GraphView sync the DatasetGraph leading to possible recursion.
syncIfNotView(gDft) ;
// Go through each graph.
dataset.listGraphNodes().forEachRemaining( gn->syncIfNotView(dataset.getGraph(gn) )) ;
@@ -122,7 +121,7 @@ public class SystemARQ
private static void syncIfNotView(Graph g) {
// GraphView sync calls the DatasetGraph lead to possible recursion.
- if ( !( g instanceof GraphView) )
+ if ( !( g instanceof GraphView) )
sync(g) ;
}
http://git-wip-us.apache.org/repos/asf/jena/blob/98320b5c/jena-core/src/main/java/org/apache/jena/graph/impl/WrappedGraph.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/graph/impl/WrappedGraph.java b/jena-core/src/main/java/org/apache/jena/graph/impl/WrappedGraph.java
index ab14437..391bf9f 100644
--- a/jena-core/src/main/java/org/apache/jena/graph/impl/WrappedGraph.java
+++ b/jena-core/src/main/java/org/apache/jena/graph/impl/WrappedGraph.java
@@ -27,7 +27,9 @@ import org.apache.jena.util.iterator.ExtendedIterator ;
*/
public class WrappedGraph implements GraphWithPerform
{
- protected Graph base;
+ protected final Graph base;
+ public Graph getWrapped() { return base ; }
+
protected GraphEventManager gem;
public WrappedGraph( Graph base )