From: derklaro Date: Tue, 7 Sep 2021 17:22:36 +0000 (+0200) Subject: Lower requirement for an extra type in constructor to Java 7- X-Git-Tag: rel_3_29_0_ga~13^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5d8868c03ac8527a103c09bad52be24a78d80597;p=javassist.git Lower requirement for an extra type in constructor to Java 7- --- diff --git a/src/main/javassist/compiler/MemberCodeGen.java b/src/main/javassist/compiler/MemberCodeGen.java index 48acd137..e8e9912b 100644 --- a/src/main/javassist/compiler/MemberCodeGen.java +++ b/src/main/javassist/compiler/MemberCodeGen.java @@ -648,7 +648,7 @@ public class MemberCodeGen extends CodeGen { throw new CompileError("no such constructor: " + targetClass.getName()); if (declClass != thisClass && AccessFlag.isPrivate(acc)) { - if (declClass.getClassFile().getMajorVersion() < ClassFile.JAVA_11 + if (declClass.getClassFile().getMajorVersion() < ClassFile.JAVA_8 || !isFromSameDeclaringClass(declClass, thisClass)) { desc = getAccessibleConstructor(desc, declClass, minfo); bytecode.addOpcode(Opcode.ACONST_NULL); // the last parameter