< prev index next >

src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java

Print this page
rev 55090 : secret-sfac

@@ -127,11 +127,11 @@
         if (refKind == REF_invokeSpecial)
             refKind =  REF_invokeVirtual;
         return make(refKind, refc, member, null /* no callerClass context */);
     }
     static DirectMethodHandle make(MemberName member) {
-        if (member.isConstructor())
+        if (member.isConstructor() && member.getReturnType() == void.class)
             return makeAllocator(member);
         return make(member.getDeclaringClass(), member);
     }
     private static DirectMethodHandle makeAllocator(MemberName ctor) {
         assert(ctor.isConstructor() && ctor.getName().equals("<init>"));
< prev index next >