Skip to content

Commit

Permalink
Lower requirement for an extra type in constructor to Java 7-
Browse files Browse the repository at this point in the history
  • Loading branch information
derklaro committed Sep 7, 2021
1 parent 047f7c7 commit 5d8868c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/javassist/compiler/MemberCodeGen.java
Expand Up @@ -648,7 +648,7 @@ private void atMethodCallCore2(CtClass targetClass, String mname,
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
Expand Down

0 comments on commit 5d8868c

Please sign in to comment.