code |
For people coming from Java, there's a big difference between
java.lang.StringBuffer and java.lang.StringBuilder. StringBuilder
is unsynchronized and nice if you are building a String in a
method were you don't have to deal with synchronization issues.
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html
I think choosing the name scala.compat.StringBuilder but backing
it with a StringBuffer is confusing to people who would assume
the Java behavior.
I don't know how best to resolve this, but there should be at least
some documentation added to the file.
I don't know how one would resolve this, but something drastic like
this would work :)
1) Keep scala.compat.StringBuilder but build it or enable it only if
-target:jvm-1.5 is used and back it with java.lang.StringBuilder.
2) Introduce scala.compat.StringBuffer that is backed by
java.lang.StringBuffer.
I don't know how one could do this though and keep only one jar file
on the website to distribute.
I know this may break existing code but for people using JDK 1.4, it's
not hard to do a global search and replace on StringBuilder.
Regards,
Blair
|