[Bug 89] New: Replace StringBuffer with StringBuilder as much as possible

View: New views
3 Messages — Rating Filter:   Alert me  

[Bug 89] New: Replace StringBuffer with StringBuilder as much as possible

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=89

           Summary: Replace StringBuffer with StringBuilder as much as
                    possible
           Product: SLF4J
           Version: 1.5.x
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: Core API
        AssignedTo: dev@...
        ReportedBy: rick.beton@...


StringBuilder should be used for EVERY local variable that is currently a
StringBuffer. In such cases, there is no risk of a race condition and the
better performance of StringBuilder is desirable.

Examples of StringBuffer local variables which should be a StringBuilder:
* org.slf4j.helpers.MessageFormatter.arrayFormat
* org.slf4j.helpers.BasicMarker.toString


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 89] Replace StringBuffer with StringBuilder as much as possible

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=89


listid@... changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #1 from listid@...  2008-06-22 15:45 -------

Hello Rick,

Thank you for this report. SLF4J is targeted at JDK 1.3 and later. As such, we
can't use features introduced in JDK 1.5, in particular StringBuilder.

Marking this report as INVALID.




--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev

[Bug 89] Replace StringBuffer with StringBuilder as much as possible

by Bugzilla from bugzilla-daemon@pixie.qos.ch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

http://bugzilla.slf4j.org/show_bug.cgi?id=89





------- Comment #2 from rick.beton@...  2008-06-25 11:56 -------
That's not an unreasonable choice.

JDK1.3 reached its official end of life on December 2006 although it is
supported on Solaris until 2009. [http://java.sun.com/j2se/1.3.1/download.html]

JDK1.4 reaches its end of life this coming October.
[http://java.sun.com/j2se/1.4.2/download.html]

However, there might be a improvement for newer JDK users by removing the
StringBuffers and using the concatenation '+' operator instead. This will
worsen performance on JDK1.3/1.4 but improve it on JDK1.5/1.6, for which the
compilers automatically insert the new StringBuilder.


--
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
dev mailing list
dev@...
http://www.slf4j.org/mailman/listinfo/dev