ARTEMIS-5275 use line separator method instead of property

This commit is contained in:
Justin Bertram 2025-01-20 23:33:12 -06:00 committed by Robbie Gemmell
parent 1a7da3a33e
commit b49041ac7d
3 changed files with 3 additions and 3 deletions

View File

@ -202,7 +202,7 @@ public class InstallAbstract extends InputAbstract {
// and then writing out in the new target encoding.. Let's also replace \n with the values
// that is correct for the current platform.
String separator = unixTarget && IS_NIX ? "\n" : System.getProperty("line.separator");
String separator = unixTarget && IS_NIX ? "\n" : System.lineSeparator();
content = content.replaceAll("\\r?\\n", Matcher.quoteReplacement(separator));
ByteArrayInputStream in = new ByteArrayInputStream(content.getBytes(encoding));
try (FileOutputStream fout = new FileOutputStream(target)) {

View File

@ -525,7 +525,7 @@ public final class XmlDataExporter extends DBOption {
private static final char INDENT_CHAR = ' ';
private static final String LINE_SEPARATOR = System.getProperty("line.separator");
private static final String LINE_SEPARATOR = System.lineSeparator();
boolean wrap = true;

View File

@ -203,7 +203,7 @@ public class SaslKrb5LDAPSecurityTest extends AbstractLdapTestUnit {
(InetSocketAddress)kdcServer.getTransports()[0].getAcceptor().getLocalAddress();
int port = addr.getPort();
File krb5conf = new File(testDir, "krb5.conf").getAbsoluteFile();
String krb5confBody = MessageFormat.format(sb.toString(), getRealm(), "localhost", Integer.toString(port), System.getProperty("line.separator"));
String krb5confBody = MessageFormat.format(sb.toString(), getRealm(), "localhost", Integer.toString(port), System.lineSeparator());
FileUtils.writeStringToFile(krb5conf, krb5confBody, StandardCharsets.UTF_8);
System.setProperty("java.security.krb5.conf", krb5conf.getAbsolutePath());