]> source.dussan.org Git - aspectj.git/commitdiff
Use System.lineSeparator() instead of hand-crafted method
authorAndrey Turbanov <turbanoff@gmail.com>
Wed, 20 Apr 2022 20:20:22 +0000 (23:20 +0300)
committerAlexander Kriegisch <Alexander@Kriegisch.name>
Thu, 21 Apr 2022 03:45:31 +0000 (10:45 +0700)
util/src/main/java/org/aspectj/util/LangUtil.java

index 7e1c2a253da77076b8edfeb5c3473395eeecfc68..d916002b69e3f574a9b4e280442fb97fdc5b6ebf 100644 (file)
@@ -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"