rt/emul/compact/src/main/java/java/lang/System.java
brancharithmetic
changeset 1351 f73c1a0234fb
parent 772 d382dacfd73f
parent 1279 6e49193b04f1
child 1361 1b333e5804f5
     1.1 --- a/rt/emul/compact/src/main/java/java/lang/System.java	Tue Feb 26 16:54:16 2013 +0100
     1.2 +++ b/rt/emul/compact/src/main/java/java/lang/System.java	Mon Oct 07 14:20:58 2013 +0200
     1.3 @@ -17,6 +17,8 @@
     1.4   */
     1.5  package java.lang;
     1.6  
     1.7 +import org.apidesign.bck2brwsr.core.JavaScriptBody;
     1.8 +
     1.9  /** Poor man's re-implementation of most important System methods.
    1.10   *
    1.11   * @author Jaroslav Tulach <jtulach@netbeans.org>
    1.12 @@ -33,4 +35,31 @@
    1.13          return org.apidesign.bck2brwsr.emul.lang.System.currentTimeMillis();
    1.14      }
    1.15      
    1.16 +    public static int identityHashCode(Object obj) {
    1.17 +        return obj.defaultHashCode();
    1.18 +    }
    1.19 +
    1.20 +    public static String getProperty(String name) {
    1.21 +        return null;
    1.22 +    }
    1.23 +    
    1.24 +    public static String getProperty(String key, String def) {
    1.25 +        return def;
    1.26 +    }
    1.27 +    
    1.28 +    /**
    1.29 +     * Returns the system-dependent line separator string.  It always
    1.30 +     * returns the same value - the initial value of the {@linkplain
    1.31 +     * #getProperty(String) system property} {@code line.separator}.
    1.32 +     *
    1.33 +     * <p>On UNIX systems, it returns {@code "\n"}; on Microsoft
    1.34 +     * Windows systems it returns {@code "\r\n"}.
    1.35 +     */
    1.36 +    public static String lineSeparator() {
    1.37 +        return "\n";
    1.38 +    }
    1.39 +
    1.40 +    @JavaScriptBody(args = { "exitCode" }, body = "window.close();")
    1.41 +    public static void exit(int exitCode) {
    1.42 +    }
    1.43  }