On 13 juil, 10:21, guandalino <[email protected]> wrote: > Hi, GWT provides JRE emulation for both StringBuffer and > StringBuilder. The Java API says that in single threaded environments > the preferred choice is to use StringBuilder as it is faster. I also > remember to have read that browsers way to work is single threaded. > > So I'm wondering why and when one should use StringBuffer at all. Can > you clarify?
Actually, in GWT, both StringBuilder and StringBuffer wrap the same StringBufferImpl implementation, so it really doesn't matter which one you use. StringBuffer is emulated because StringBuilder didn't exist in Java 1.4, and GWT started to support Java 5 only two years ago in GWT 1.5. I think you should now stick to using only one of them, and my preference goes to StringBuilder (if it really is faster, then it should improve performance in DevMode) -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
