Skip to content

Commit 07b0e17

Browse files
avpinchukdmatej
authored andcommitted
Raise the generated bytecode level to JDK 17
Signed-off-by: Alexander Pinčuk <[email protected]>
1 parent 1ae542e commit 07b0e17

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

appserver/ejb/ejb-container/src/main/java/com/sun/ejb/codegen/AsmSerializableBeanGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, 2023 Contributors to the Eclipse Foundation.
2+
* Copyright (c) 2021, 2025 Contributors to the Eclipse Foundation.
33
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
44
*
55
* This program and the accompanying materials are made available under the
@@ -34,7 +34,7 @@
3434
import static org.objectweb.asm.Opcodes.ALOAD;
3535
import static org.objectweb.asm.Opcodes.INVOKESTATIC;
3636
import static org.objectweb.asm.Opcodes.RETURN;
37-
import static org.objectweb.asm.Opcodes.V11;
37+
import static org.objectweb.asm.Opcodes.V17;
3838

3939
public class AsmSerializableBeanGenerator extends BeanGeneratorBase {
4040

@@ -70,7 +70,7 @@ public Class<?> generateSerializableSubclass() {
7070

7171
ClassWriter cw = new ClassWriter(0);
7272

73-
cw.visit(V11, ACC_PUBLIC, subClassInternalName, null, Type.getInternalName(superClass), new String[] {"java/io/Serializable"});
73+
cw.visit(V17, ACC_PUBLIC, subClassInternalName, null, Type.getInternalName(superClass), new String[] {"java/io/Serializable"});
7474

7575
generateConstructor(cw, superClass, false);
7676

appserver/ejb/ejb-container/src/main/java/com/sun/ejb/codegen/EjbOptionalIntfGenerator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation.
2+
* Copyright (c) 2022, 2025 Contributors to the Eclipse Foundation.
33
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
44
*
55
* This program and the accompanying materials are made available under the
@@ -59,7 +59,7 @@
5959
import static org.objectweb.asm.Opcodes.NEW;
6060
import static org.objectweb.asm.Opcodes.PUTFIELD;
6161
import static org.objectweb.asm.Opcodes.RETURN;
62-
import static org.objectweb.asm.Opcodes.V11;
62+
import static org.objectweb.asm.Opcodes.V17;
6363

6464
public class EjbOptionalIntfGenerator extends BeanGeneratorBase {
6565

@@ -106,7 +106,7 @@ public void generateInterface(Class<?> ejbClass, String intfClassName, final Cla
106106

107107
ClassWriter cw = new ClassWriter(0);
108108

109-
cw.visit(V11,
109+
cw.visit(V17,
110110
ACC_PUBLIC + ACC_ABSTRACT + ACC_INTERFACE,
111111
intfClassName.replace('.', '/'),
112112
null,
@@ -169,7 +169,7 @@ public void generateSubclass(Class<?> superClass, String subClassName, Class<?>
169169
interfaceNames[i + 1] = Type.getInternalName(interfaces[i]);
170170
}
171171

172-
cw.visit(V11, ACC_PUBLIC, subClassInternalName, null, Type.getInternalName(superClass), interfaceNames);
172+
cw.visit(V17, ACC_PUBLIC, subClassInternalName, null, Type.getInternalName(superClass), interfaceNames);
173173

174174
generateDelegateField(cw, fieldDesc);
175175

nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/composite/CompositeUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
import static org.objectweb.asm.Opcodes.NEW;
9494
import static org.objectweb.asm.Opcodes.PUTFIELD;
9595
import static org.objectweb.asm.Opcodes.RETURN;
96-
import static org.objectweb.asm.Opcodes.V11;
96+
import static org.objectweb.asm.Opcodes.V17;
9797

9898
/**
9999
* @author jdlee
@@ -567,7 +567,7 @@ private void visitClass(ClassWriter classWriter, String className, Set<Class<?>>
567567
ifaceNames[i++] = iface.getName().replace(".", "/");
568568
}
569569
className = getInternalName(className);
570-
classWriter.visit(V11, ACC_PUBLIC + ACC_SUPER, className, null, "org/glassfish/admin/rest/composite/RestModelImpl", ifaceNames);
570+
classWriter.visit(V17, ACC_PUBLIC + ACC_SUPER, className, null, "org/glassfish/admin/rest/composite/RestModelImpl", ifaceNames);
571571

572572
// Add @XmlRootElement
573573
classWriter.visitAnnotation("Ljakarta/xml/bind/annotation/XmlRootElement;", true).visitEnd();

nucleus/admin/rest/rest-service/src/main/java/org/glassfish/admin/rest/generator/ASMClassWriter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2+
* Copyright (c) 2022, 2025 Contributors to the Eclipse Foundation.
23
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation.
44
*
55
* This program and the accompanying materials are made available under the
66
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -60,7 +60,7 @@
6060
import static org.objectweb.asm.Opcodes.NEW;
6161
import static org.objectweb.asm.Opcodes.POP;
6262
import static org.objectweb.asm.Opcodes.RETURN;
63-
import static org.objectweb.asm.Opcodes.V11;
63+
import static org.objectweb.asm.Opcodes.V17;
6464

6565
/**
6666
* @author Ludovic Champenois
@@ -94,7 +94,7 @@ public ASMClassWriter(ServiceLocator habitat, String generatedPath, String class
9494
} else {
9595
baseClassName = "org/glassfish/admin/rest/resources/" + baseClassName;
9696
}
97-
cw.visit(V11, ACC_PUBLIC + ACC_SUPER, generatedPath + className, null, baseClassName, null);
97+
cw.visit(V17, ACC_PUBLIC + ACC_SUPER, generatedPath + className, null, baseClassName, null);
9898

9999
if (resourcePath != null) {
100100
RestLogging.restLogger.log(Level.FINE, "Creating resource with path {0} (1)", resourcePath);
@@ -264,7 +264,7 @@ public void createCommandResourceConstructor(String commandResourceClassName, St
264264
}
265265
boolean isget = (httpMethod.equals("GET"));
266266

267-
cw.visit(V11, ACC_PUBLIC + ACC_SUPER, generatedPath + commandResourceClassName, null, baseClassName, null);
267+
cw.visit(V17, ACC_PUBLIC + ACC_SUPER, generatedPath + commandResourceClassName, null, baseClassName, null);
268268
// cw.visitInnerClass(generatedPath + commandResourceClassName +"$1", null, null, 0);
269269
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
270270
mv.visitCode();

nucleus/flashlight/framework/src/main/java/org/glassfish/flashlight/impl/client/BtraceClientGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024 Contributors to the Eclipse Foundation.
2+
* Copyright (c) 2023, 2025 Contributors to the Eclipse Foundation.
33
* Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
44
*
55
* This program and the accompanying materials are made available under the
@@ -31,7 +31,7 @@
3131
import org.objectweb.asm.commons.Method;
3232

3333
import static org.glassfish.embeddable.GlassFishVariable.INSTALL_ROOT;
34-
import static org.objectweb.asm.Opcodes.V11;
34+
import static org.objectweb.asm.Opcodes.V17;
3535

3636
public class BtraceClientGenerator {
3737
private BtraceClientGenerator() {
@@ -47,7 +47,7 @@ public static byte[] generateBtraceClientClassData(int clientID, Collection<Flas
4747

4848
//Define the access identifiers for the BTrace Client class
4949
int access = Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL;
50-
cw.visit(V11, access, generatedClassName, null,
50+
cw.visit(V17, access, generatedClassName, null,
5151
"java/lang/Object", null);
5252
//Need a @OnMethod annotation, so prepare your Annotation Visitor for that
5353
cw.visitAnnotation("Lcom/sun/btrace/annotations/BTrace;", true);

nucleus/flashlight/framework/src/main/java/org/glassfish/flashlight/impl/core/ProviderImplGenerator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2+
* Copyright (c) 2022, 2025 Contributors to the Eclipse Foundation.
23
* Copyright (c) 2009, 2018 Oracle and/or its affiliates. All rights reserved.
3-
* Copyright (c) 2022, 2023 Contributors to the Eclipse Foundation.
44
*
55
* This program and the accompanying materials are made available under the
66
* terms of the Eclipse Public License v. 2.0, which is available at
@@ -36,7 +36,7 @@
3636
import org.objectweb.asm.commons.Method;
3737

3838
import static org.glassfish.embeddable.GlassFishVariable.INSTALL_ROOT;
39-
import static org.objectweb.asm.Opcodes.V11;
39+
import static org.objectweb.asm.Opcodes.V17;
4040

4141
public class ProviderImplGenerator {
4242
private static final Logger logger = FlashlightLoggerInfo.getLogger();
@@ -72,7 +72,7 @@ public byte[] generateClassData(FlashlightProbeProvider provider, Class provider
7272

7373
int access = Opcodes.ACC_PUBLIC + Opcodes.ACC_FINAL;
7474
String[] interfaces = new String[]{providerClazz.getName().replace('.', '/')};
75-
cw.visit(V11, access, generatedClassName, null, "java/lang/Object", interfaces);
75+
cw.visit(V17, access, generatedClassName, null, "java/lang/Object", interfaces);
7676

7777

7878
for (FlashlightProbe probe : provider.getProbes()) {

0 commit comments

Comments
 (0)