[logback-dev] [JIRA] Created: (LBCLASSIC-111) Improve performance by removing StringBuffer where possible

Rick Beton (JIRA) noreply-jira at qos.ch
Fri Feb 27 15:05:47 CET 2009


Improve performance by removing StringBuffer where possible
-----------------------------------------------------------

                 Key: LBCLASSIC-111
                 URL: http://jira.qos.ch/browse/LBCLASSIC-111
             Project: logback-classic
          Issue Type: Bug
    Affects Versions: 0.9.15
         Environment: any
            Reporter: Rick Beton
            Assignee: Logback dev list
            Priority: Minor


StringBuffer is used in some local variables. The newer StringBuilder alternative will improve the performance slightly in such cases.

E.g.in FileNamePattern

  public String convert(Object o) {
    Converter<Object> p = headTokenConverter;
    StringBuffer buf = new StringBuffer();
    while (p != null) {
      buf.append(p.convert(o));
      p = p.getNext();
    }
    return buf.toString();
  }

should change to use

    StringBuilder buf = new StringBuilder();


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.qos.ch/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the logback-dev mailing list