I saw you are using Eclipse, I probably also has the option to remove trailing whitespace. Please turn it on.