[hg] main-silver: #224478, #224500, #224501, #224502: Parsing of...

  • From:
  • To:
  • Subject: [hg] main-silver: #224478, #224500, #224501, #224502: Parsing of...
  • Date: Wed, 09 Jan 2013 03:38:15 -0800

changeset dc8e452b9795 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/dc8e452b9795
description:
        #224478, #224500, #224501, #224502: Parsing of constant pool updated 
to include new JDK8 entries.

diffstat:

 
debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ConstantPool.java
 |  50 ++++++++++
 1 files changed, 50 insertions(+), 0 deletions(-)

diffs (72 lines):

diff --git 
a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ConstantPool.java
 
b/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ConstantPool.java
--- 
a/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ConstantPool.java
+++ 
b/debugger.jpda.projects/src/org/netbeans/modules/debugger/jpda/projects/ConstantPool.java
@@ -69,6 +69,9 @@
     private static final byte TAG_METHODREF = 10;
     private static final byte TAG_INTERFACEREF = 11;
     private static final byte TAG_NAMETYPE = 12;
+    private static final byte TAG_METHODHANDLE = 15;
+    private static final byte TAG_METHODTYPE = 16;
+    private static final byte TAG_INVOKEDYNAMIC = 18; 
 
     private final List<ConstantPool.Entry> entries;
 
@@ -147,6 +150,16 @@
                     case TAG_INTERFACEREF:
                         entry = new EntryFieldMethodRef(tagByte, 
in.readShort(), in.readShort());
                         break;
+                    case TAG_METHODHANDLE:
+                        entry = new EntryMethodHandle(in);
+                        break;
+                    case TAG_METHODTYPE:
+                        entry = new EntryMethodType(in);
+                        break;
+                    case TAG_INVOKEDYNAMIC:
+                        entry = new EntryInvokeDynamic(in);
+                        break; 
+                    case 0:
                     default:
                         
Logger.getLogger(ConstantPool.class.getName()).warning("Unknown tag byte: 
"+tagByte);
                         entry = new EntryNULL();
@@ -313,4 +326,41 @@
             this.nameAndTypeIndex = nameAndTypeIndex;
         }
     }
+    
+    public static class BytesEntry extends Entry {
+        
+        protected final byte[] bytes;
+        
+        public BytesEntry(byte type, DataInputStream in, int length) throws 
IOException {
+            super(type);
+            byte[] b = new byte[length];
+            int l = in.read(b, 0, length);
+            while (l < length) {
+                l += in.read(b, l, length - l);
 }
+            bytes = b;
+        }
+    }
+    
+    public static class EntryMethodHandle extends BytesEntry {
+        
+        public EntryMethodHandle(DataInputStream in) throws IOException {
+            super(TAG_METHODHANDLE, in, 3);
+        }
+    }
+    
+    public static class EntryMethodType extends BytesEntry {
+        
+        public EntryMethodType(DataInputStream in) throws IOException {
+            super(TAG_METHODTYPE, in, 2);
+        }
+    }
+    
+    public static class EntryInvokeDynamic extends BytesEntry {
+        
+        public EntryInvokeDynamic(DataInputStream in) throws IOException {
+            super(TAG_INVOKEDYNAMIC, in, 4);
+        }
+    }
+    
+}

[hg] main-silver: #224478, #224500, #224501, #224502: Parsing of...

mentlicher 01/09/2013

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close