Academically curious. Can the JIT take code like this, recognize that the format string is static final and thus precompute the sliced format string, thus optimizing this down to only StringBuilder with minimal appends?
public static String buildDeleteSql(BaseObject object)
{
String table;
String schema;
String deleteSql = String.format(
"DELETE FROM %s.%s WHERE %s = '%s' AND %s = '%s'",
schema,
table,
BaseObject.ATTR_ID,
StringUtils.escapeForSQLString(object.getId()),
BaseObject.ATTR_REVISION,
StringUtils.escapeForSQLString(object.getRevision())
);
return deleteSql;
}