test/script/trusted/JDK-8067854.js

Wed, 16 Mar 2016 00:10:12 -0700

author
asaha
date
Wed, 16 Mar 2016 00:10:12 -0700
changeset 1746
09abd795d1d1
parent 1208
0c047f071e50
permissions
-rw-r--r--

Added tag jdk8u77-b01 for changeset 678b645aa10a

sundar@1208 1 /*
sundar@1208 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
sundar@1208 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
sundar@1208 4 *
sundar@1208 5 * This code is free software; you can redistribute it and/or modify it
sundar@1208 6 * under the terms of the GNU General Public License version 2 only, as
sundar@1208 7 * published by the Free Software Foundation.
sundar@1208 8 *
sundar@1208 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sundar@1208 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sundar@1208 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sundar@1208 12 * version 2 for more details (a copy is included in the LICENSE file that
sundar@1208 13 * accompanied this code).
sundar@1208 14 *
sundar@1208 15 * You should have received a copy of the GNU General Public License version
sundar@1208 16 * 2 along with this work; if not, write to the Free Software Foundation,
sundar@1208 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
sundar@1208 18 *
sundar@1208 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sundar@1208 20 * or visit www.oracle.com if you need additional information or have any
sundar@1208 21 * questions.
sundar@1208 22 */
sundar@1208 23
sundar@1208 24 /**
sundar@1208 25 * JDK-8067854: bound java static method throws NPE when 'null' is used for this argument
sundar@1208 26 *
sundar@1208 27 * @test
sundar@1208 28 * @run
sundar@1208 29 */
sundar@1208 30
sundar@1208 31 getProp = java.lang.System.getProperty;
sundar@1208 32
sundar@1208 33 // bind this and an argument. "null" for this as getProperty is a
sundar@1208 34 // static method of java.lang.System
sundar@1208 35 getHome = Function.prototype.bind.call(getProp, null, "java.home");
sundar@1208 36
sundar@1208 37 if (getHome() != getProp("java.home")) {
sundar@1208 38 fail("getHome() failed to get java.home");
sundar@1208 39 }

mercurial