commit | 6bdca5f4a2598b1206d51a59b720314a2f7aa3c1 | [log] [tgz] |
---|---|---|
author | Alex Blewitt <alex.blewitt@gmail.com> | Sat Apr 23 00:00:51 2016 +0100 |
committer | Sergey Prigogin <eclipse.sprigogin@gmail.com> | Mon Apr 25 11:38:47 2016 -0500 |
tree | 6c94852b1cf0abc24dcb1af3ef1526e89314bbe2 | |
parent | e21fc12f9052e99dcf545df4a2ae2aba1c90c1cc [diff] |
Bug 492230 - Replace buffer.append(a+b) calls When using a `StringBuilder` or `StringBuffer` to create a string message, using implicit string concatenation inside an `.append()` call will create a nested StringBuilder for the purposes of creating the arguments, which will subsequently be converted to a String and then passed to the outer StringBuilder. Skip the creation of the intermediate object and String by simply replacing such calls with `buffer.append(a).append(b)`. Where values are compile time String constants, leave as is so that the javac compiler can perform compile-time String concatenation. Ensure that NEWLINE isn't appended in such a way since it is not a compile time constant `System.getProperty("line.separator")` Change-Id: I4126aefb2272f06b08332e004d7ea76b6f02cdba Signed-off-by: Alex Blewitt <alex.blewitt@gmail.com>