Java Code Examples for sun.invoke.util.Wrapper#BOOLEAN
The following examples show how to use
sun.invoke.util.Wrapper#BOOLEAN .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExplicitCastArgumentsTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Tests that primitive is successfully converted to wrapper reference * types, to the Number type (if possible) and to the Object type. */ public static void testPrim2Ref() { for (Wrapper from : Wrapper.values()) { for (Wrapper to : Wrapper.values()) { if (from == Wrapper.VOID || from == Wrapper.OBJECT || to == Wrapper.VOID || to == Wrapper.OBJECT) { continue; } Object value = RANDOM_VALUES.get(from); for (TestConversionMode mode : TestConversionMode.values()) { if (from == to) { testConversion(mode, from.primitiveType(), to.wrapperType(), value, value, false, null); } else { testConversion(mode, from.primitiveType(), to.wrapperType(), value, null, true, ClassCastException.class); } if (from != Wrapper.BOOLEAN && from != Wrapper.CHAR) { testConversion(mode, from.primitiveType(), Number.class, value, value, false, null); } else { testConversion(mode, from.primitiveType(), Number.class, value, null, true, ClassCastException.class); } testConversion(mode, from.primitiveType(), Object.class, value, value, false, null); } } } }
Example 2
Source File: ExplicitCastArgumentsTest.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Tests that primitive is successfully converted to wrapper reference * types, to the Number type (if possible) and to the Object type. */ public static void testPrim2Ref() { for (Wrapper from : Wrapper.values()) { for (Wrapper to : Wrapper.values()) { if (from == Wrapper.VOID || from == Wrapper.OBJECT || to == Wrapper.VOID || to == Wrapper.OBJECT) { continue; } Object value = RANDOM_VALUES.get(from); for (TestConversionMode mode : TestConversionMode.values()) { if (from == to) { testConversion(mode, from.primitiveType(), to.wrapperType(), value, value, false, null); } else { testConversion(mode, from.primitiveType(), to.wrapperType(), value, null, true, ClassCastException.class); } if (from != Wrapper.BOOLEAN && from != Wrapper.CHAR) { testConversion(mode, from.primitiveType(), Number.class, value, value, false, null); } else { testConversion(mode, from.primitiveType(), Number.class, value, null, true, ClassCastException.class); } testConversion(mode, from.primitiveType(), Object.class, value, value, false, null); } } } }
Example 3
Source File: ExplicitCastArgumentsTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Tests that primitive is successfully converted to wrapper reference * types, to the Number type (if possible) and to the Object type. */ public static void testPrim2Ref() { for (Wrapper from : Wrapper.values()) { for (Wrapper to : Wrapper.values()) { if (from == Wrapper.VOID || from == Wrapper.OBJECT || to == Wrapper.VOID || to == Wrapper.OBJECT) { continue; } Object value = RANDOM_VALUES.get(from); for (TestConversionMode mode : TestConversionMode.values()) { if (from == to) { testConversion(mode, from.primitiveType(), to.wrapperType(), value, value, false, null); } else { testConversion(mode, from.primitiveType(), to.wrapperType(), value, null, true, ClassCastException.class); } if (from != Wrapper.BOOLEAN && from != Wrapper.CHAR) { testConversion(mode, from.primitiveType(), Number.class, value, value, false, null); } else { testConversion(mode, from.primitiveType(), Number.class, value, null, true, ClassCastException.class); } testConversion(mode, from.primitiveType(), Object.class, value, value, false, null); } } } }
Example 4
Source File: ExplicitCastArgumentsTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Tests that primitive is successfully converted to wrapper reference * types, to the Number type (if possible) and to the Object type. */ public static void testPrim2Ref() { for (Wrapper from : Wrapper.values()) { for (Wrapper to : Wrapper.values()) { if (from == Wrapper.VOID || from == Wrapper.OBJECT || to == Wrapper.VOID || to == Wrapper.OBJECT) { continue; } Object value = RANDOM_VALUES.get(from); for (TestConversionMode mode : TestConversionMode.values()) { if (from == to) { testConversion(mode, from.primitiveType(), to.wrapperType(), value, value, false, null); } else { testConversion(mode, from.primitiveType(), to.wrapperType(), value, null, true, ClassCastException.class); } if (from != Wrapper.BOOLEAN && from != Wrapper.CHAR) { testConversion(mode, from.primitiveType(), Number.class, value, value, false, null); } else { testConversion(mode, from.primitiveType(), Number.class, value, null, true, ClassCastException.class); } testConversion(mode, from.primitiveType(), Object.class, value, value, false, null); } } } }
Example 5
Source File: ExplicitCastArgumentsTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Tests that primitive is successfully converted to wrapper reference * types, to the Number type (if possible) and to the Object type. */ public static void testPrim2Ref() { for (Wrapper from : Wrapper.values()) { for (Wrapper to : Wrapper.values()) { if (from == Wrapper.VOID || from == Wrapper.OBJECT || to == Wrapper.VOID || to == Wrapper.OBJECT) { continue; } Object value = RANDOM_VALUES.get(from); for (TestConversionMode mode : TestConversionMode.values()) { if (from == to) { testConversion(mode, from.primitiveType(), to.wrapperType(), value, value, false, null); } else { testConversion(mode, from.primitiveType(), to.wrapperType(), value, null, true, ClassCastException.class); } if (from != Wrapper.BOOLEAN && from != Wrapper.CHAR) { testConversion(mode, from.primitiveType(), Number.class, value, value, false, null); } else { testConversion(mode, from.primitiveType(), Number.class, value, null, true, ClassCastException.class); } testConversion(mode, from.primitiveType(), Object.class, value, value, false, null); } } } }
Example 6
Source File: ExplicitCastArgumentsTest.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Tests that primitive is successfully converted to wrapper reference * types, to the Number type (if possible) and to the Object type. */ public static void testPrim2Ref() { for (Wrapper from : Wrapper.values()) { for (Wrapper to : Wrapper.values()) { if (from == Wrapper.VOID || from == Wrapper.OBJECT || to == Wrapper.VOID || to == Wrapper.OBJECT) { continue; } Object value = RANDOM_VALUES.get(from); for (TestConversionMode mode : TestConversionMode.values()) { if (from == to) { testConversion(mode, from.primitiveType(), to.wrapperType(), value, value, false, null); } else { testConversion(mode, from.primitiveType(), to.wrapperType(), value, null, true, ClassCastException.class); } if (from != Wrapper.BOOLEAN && from != Wrapper.CHAR) { testConversion(mode, from.primitiveType(), Number.class, value, value, false, null); } else { testConversion(mode, from.primitiveType(), Number.class, value, null, true, ClassCastException.class); } testConversion(mode, from.primitiveType(), Object.class, value, value, false, null); } } } }
Example 7
Source File: ExplicitCastArgumentsTest.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Tests that primitive is successfully converted to wrapper reference * types, to the Number type (if possible) and to the Object type. */ public static void testPrim2Ref() { for (Wrapper from : Wrapper.values()) { for (Wrapper to : Wrapper.values()) { if (from == Wrapper.VOID || from == Wrapper.OBJECT || to == Wrapper.VOID || to == Wrapper.OBJECT) { continue; } Object value = RANDOM_VALUES.get(from); for (TestConversionMode mode : TestConversionMode.values()) { if (from == to) { testConversion(mode, from.primitiveType(), to.wrapperType(), value, value, false, null); } else { testConversion(mode, from.primitiveType(), to.wrapperType(), value, null, true, ClassCastException.class); } if (from != Wrapper.BOOLEAN && from != Wrapper.CHAR) { testConversion(mode, from.primitiveType(), Number.class, value, value, false, null); } else { testConversion(mode, from.primitiveType(), Number.class, value, null, true, ClassCastException.class); } testConversion(mode, from.primitiveType(), Object.class, value, value, false, null); } } } }
Example 8
Source File: ExplicitCastArgumentsTest.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * Tests that primitive is successfully converted to wrapper reference * types, to the Number type (if possible) and to the Object type. */ public static void testPrim2Ref() { for (Wrapper from : Wrapper.values()) { for (Wrapper to : Wrapper.values()) { if (from == Wrapper.VOID || from == Wrapper.OBJECT || to == Wrapper.VOID || to == Wrapper.OBJECT) { continue; } Object value = RANDOM_VALUES.get(from); for (TestConversionMode mode : TestConversionMode.values()) { if (from == to) { testConversion(mode, from.primitiveType(), to.wrapperType(), value, value, false, null); } else { testConversion(mode, from.primitiveType(), to.wrapperType(), value, null, true, ClassCastException.class); } if (from != Wrapper.BOOLEAN && from != Wrapper.CHAR) { testConversion(mode, from.primitiveType(), Number.class, value, value, false, null); } else { testConversion(mode, from.primitiveType(), Number.class, value, null, true, ClassCastException.class); } testConversion(mode, from.primitiveType(), Object.class, value, value, false, null); } } } }