Replace StringBuffer by StringBuilder
Since JRE5 there is a drop-in replacement for StringBuffer: StringBuilder. That one has the same interface, but is not synchronized. Hence it works faster. :-)
Comments (8)
-
repo owner -
reporter The matcher class requires it? Where?
-
repo owner Even the common String.replaceAll() uses StringBuffer internally.
-
reporter Drat! I hate Sun for their sluttery. While I'm officially a member of OpenJDK for years, I never actually worked on the code itself. I should take action and begin to contribute some code changes. I mean, StringBuilder exits for more than a decade and they still support solely StringBuffer. This makes me sick! ;-)
The crazy thing is that StringBuilder.append(StringBuffer) does exist, but not the reverse. I mean, how dumb can a programmer be to add a complete drop-in replacement but to miss adding two simple lines of code in an existing interface?!
-
repo owner There are many questions like this.
E.g., the new DateTime API hasn't been integrated into existing APIs as well. At least not good. Still everywhere the old java.util.Date type, e.g. https://docs.oracle.com/javase/8/docs/api/java/security/cert/X509Certificate.html#checkValidity-java.util.Date-
or in java.sql.*
Same is true for java.io.File.
-
reporter - changed status to wontfix
Apparently this needs an JRE change, which is simply unrealistic to achieve in a timely manner. :-(
-
repo owner Found another one, which hasn't been adapted: java.text.Format.
-
repo owner - changed status to invalid
- Log in to comment
I know. It's only used in Jid class, though, because the matcher class requires it. Didn't find a way around it yet.