[#2937] Fix trailing whitespaces in generated code