< prev index next >

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

Print this page
@@ -998,11 +998,12 @@
          return isStaticallyInvocable(name.function.member());
      }
  
      static boolean isStaticallyInvocable(MemberName member) {
          if (member == null)  return false;
-         if (member.isConstructor())  return false;
+         if (member.isObjectConstructorOrStaticInitMethod())  return false;
+ 
          Class<?> cls = member.getDeclaringClass();
          // Fast-path non-private members declared by MethodHandles, which is a common
          // case
          if (MethodHandle.class.isAssignableFrom(cls) && !member.isPrivate()) {
              assert(isStaticallyInvocableType(member.getMethodOrFieldType()));
< prev index next >