< prev index next >

src/java.base/share/classes/jdk/experimental/value/ValueType.java

Print this page
rev 17247 : [mq]: find-constructor

@@ -267,10 +267,16 @@
             handleMap.put(key, result);
         }
         return result;
     }
 
+    // ()__Value
+    public MethodHandle findConstructor(Lookup lookup, MethodType type) throws NoSuchMethodException, IllegalAccessException {
+        return MethodHandles.filterReturnValue(lookup.findConstructor(boxClass(), type), unbox());
+    }
+
+    // (__Value, T)__Value
     public MethodHandle findWither(Lookup lookup, String name, Class<?> type) throws NoSuchFieldException, IllegalAccessException {
         ValueHandleKey key = ValueHandleKind.WITHER.key(List.of(name, type));
         MethodHandle result = handleMap.get(key);
         if (result == null) {
             String fieldType = BytecodeDescriptor.unparse(type);
< prev index next >