You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by bi...@apache.org on 2020/04/14 20:03:18 UTC

[axis-axis2-java-core] 31/31: Apply patch for AXIS-5935 to 1_7 branch, for JDK 8, 9, 10, 11 support

This is an automated email from the ASF dual-hosted git repository.

billblough pushed a commit to branch 1_7
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git

commit 3fd0dc03440569d38982df14c9a625bf503c353c
Author: Robert Lazarski <ro...@apache.org>
AuthorDate: Mon Sep 9 20:52:14 2019 +0000

    Apply patch for AXIS-5935 to 1_7 branch, for JDK 8,9,10,11 support
---
 .../java2wsdl/bytecode/ClassReader.java            | 33 +++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

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 7eb739c..d01b8fa 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,18 @@ 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 +360,29 @@ public class ClassReader extends ByteArrayInputStream {
                     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 paramter names in bytecode: unexpected bytes in file, tag:"+c);
             }
         }
     }