|
|
|
the problem is that StringBuilder is not available on 1.4. As long as we want to be compatible with 1.4 we have to be carefull about using classes of 1.5 or later. Even if we are plitting DefaultGroovyMethods in methods for 1.5 and ones for 1.4, we still have the problem, that this would not compile on 1.4 then. We need to find a suitable mechanism for that first. Any suggestions are welcome
The difficulty here is that not supporting classes such as StringBuilder in JDK 1.5 labels Groovy as a legacy product. People who use JDK 1.5 know that StrigBuilder is for normal use and StringBuffer is used only in multithreaded shared object cases because of the high overhead of synchronization.
The upshot of this is that we need a JDK 1.5 version of Groovy and a JDK 1.4 version of Groovy. Given the amount of String handling in Groovy, using StringBuilder rather than StringBuffer in Groovy would likely make things faster as well. But this is a guess. In effect we need conditional compilation in Java as is available in C and C++ – this avoids the run-time overhead of making decisions at run time. Using CPP itself is probably not a good move. I don't know if Maven 2 supports this sort of compilation activity. |
||||||||||||||||||||||||||||||||||||||||||||
sb << "foo"
but not w/ StringBuilder.