Thomas Zander wrote:
> Interresting concept;
> several bugs:
> 1) doing an aquire can return a null;  meaning the toString() 
> can cause nullpointer exceptions.

Only if you use it concurrently from different threads. StringBuilder
isn't thread safe so this is perfectly acceptable.

> 2) the release should be synhronized.

No it shouldn't.

> Hmm; there are several other bugs which have to do with threading..

You might want to study the Java memory model before making such claims.

> A better solution would be have the complete implementation 
> of append() and  toString() in a synchronized block on a lock object.

The whole point of StringBuilder is to avoid synchronization.

Regards,
Jeroen


_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/classpath

Reply via email to