attila@1090: /* attila@1090: * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. attila@1090: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. attila@1090: * attila@1090: * This code is free software; you can redistribute it and/or modify it attila@1090: * under the terms of the GNU General Public License version 2 only, as attila@1090: * published by the Free Software Foundation. attila@1090: * attila@1090: * This code is distributed in the hope that it will be useful, but WITHOUT attila@1090: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or attila@1090: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License attila@1090: * version 2 for more details (a copy is included in the LICENSE file that attila@1090: * accompanied this code). attila@1090: * attila@1090: * You should have received a copy of the GNU General Public License version attila@1090: * 2 along with this work; if not, write to the Free Software Foundation, attila@1090: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. attila@1090: * attila@1090: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA attila@1090: * or visit www.oracle.com if you need additional information or have any attila@1090: * questions. attila@1090: */ attila@1090: attila@1090: /** attila@1090: * JDK-8059443: NPE when unboxing return values attila@1090: * attila@1090: * NOTE: this test can only pass when running with a JDK where attila@1090: * JDK-8060483 is also fixed (9b37 or later). attila@1090: * attila@1090: * @test attila@1090: * @run attila@1090: */ attila@1090: attila@1090: var NullProvider = Java.type("jdk.nashorn.test.models.NullProvider"); attila@1090: attila@1090: if (!NullProvider.getBoolean()) { print("yay"); } attila@1090: print(NullProvider.getLong() * (1 << 33)); attila@1090: print(NullProvider.getDouble() / 2.5); attila@1090: print(NullProvider.getInteger() << 1);