qos-ch / reload4j

reload4j is a drop-in replacement for log4j 1.2.17
Apache License 2.0
148 stars 22 forks source link

Replace StringBuffer with StringBuilder #33

Closed albfernandez closed 2 years ago

albfernandez commented 2 years ago

Reload is setting a minimum java version to 1.5, so we can replace StringBuffer with StringBuilder for some performance gain.

This Pull Request only changes the safe cases: variables privates to a method or used only in private methods calls.

Only changed src/main code, not src/test

ceki commented 2 years ago

Looks good. I suppose all these buffers are short lived and not shared?

albfernandez commented 2 years ago

yep, they are all short lived (only used in a method) and one of them is a parameter for a private method that can be safely replaced too.

Not replaced shared objects because it could be dangerous Not replaced parameters to public / package methods , that will change the API and break clients