From 5d8868c03ac8527a103c09bad52be24a78d80597 Mon Sep 17 00:00:00 2001 From: derklaro Date: Tue, 7 Sep 2021 19:22:36 +0200 Subject: Lower requirement for an extra type in constructor to Java 7- --- src/main/javassist/compiler/MemberCodeGen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3