From 52cfeec781c68357f53c65e036eaa870c744978d Mon Sep 17 00:00:00 2001 From: Maduranga Siriwardena Date: Wed, 20 Mar 2024 18:22:58 +0530 Subject: [PATCH] Add changes to compile product with Java17 --- modules/all/pom.xml | 4 +-- .../java2wsdl/bytecode/ClassReader.java | 29 +++++++++++++++++-- modules/osgi/pom.xml | 4 +-- orbit/axis2-client/pom.xml | 2 +- orbit/axis2/pom.xml | 5 +++- 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/modules/all/pom.xml b/modules/all/pom.xml index 03343dda8..f05ba8cec 100644 --- a/modules/all/pom.xml +++ b/modules/all/pom.xml @@ -197,8 +197,8 @@ !javax.xml.ws.*; version=1.0.0, org.apache.axiom.*; version="${axiom.version}", org.apache.neethi.*; version="${neethi.version}", - javax.servlet; version=2.4.0, - javax.servlet.http; version=2.4.0, + javax.servlet; version=[3.1.0, 4.0.0), + javax.servlet.http; version=[3.1.0, 4.0.0), javax.xml.stream.*; version="1.0.1", javax.mail.*; version="1.4.0", javax.wsdl.*; version="1.6.2", diff --git a/modules/kernel/src/org/apache/axis2/description/java2wsdl/bytecode/ClassReader.java b/modules/kernel/src/org/apache/axis2/description/java2wsdl/bytecode/ClassReader.java index 7eb739c18..cd4647378 100644 --- a/modules/kernel/src/org/apache/axis2/description/java2wsdl/bytecode/ClassReader.java +++ b/modules/kernel/src/org/apache/axis2/description/java2wsdl/bytecode/ClassReader.java @@ -59,6 +59,16 @@ public class ClassReader extends ByteArrayInputStream { private static final int CONSTANT_Double = 6; private static final int CONSTANT_NameAndType = 12; private static final int CONSTANT_Utf8 = 1; + + /*java 8 9 10 11 new tokens https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html*/ + private static final int CONSTANT_MethodHandle = 15; + private static final int CONSTANT_MethodType = 16; + private static final int CONSTANT_Dynamic = 17; + private static final int CONSTANT_InvokeDynamic = 18; + private static final int CONSTANT_Module = 19; + private static final int CONSTANT_Package = 20; + /*end of ava 8 9 10 11 new tokens*/ + /** * the constant pool. constant pool indices in the class file * directly index into this array. The value stored in this array @@ -348,10 +358,25 @@ protected final void readCpool() throws IOException { int len = readShort(); skipFully(len); break; - + case CONSTANT_MethodHandle: + read(); // reference kind + readShort(); // reference index + break; + case CONSTANT_MethodType: + readShort(); // descriptor index + break; + case CONSTANT_Dynamic: + readShort(); // bootstrap method attr index + readShort(); // name and type index + break; + case CONSTANT_InvokeDynamic: + readShort(); // bootstrap method attr index + readShort(); // name and type index + break; default: // corrupt class file - throw new IllegalStateException("Error looking for paramter names in bytecode: unexpected bytes in file"); + throw new IllegalStateException( + "Error looking for parameter names in bytecode: unexpected bytes in file, tag:" + c); } } } diff --git a/modules/osgi/pom.xml b/modules/osgi/pom.xml index 8d94bb741..8f8891886 100644 --- a/modules/osgi/pom.xml +++ b/modules/osgi/pom.xml @@ -83,8 +83,8 @@ !org.apache.axis2.*, javax.ws.rs; version=1.0, javax.xml.namespace; version=0.0.0, - javax.servlet; version=2.4.0, - javax.servlet.http; version=2.4.0, + javax.servlet; version=[3.1.0, 4.0.0), + javax.servlet.http; version=[3.1.0, 4.0.0), javax.transaction, org.apache.commons.io, org.osgi.framework; version=1.6.0, diff --git a/orbit/axis2-client/pom.xml b/orbit/axis2-client/pom.xml index 43ea06b62..b9e09b342 100644 --- a/orbit/axis2-client/pom.xml +++ b/orbit/axis2-client/pom.xml @@ -367,7 +367,7 @@ [1.2.11, 1.3.0) 2.0.4.wso2v5 [2.0.4.wso2v4, 3.0.0) - [2.6.0, 3.0.0) + [3.1.0, 4.0.0) 1.1.2 1.3.1.wso2v1 3.1.0.wso2v3 diff --git a/orbit/axis2/pom.xml b/orbit/axis2/pom.xml index 05a37ebe8..55a6a67dd 100644 --- a/orbit/axis2/pom.xml +++ b/orbit/axis2/pom.xml @@ -569,6 +569,9 @@ xmlbeans;scope=compile|runtime;inline=false; * + + osgi.service;objectClass=org.apache.axis2.engine.ListenerManager + @@ -586,7 +589,7 @@ ${version.axis2} [1.2.11, 1.3.0) [2.0.4.wso2v4, 3.0.0) - [2.6.0, 3.0.0) + [3.1.0, 4.0.0) 1.4.0 3.1.0 2.0.4.wso2v5