commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas De Loof <>
Subject Re: [csv] j2se1.3 compatibility / header line writer
Date Mon, 22 May 2006 12:45:41 GMT

>> It is supported in jdk1.3.. Just cast the stringbuffer passed in to 
>> an object, so like
>> StringBuffer.append((Object) StringBuffer)). Much more efficient than 
>> an if...
> Surely a StringBuffer is already an Object?
> Or am I missing something here?
StringBuffer has a new method in Java 1.4 to append another Stringbuffer 
without invoking it's toSring() method.
Code that uses StringBuffer.append(stb) and compiled by a JDK 1.4 will 
not work on Java 1.3.
I miself recommand Using  "StringBuffer.append(stb.toString())" that 
looks better than an apparently useless (Object) cast : checkstyle or 
IDE may warn for unecessary cast.


This message contains information that may be privileged or confidential and is the property
of the Capgemini Group. It is intended only for the person to whom it is addressed. If you
are not the intended recipient,  you are not authorized to read, print, retain, copy, disseminate,
 distribute, or use this message or any part thereof. If you receive this  message in error,
please notify the sender immediately and delete all  copies of this message.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message