Closed GoogleCodeExporter closed 9 years ago
If you look at the bytecode you will notice that only one StringBuilder is
created in the toString method.
The java compiler will generate this for you if you concatenate String objects
in one expression.
The code
return "foo" + x + ":" + y.toString() + " = " + (x == null);
will result in (nearly) the same bytecode as
return new StringBuilder().append("foo").append(x).append(":").append(y.toString()).append(" = ").append(x == null).toString();
If you introduce if-s and for-s, it is a different story.
So unless you can prove the bytecode is wrong we're going to assume lombok does
the right thing.
Original comment by r.spilker
on 5 Feb 2015 at 11:12
Original issue reported on code.google.com by
amine.bouhamidi
on 5 Feb 2015 at 7:08