changeset 3223:a581e5d934a9

IdealGraphVisualizer: replace some single-threaded usages of StringBuffer with StringBuilder
author Peter Hofer <peter.hofer@jku.at>
date Mon, 18 Jul 2011 11:35:16 +0200
parents c762ddb64bc9
children c7171e87154d
files src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.java src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/MultiElement.java src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/LineWidget.java
diffstat 3 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.java	Mon Jul 18 11:56:49 2011 +0200
+++ b/src/share/tools/IdealGraphVisualizer/FilterWindow/src/com/sun/hotspot/igv/filterwindow/FilterTopComponent.java	Mon Jul 18 11:35:16 2011 +0200
@@ -438,13 +438,12 @@
                 is = fo.getInputStream();
                 BufferedReader r = new BufferedReader(new InputStreamReader(is));
                 String s;
-                StringBuffer sb = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 while ((s = r.readLine()) != null) {
                     sb.append(s);
                     sb.append("\n");
                 }
                 code = sb.toString();
-
             } catch (FileNotFoundException ex) {
                 Exceptions.printStackTrace(ex);
             } catch (IOException ex) {
--- a/src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/MultiElement.java	Mon Jul 18 11:56:49 2011 +0200
+++ b/src/share/tools/IdealGraphVisualizer/StructuredText/src/com/sun/hotspot/igv/structuredtext/MultiElement.java	Mon Jul 18 11:35:16 2011 +0200
@@ -92,15 +92,13 @@
         if (s == null) {
             s = "";
         }
-        StringBuffer sb = new StringBuffer(s);
-        while(sb.length() < padding) {
+        StringBuilder sb = new StringBuilder(s);
+        while (sb.length() < padding) {
             sb.insert(0, ' ');
         }
-
         print(sb.toString(), source);
+    }
 
-    }
-    
     public void println() {
         println("");
     }
--- a/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/LineWidget.java	Mon Jul 18 11:56:49 2011 +0200
+++ b/src/share/tools/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/widgets/LineWidget.java	Mon Jul 18 11:35:16 2011 +0200
@@ -147,17 +147,15 @@
             }
         }));
     }
-    
+
     private String generateToolTipText(List<Connection> conn) {
-        StringBuffer sb = new StringBuffer();
-        for(Connection c : conn) {
+        StringBuilder sb = new StringBuilder();
+        for (Connection c : conn) {
             sb.append(c.getToolTipText());
             sb.append("<br>");
         }
         return sb.toString();
     }
-    
-    
 
     public Point getFrom() {
         return from;