Menu

#6 Strings class should use StringBuilder, not StringBuffer

v1.0 (example)
closed
None
5
2014-10-14
2014-09-16
No

Pretty straightforward request--use StringBuilder instead of StringBuffer; StringBuffer is synchronized, which is unnecessary in the Strings class.

Discussion

  • Kevin

    Kevin - 2014-09-17

    Matthew, can you give some more context for this request? StringBuilder may be a better choice than StringBuffer, but is there an issue you are trying to address? Do you use Serp directly? Or, are you using it as part of another project (ie. OpenJPA)?

    Serp is a mature utility that does not see a lot of development activity. Actually, this is the first Bug report I've seen since I started to monitor the Serp project several years ago... Any additional justification for this defect would be appreciated. Thanks.

     
  • Matthew Bishop

    Matthew Bishop - 2014-09-17

    This isn't a bug per se, more of a tech debt issue. See the javadocs of StringBuilder for the justification:

    http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/StringBuilder.html

    My interest is in OpenJPA, which uses Serp. I have been working on reducing the amount of BLOCKED threads and have been looking for unnecessary synchronization is occurring.

     
  • Jody Grassel

    Jody Grassel - 2014-10-09
    • status: open --> accepted
    • assigned_to: Jody Grassel
     
  • Jody Grassel

    Jody Grassel - 2014-10-14
    • status: accepted --> closed
     
  • Jody Grassel

    Jody Grassel - 2014-10-14

    Delivered to Serp trunk.

     

Log in to post a comment.