8270949: Make dynamically generated classes with the class file version of the current release

Reviewed-by: alanb
This commit is contained in:
Mandy Chung 2021-07-21 18:09:38 +00:00
parent b7245c6164
commit ddce47cd3c
8 changed files with 20 additions and 7 deletions

View file

@ -25,6 +25,7 @@
package java.lang.reflect;
import jdk.internal.misc.VM;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Label;
import jdk.internal.org.objectweb.asm.MethodVisitor;
@ -55,7 +56,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
* "generateProxyClass" method.
*/
final class ProxyGenerator extends ClassWriter {
private static final int CLASSFILE_VERSION = VM.classFileVersion();
private static final String JL_CLASS = "java/lang/Class";
private static final String JL_OBJECT = "java/lang/Object";
private static final String JL_THROWABLE = "java/lang/Throwable";
@ -455,7 +456,7 @@ final class ProxyGenerator extends ClassWriter {
* class file generation process.
*/
private byte[] generateClassFile() {
visit(V14, accessFlags, dotToSlash(className), null,
visit(CLASSFILE_VERSION, accessFlags, dotToSlash(className), null,
JLR_PROXY, typeNames(interfaces));
/*