You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@clerezza.apache.org by re...@apache.org on 2014/03/01 15:25:21 UTC
git commit: CLEREZZA-884: not attempting to call close() on null
Repository: clerezza
Updated Branches:
refs/heads/master 2c92e727f -> be79aeddb
CLEREZZA-884: not attempting to call close() on null
Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/be79aedd
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/be79aedd
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/be79aedd
Branch: refs/heads/master
Commit: be79aeddb22c5416f7e6195c76b417d95b81b8c0
Parents: 2c92e72
Author: retobg <re...@apache.org>
Authored: Sat Mar 1 15:25:04 2014 +0100
Committer: retobg <re...@apache.org>
Committed: Sat Mar 1 15:25:04 2014 +0100
----------------------------------------------------------------------
.../org/apache/clerezza/rdf/file/storage/FileMGraph.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/clerezza/blob/be79aedd/rdf.file.storage/src/main/java/org/apache/clerezza/rdf/file/storage/FileMGraph.java
----------------------------------------------------------------------
diff --git a/rdf.file.storage/src/main/java/org/apache/clerezza/rdf/file/storage/FileMGraph.java b/rdf.file.storage/src/main/java/org/apache/clerezza/rdf/file/storage/FileMGraph.java
index bc2fea1..9fdde45 100644
--- a/rdf.file.storage/src/main/java/org/apache/clerezza/rdf/file/storage/FileMGraph.java
+++ b/rdf.file.storage/src/main/java/org/apache/clerezza/rdf/file/storage/FileMGraph.java
@@ -29,6 +29,8 @@ import java.net.URI;
import java.util.Collection;
import java.util.Iterator;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import org.apache.clerezza.rdf.core.Graph;
import org.apache.clerezza.rdf.core.NonLiteral;
import org.apache.clerezza.rdf.core.Resource;
@@ -179,17 +181,19 @@ public class FileMGraph extends SimpleMGraph {
private void writeToFile() {
synchronized(this) {
- OutputStream out = null;
+ OutputStream out;
try {
out = new FileOutputStream(file);
- serializer.serialize(out, this, fileType);
} catch (FileNotFoundException ex) {
throw new RuntimeException(ex);
+ }
+ try {
+ serializer.serialize(out, this, fileType);
} finally {
try {
out.close();
} catch (IOException ex) {
- new RuntimeException(ex);
+ throw new RuntimeException(ex);
}
}
}