We use System.lineSeparator in several places in EJBCA. While this practice is often recommended, it should causes system dependent behavior in places where it is undesirable. For example:
- Data in the database, which could prevent a migration between Windows <-> Linux.
- Data sent over the network, for example API responses, which could cause breakage if a client is only tested in an environment using a particular line separator (for example, it has caused test failures on Windows:
We should only use System.lineSeparator in code that does something "OS related", such as writing to a file, inter-process communication (e.g. pipes) and server logging (this includes toString)