Empty new line at the end of the Java source files

前端 未结 9 876
春和景丽
春和景丽 2021-02-01 00:44

In my current project, we always insert an empty new line at the end of the Java source files. We also enforce this with CheckStyle (with error level).

I was searching fo

9条回答
  •  名媛妹妹
    2021-02-01 01:14

    Aside from the already mentioned valid reasons for having a trailing newline character (possible issues with older tools and diff), here is another way to look at it:

    Why special-case the last line by not appending a newline character when all other lines in the file have one?

提交回复
热议问题