From fa62254951363bfa95872866d535898cde26430b Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 29 Sep 2023 17:15:05 +0200 Subject: [PATCH] ARIES-2127: Add constants for Java 20/21 Signed-off-by: Robert Varga --- .../main/java/org/apache/aries/proxy/impl/ProxyUtils.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java b/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java index 5d5eecc9ef..e46be59ee6 100644 --- a/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java +++ b/proxy/proxy-impl/src/main/java/org/apache/aries/proxy/impl/ProxyUtils.java @@ -39,6 +39,14 @@ public static int getWeavingJavaVersion() { //In order to avoid an inconsistent stack error the version of the woven byte code needs to match //the level of byte codes in the original class switch(JAVA_CLASS_VERSION) { + case Opcodes.V21: + LOGGER.debug("Weaving to Java 21"); + weavingJavaVersion = Opcodes.V21; + break; + case Opcodes.V20: + LOGGER.debug("Weaving to Java 20"); + weavingJavaVersion = Opcodes.V20; + break; case Opcodes.V19: LOGGER.debug("Weaving to Java 19"); weavingJavaVersion = Opcodes.V19;