Use System.lineSeparator()

Use the built-in System.lineSeparator() instead of implementing it
ourselves with System.getProperty("line.separator") in order to clean
up the code and make it easier to maintain.
This commit is contained in:
Allon Mureinik 2023-10-05 19:47:33 +03:00
parent fe45fa9cfb
commit 4c8cac22a8

View File

@ -1239,8 +1239,8 @@ public class XMLTest {
for (int numRead; (numRead = in.read(buffer, 0, buffer.length)) > 0; ) { for (int numRead; (numRead = in.read(buffer, 0, buffer.length)) > 0; ) {
expected.append(buffer, 0, numRead); expected.append(buffer, 0, numRead);
} }
assertEquals(expected.toString().replaceAll("\\n|\\r\\n", System.getProperty("line.separator")), assertEquals(expected.toString().replaceAll("\\n|\\r\\n", System.lineSeparator()),
actualString.replaceAll("\\n|\\r\\n", System.getProperty("line.separator"))); actualString.replaceAll("\\n|\\r\\n", System.lineSeparator()));
} finally { } finally {
if (xmlStream != null) { if (xmlStream != null) {
xmlStream.close(); xmlStream.close();