NLS and StringBuffer

I was surprised to find in the M4 News And Noteworthy list a shortcut to change a concatenated String to StringBuffer.

At first, it looks like a good idea.

String s = "offset " + offset + " is at line " + line;

is changed to:

StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("offset ");
stringBuffer.append(offset);
stringBuffer.append(" is at line ");
stringBuffer.append(line);

I know using StringBuffers is better for performance UPDATE: I confused StringBuffer with StringBuilder! look at this bug for changing StringBuffer to StringBuilder.

I would have rather been going for this:

NLS.bind("offset {0} is at line {1}", offset, line);

Just because this is so much easier to internationalize.

I have almost finished doing i18n for the BPMN modeler, a component of the STP project, and I really lost time on such cases.

Just my $0.02!