On 19/02/2008, David Daney <[EMAIL PROTECTED]> wrote: > Andrew John Hughes wrote: > > I noticed when trying to fix PR34840 that we have > > a lot of duplicate code between StringBuffer and > > StringBuilder. This patch abstracts most of it > > into a common superclass. Testing PR34840 showed > > that OpenJDK already does this. > > > > PR21869 is also then trivial, as we just need an > > additional Classpath string buffer that doesn't > > create a copy when toString() is called (as in > > GCJ). > > > > Comments? I'll commit Monday if there are no > > objections. > > > > I don't object, however it might be interesting to know if this change > would cause performance regressions on <your favorite vm here>. Other > than that, it seems like a good idea. > > David Daney >
This would also be my issue with it, but I think code re-use and overall maintenance of the code has to take precedence. In doing this, I noticed a number of places where the two classes were out of sync with each other. It also makes the difference between the two clearer, and also will enable us to very simply implement a more efficient internal implementation (StringBuilder + no copying, as used in GCJ). That said, I'm going to leave committing it until after the release (which I hope will happen over tomorrow/Thursday) to give people time to grumble :) -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net