[GitHub] jena pull request #407: Cleanup
Github user asfgit closed the pull request at: https://github.com/apache/jena/pull/407 ---
[GitHub] jena pull request #407: Cleanup
Github user afs commented on a diff in the pull request: https://github.com/apache/jena/pull/407#discussion_r183833097 --- Diff: jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/DatasetGraphSwitchable.java --- @@ -111,7 +112,8 @@ public Graph getDefaultGraph() { @Override public Graph getGraph(Node gn) { -return ngCache.getOrFill(gn, ()->GraphViewSwitchable.createNamedGraph(this, gn)); +Node key = ( gn != null ) ? gn : Quad.defaultGraphNodeGenerated; +return ngCache.getOrFill(gn, ()->GraphViewSwitchable.createNamedGraph(this, key)); --- End diff -- Yes, doh! Thanks for spotting that. ---
[GitHub] jena pull request #407: Cleanup
Github user rvesse commented on a diff in the pull request: https://github.com/apache/jena/pull/407#discussion_r183809337 --- Diff: jena-db/jena-tdb2/src/main/java/org/apache/jena/tdb2/store/DatasetGraphSwitchable.java --- @@ -111,7 +112,8 @@ public Graph getDefaultGraph() { @Override public Graph getGraph(Node gn) { -return ngCache.getOrFill(gn, ()->GraphViewSwitchable.createNamedGraph(this, gn)); +Node key = ( gn != null ) ? gn : Quad.defaultGraphNodeGenerated; +return ngCache.getOrFill(gn, ()->GraphViewSwitchable.createNamedGraph(this, key)); --- End diff -- Shouldn't the first `gn` reference on this line also be changed to `key` otherwise you are adding a potentially `null` key to the cache ---
[GitHub] jena pull request #407: Cleanup
GitHub user afs opened a pull request: https://github.com/apache/jena/pull/407 Cleanup A number of small things noticed while investigating a TDB2 report. Includes tweak for JENA-1428 (cleanup) and fix for JENA-1531. You can merge this pull request into a Git repository by running: $ git pull https://github.com/afs/jena cleanup Alternatively you can review and apply these changes as the patch at: https://github.com/apache/jena/pull/407.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #407 ---