Clean up. Project: http://git-wip-us.apache.org/repos/asf/jena/repo Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/3da5cdee Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/3da5cdee Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/3da5cdee
Branch: refs/heads/master Commit: 3da5cdeede1afb45a3f15c2baf6e3b0eb9788315 Parents: b6d9ffa Author: Andy Seaborne <[email protected]> Authored: Fri May 13 12:42:57 2016 +0100 Committer: Andy Seaborne <[email protected]> Committed: Fri May 13 12:42:57 2016 +0100 ---------------------------------------------------------------------- .../main/java/org/apache/jena/tdb/sys/TDBInternal.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/jena/blob/3da5cdee/jena-tdb/src/main/java/org/apache/jena/tdb/sys/TDBInternal.java ---------------------------------------------------------------------- diff --git a/jena-tdb/src/main/java/org/apache/jena/tdb/sys/TDBInternal.java b/jena-tdb/src/main/java/org/apache/jena/tdb/sys/TDBInternal.java index 2a19c41..83d14c5 100644 --- a/jena-tdb/src/main/java/org/apache/jena/tdb/sys/TDBInternal.java +++ b/jena-tdb/src/main/java/org/apache/jena/tdb/sys/TDBInternal.java @@ -109,12 +109,11 @@ public class TDBInternal * up-to-date. */ public static DatasetGraphTDB getDatasetGraphTDB(DatasetGraph dsg) { - if ( dsg instanceof DatasetGraphTransaction ) - // Latest. - return ((DatasetGraphTransaction)dsg).getDatasetGraphToQuery() ; - // Core. - // .getBaseDatasetGraph() ; - + if ( dsg instanceof DatasetGraphTransaction ) { + // Latest. Must be inside a transaction or completely non-transactional. + // See getBaseDatasetGraphTDB + return ((DatasetGraphTransaction)dsg).getDatasetGraphToQuery() ; + } if ( dsg instanceof DatasetGraphTDB ) return (DatasetGraphTDB)dsg ; @@ -128,7 +127,7 @@ public class TDBInternal public static DatasetGraphTDB getBaseDatasetGraphTDB(DatasetGraph datasetGraph) { if ( datasetGraph instanceof DatasetGraphTransaction ) return ((DatasetGraphTransaction)datasetGraph).getBaseDatasetGraph() ; - throw new TDBException("Not a suitable DatasetGraph to get it's base storage: " + Lib.classShortName(datasetGraph.getClass())) ; + throw new TDBException("Not a suitable DatasetGraph to get its base storage: " + Lib.classShortName(datasetGraph.getClass())) ; } /** Look at a directory and see if it is a new area */
