[Mulgara-svn] r2057 - trunk/src/jar/resolver/java/org/mulgara/resolver

pag at mulgara.org pag at mulgara.org
Wed Sep 28 19:16:18 UTC 2011


Author: pag
Date: 2011-09-28 19:16:18 +0000 (Wed, 28 Sep 2011)
New Revision: 2057

Modified:
   trunk/src/jar/resolver/java/org/mulgara/resolver/JenaFactoryImpl.java
Log:
Fixed dumpAnonNodes to use StringBuilder instead of a StringWriter

Modified: trunk/src/jar/resolver/java/org/mulgara/resolver/JenaFactoryImpl.java
===================================================================
--- trunk/src/jar/resolver/java/org/mulgara/resolver/JenaFactoryImpl.java	2011-09-28 19:12:01 UTC (rev 2056)
+++ trunk/src/jar/resolver/java/org/mulgara/resolver/JenaFactoryImpl.java	2011-09-28 19:16:18 UTC (rev 2057)
@@ -305,21 +305,11 @@
    * Debug method to see the contents of the internal anonymous node mapping.
    */
   public String dumpAnonNodes() {
-    StringWriter s = new StringWriter();
-    PrintWriter out = new PrintWriter(s);
-    try {
-      for (Map.Entry<BlankNode,com.hp.hpl.jena.graph.Node> e: anonMap.entrySet()) {
-        out.println(e.getKey().toString() + " -> " + e.getValue().toString());
-      }
-      return s.toString();
-    } finally {
-      out.close();
-      try {
-        s.close();
-      } catch (IOException e) {
-        logger.error("Error dumping anonymous nodes", e);
-      }
+    StringBuilder sb = new StringBuilder();
+    for (Map.Entry<BlankNode,com.hp.hpl.jena.graph.Node> e: anonMap.entrySet()) {
+      sb.append(e.getKey()).append(" -> ").append(e.getValue()).append("\n");
     }
+    return sb.toString();
   }
 
 }



More information about the Mulgara-svn mailing list