test/compiler/6987555/Test6987555.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 7018277 Cdiff test/compiler/6987555/Test6987555.java

test/compiler/6987555/Test6987555.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 52,63 **** } static void doboolean(boolean x) throws Throwable { if (DEBUG) System.out.println("boolean=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(boolean.class, boolean.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(boolean.class, Boolean.class)); ! boolean a = mh1.<boolean>invokeExact(x); ! boolean b = mh2.<boolean>invokeExact(Boolean.valueOf(x)); assert a == b : a + " != " + b; } // byte static void testbyte() throws Throwable { --- 52,63 ---- } static void doboolean(boolean x) throws Throwable { if (DEBUG) System.out.println("boolean=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(boolean.class, boolean.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(boolean.class, Boolean.class)); ! boolean a = (boolean) mh1.invokeExact(x); ! boolean b = (boolean) mh2.invokeExact(Boolean.valueOf(x)); assert a == b : a + " != " + b; } // byte static void testbyte() throws Throwable {
*** 78,89 **** } static void dobyte(byte x) throws Throwable { if (DEBUG) System.out.println("byte=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(byte.class, byte.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(byte.class, Byte.class)); ! byte a = mh1.<byte>invokeExact(x); ! byte b = mh2.<byte>invokeExact(Byte.valueOf(x)); assert a == b : a + " != " + b; } // char static void testchar() throws Throwable { --- 78,89 ---- } static void dobyte(byte x) throws Throwable { if (DEBUG) System.out.println("byte=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(byte.class, byte.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(byte.class, Byte.class)); ! byte a = (byte) mh1.invokeExact(x); ! byte b = (byte) mh2.invokeExact(Byte.valueOf(x)); assert a == b : a + " != " + b; } // char static void testchar() throws Throwable {
*** 102,113 **** } static void dochar(char x) throws Throwable { if (DEBUG) System.out.println("char=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(char.class, char.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(char.class, Character.class)); ! char a = mh1.<char>invokeExact(x); ! char b = mh2.<char>invokeExact(Character.valueOf(x)); assert a == b : a + " != " + b; } // short static void testshort() throws Throwable { --- 102,113 ---- } static void dochar(char x) throws Throwable { if (DEBUG) System.out.println("char=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(char.class, char.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(char.class, Character.class)); ! char a = (char) mh1.invokeExact(x); ! char b = (char) mh2.invokeExact(Character.valueOf(x)); assert a == b : a + " != " + b; } // short static void testshort() throws Throwable {
*** 132,143 **** } static void doshort(short x) throws Throwable { if (DEBUG) System.out.println("short=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(short.class, short.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(short.class, Short.class)); ! short a = mh1.<short>invokeExact(x); ! short b = mh2.<short>invokeExact(Short.valueOf(x)); assert a == b : a + " != " + b; } // int static void testint() throws Throwable { --- 132,143 ---- } static void doshort(short x) throws Throwable { if (DEBUG) System.out.println("short=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(short.class, short.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(short.class, Short.class)); ! short a = (short) mh1.invokeExact(x); ! short b = (short) mh2.invokeExact(Short.valueOf(x)); assert a == b : a + " != " + b; } // int static void testint() throws Throwable {
*** 162,173 **** } static void doint(int x) throws Throwable { if (DEBUG) System.out.println("int=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(int.class, int.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(int.class, Integer.class)); ! int a = mh1.<int>invokeExact(x); ! int b = mh2.<int>invokeExact(Integer.valueOf(x)); assert a == b : a + " != " + b; } public static boolean foo(boolean i) { return i; } public static byte foo(byte i) { return i; } --- 162,173 ---- } static void doint(int x) throws Throwable { if (DEBUG) System.out.println("int=" + x); MethodHandle mh1 = MethodHandles.lookup().findStatic(CLASS, NAME, MethodType.methodType(int.class, int.class)); MethodHandle mh2 = mh1.asType(MethodType.methodType(int.class, Integer.class)); ! int a = (int) mh1.invokeExact(x); ! int b = (int) mh2.invokeExact(Integer.valueOf(x)); assert a == b : a + " != " + b; } public static boolean foo(boolean i) { return i; } public static byte foo(byte i) { return i; }
test/compiler/6987555/Test6987555.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File