[libbluray-devel] Use StringBuffer

hpi1 git at videolan.org
Mon Jan 26 08:47:46 CET 2015


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Nov 24 11:50:05 2014 +0200| [10415c2dff6c41f54b7ad6caa145b011224e6bd7] | committer: hpi1

Use StringBuffer

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=10415c2dff6c41f54b7ad6caa145b011224e6bd7
---

 src/libbluray/bdj/java/org/videolan/Logger.java |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/libbluray/bdj/java/org/videolan/Logger.java b/src/libbluray/bdj/java/org/videolan/Logger.java
index e5988b7..1d013e8 100644
--- a/src/libbluray/bdj/java/org/videolan/Logger.java
+++ b/src/libbluray/bdj/java/org/videolan/Logger.java
@@ -122,14 +122,18 @@ public class Logger {
     }
 
     public static String dumpStack() {
-        String dump = "";
         StackTraceElement e[] = new Exception("Stack trace").getStackTrace();
         if (e != null && e.length > 1) {
-            dump = "\t" + e[2].toString();
-            for (int i = 3; i < e.length; i++)
-                dump += "\n\t" + e[i].toString();
+            StringBuffer dump = new StringBuffer();
+            dump.append("\t");
+            dump.append(e[2].toString());
+            for (int i = 3; i < e.length; i++) {
+                dump.append("\n\t");
+                dump.append(e[i].toString());
+            }
+            return dump.toString();
         }
-        return dump;
+        return "";
     }
 
     public void unimplemented(String func) {



More information about the libbluray-devel mailing list