--- old/src/java.desktop/share/classes/javax/sound/sampled/DataLine.java 2014-08-26 11:17:29.000000000 +0800 +++ new/src/java.desktop/share/classes/javax/sound/sampled/DataLine.java 2014-08-26 11:17:29.000000000 +0800 @@ -472,21 +472,27 @@ 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(); } } }