src/java.desktop/share/classes/javax/sound/sampled/DataLine.java

Print this page
rev 10525 : 8038277: Improve the bootstrap performance of cacerts keystore (client)
Contributed-by: Otavio Santana <otaviojava@java.net>

@@ -470,23 +470,29 @@
         @Override
         public String toString() {
 
             StringBuilder sb = new StringBuilder();
 
-            if ( (formats.length == 1) && (formats[0] != null) ) {
-                sb.append(" supporting format " + formats[0]);
+            if ((formats.length == 1) && (formats[0] != null)) {
+                sb.append(" supporting format ").append(formats[0]);
             } else if (getFormats().length > 1) {
-                sb.append(" supporting " + getFormats().length + " audio formats");
+                sb.append(" supporting ").append(getFormats().length)
+                        .append(" audio formats");
             }
 
-            if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (maxBufferSize != AudioSystem.NOT_SPECIFIED) ) {
-                sb.append(", and buffers of " + minBufferSize + " to " + maxBufferSize + " bytes");
-            } else if ( (minBufferSize != AudioSystem.NOT_SPECIFIED) && (minBufferSize > 0) ) {
-                sb.append(", and buffers of at least " + minBufferSize + " bytes");
+            if ((minBufferSize != AudioSystem.NOT_SPECIFIED)
+                    && (maxBufferSize != AudioSystem.NOT_SPECIFIED)) {
+                sb.append(", and buffers of ").append(minBufferSize)
+                        .append(" to ").append(maxBufferSize).append(" bytes");
+            } else if ((minBufferSize != AudioSystem.NOT_SPECIFIED)
+                    && (minBufferSize > 0)) {
+                sb.append(", and buffers of at least ").append(minBufferSize)
+                        .append(" bytes");
             } else if (maxBufferSize != AudioSystem.NOT_SPECIFIED) {
-                sb.append(", and buffers of up to " + minBufferSize + " bytes");
+                sb.append(", and buffers of up to ").append(minBufferSize)
+                        .append(" bytes");
             }
 
-            return new String(super.toString() + sb);
+            return super.toString() + sb.toString();
         }
     }
 }