From: Andrey Turbanov Date: Wed, 20 Apr 2022 20:20:22 +0000 (+0300) Subject: Use System.lineSeparator() instead of hand-crafted method X-Git-Tag: V1_9_19~11 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f66a4f9b083cf8cf59cce160a5109677d4ea6009;p=aspectj.git Use System.lineSeparator() instead of hand-crafted method --- diff --git a/util/src/main/java/org/aspectj/util/LangUtil.java b/util/src/main/java/org/aspectj/util/LangUtil.java index 7e1c2a253..d916002b6 100644 --- a/util/src/main/java/org/aspectj/util/LangUtil.java +++ b/util/src/main/java/org/aspectj/util/LangUtil.java @@ -37,7 +37,7 @@ import java.util.StringTokenizer; */ public class LangUtil { - public static final String EOL; + public static final String EOL = System.lineSeparator(); public static final String JRT_FS = "jrt-fs.jar"; @@ -54,22 +54,6 @@ public class LangUtil { return vmVersion; } - static { - StringWriter buf = new StringWriter(); - PrintWriter writer = new PrintWriter(buf); - writer.println(""); - String eol = "\n"; - try { - buf.close(); - StringBuffer sb = buf.getBuffer(); - if (sb != null) { - eol = buf.toString(); - } - } catch (Throwable t) { - } - EOL = eol; - } - static { // http://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html // http://openjdk.java.net/jeps/223 "New Version-String Scheme"