Skip to content

Commit

Permalink
PAYARA-1010 update ConstantPool info to match JDK7+ constant pool str…
Browse files Browse the repository at this point in the history
…ucture (#1052)
  • Loading branch information
smillidge authored Aug 21, 2016
1 parent 42cbd9e commit 2465783
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/
// Portions Copyright [2016] [Payara Foundation]

package com.sun.enterprise.deployment.annotation.introspection;

Expand All @@ -71,6 +72,7 @@ public ConstantPoolInfo(AnnotationScanner scanner) {
/**
* Read the input channel and initialize instance data
* structure.
* PAYARA-1010 updated for JDK 7 and 8 https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.4
*/
public boolean containsAnnotation(int constantPoolSize, final ByteBuffer buffer) throws IOException {

Expand Down Expand Up @@ -103,6 +105,7 @@ public boolean containsAnnotation(int constantPoolSize, final ByteBuffer buffer)
break;
case CLASS:
case STRING:
case METHOD_TYPE:
buffer.getShort();
break;
case FIELDREF:
Expand All @@ -119,9 +122,13 @@ public boolean containsAnnotation(int constantPoolSize, final ByteBuffer buffer)
i++;
break;
case NAMEANDTYPE:
case INVOKE_DYNAMIC:
buffer.getShort();
buffer.getShort();
break;
case METHOD_HANDLE:
buffer.get();
buffer.getShort();
default:
DOLUtils.getDefaultLogger().severe("Unknow type constant pool " + type + " at position" + i);
break;
Expand All @@ -142,5 +149,8 @@ public boolean containsAnnotation(int constantPoolSize, final ByteBuffer buffer)
public static final int INTERFACEMETHODREF = 11;
public static final int NAMEANDTYPE = 12;
public static final int ASCIZ = 1;
public static final int UNICODE = 2;
public static final int UNICODE = 2;
public static final int METHOD_HANDLE=15;
public static final int METHOD_TYPE=16;
public static final int INVOKE_DYNAMIC=18;
}

0 comments on commit 2465783

Please sign in to comment.