--- old/src/java.base/share/classes/java/lang/invoke/MethodHandles.java 2017-06-21 13:11:22.000000000 -0700 +++ new/src/java.base/share/classes/java/lang/invoke/MethodHandles.java 2017-06-21 13:11:21.000000000 -0700 @@ -1262,14 +1262,10 @@ } String name = ""; if (MinimalValueTypes_1_0.isValueType(refc)) { - try { - //shady: The findConstructor method of Lookup will expose all accessible constructors of the original - //value-capable class, for both the Q-type and the legacy L-type. The return type of a method handle produced - //by findConstructor will be identical with the lookup class, even if it is a Q-type. - refc = MinimalValueTypes_1_0.getValueCapableClass(refc); - } catch (ClassNotFoundException ex) { - throw new NoSuchElementException(ex.getMessage()); - } + //shady: The findConstructor method of Lookup will expose all accessible constructors of the original + //value-capable class, for both the Q-type and the legacy L-type. The return type of a method handle produced + //by findConstructor will be identical with the lookup class, even if it is a Q-type. + refc = MinimalValueTypes_1_0.getValueCapableClass(refc); } MemberName ctor = resolveOrFail(REF_newInvokeSpecial, refc, name, type); return getDirectConstructor(refc, ctor); @@ -1426,11 +1422,7 @@ */ public MethodHandle findGetter(Class refc, String name, Class type) throws NoSuchFieldException, IllegalAccessException { if (MinimalValueTypes_1_0.isValueType(refc)) { - try { - return ValueType.forClass(MinimalValueTypes_1_0.getValueCapableClass(refc)).findGetter(this, name, type); - } catch (ReflectiveOperationException ex) { - throw new IllegalStateException(ex); - } + return ValueType.forClass(MinimalValueTypes_1_0.getValueCapableClass(refc)).findGetter(this, name, type); } else { MemberName field = resolveOrFail(REF_getField, refc, name, type); return getDirectField(REF_getField, refc, field); @@ -2610,11 +2602,7 @@ private static ValueType valueComponent(Class clazz) { Class comp = clazz.getComponentType(); if (MinimalValueTypes_1_0.isValueType(comp)) { - try { - return (ValueType)ValueType.forClass(MinimalValueTypes_1_0.getValueCapableClass(comp)); - } catch (ClassNotFoundException ex) { - throw new IllegalStateException(ex); - } + return (ValueType)ValueType.forClass(MinimalValueTypes_1_0.getValueCapableClass(comp)); } else { return null; } @@ -3384,11 +3372,7 @@ if (type.isPrimitive()) { return zero(Wrapper.forPrimitiveType(type), type); } else if (MinimalValueTypes_1_0.isValueType(type)) { - try { - return ValueType.forClass(MinimalValueTypes_1_0.getValueCapableClass(type)).defaultValueConstant(); - } catch (ClassNotFoundException ex) { - throw new IllegalStateException(ex); - } + return ValueType.forClass(MinimalValueTypes_1_0.getValueCapableClass(type)).defaultValueConstant(); } else { return zero(Wrapper.OBJECT, type); } @@ -3426,11 +3410,7 @@ LambdaForm lform = LambdaForm.identityForm(BasicType.basicType(ptype)); return MethodHandleImpl.makeIntrinsic(mtype, lform, Intrinsic.IDENTITY); } else { - try { - return ValueType.forClass(MinimalValueTypes_1_0.getValueCapableClass(ptype)).identity(); - } catch (ReflectiveOperationException ex) { - throw new IllegalStateException(ex); - } + return ValueType.forClass(MinimalValueTypes_1_0.getValueCapableClass(ptype)).identity(); } }