From ab9c8ecc26b873ccad20fb80323b1232c77cbcfd Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Mon, 12 Mar 2012 19:26:50 +0200 Subject: Add missing java/lang/System.lineSeparator() method Signed-off-by: Pekka Enberg --- ChangeLog | 5 +++++ java/lang/System.java | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 78d9d1860..2613eb74c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-03-12 Pekka Enberg + + * java/lang/System.java: + (lineSeparator): Add missing method. + 2012-03-12 Pekka Enberg * java/lang/reflect/Member.java: diff --git a/java/lang/System.java b/java/lang/System.java index 51b3259fa..9d8699183 100644 --- a/java/lang/System.java +++ b/java/lang/System.java @@ -97,6 +97,8 @@ public final class System */ public static final PrintStream out = VMSystem.makeStandardOutputStream(); + private static final String LINE_SEPARATOR = SystemProperties.getProperty("line.separator"); + /** * The standard output PrintStream. This is assigned at startup and * starts its life perfectly valid. Although it is marked final, you can @@ -712,6 +714,16 @@ public final class System return Console.console(); } + /** + * Returns the system-dependent line separator. + * + * @return the system-dependent line separator. + */ + public static String lineSeparator() + { + return LINE_SEPARATOR; + } + /** * This is a specialised Collection, providing * the necessary provisions for the collections used by the -- cgit v1.2.1