Skip to content

Commit

Permalink
Merge pull request #20 from garcia-jj/ot-fixinglambdas
Browse files Browse the repository at this point in the history
Closes #17. Added constant pool tags to work with Java 8 Lambdas.
  • Loading branch information
paul-hammant committed May 9, 2015
2 parents fc5959c + 8eb433e commit 1ad7810
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,16 @@ private static class ClassReader {
*/
final static int NAME_TYPE = 12;

/**
* The type of CONSTANT_MethodHandle constant pool items.
*/
static final int MHANDLE = 15;

/**
* The type of CONSTANT_InvokeDynamic constant pool items.
*/
static final int INVOKEDYN = 18;

/**
* The type of CONSTANT_Utf8 constant pool items.
*/
Expand Down Expand Up @@ -455,6 +465,7 @@ private ClassReader(final byte[] b, final int off) {
case IMETH:
case INT:
case FLOAT:
case INVOKEDYN:
case NAME_TYPE:
size = 5;
break;
Expand All @@ -463,6 +474,9 @@ private ClassReader(final byte[] b, final int off) {
size = 9;
++i;
break;
case MHANDLE:
size = 4;
break;
case UTF8:
size = 3 + readUnsignedShort(index + 1);
if (size > max) {
Expand Down Expand Up @@ -613,7 +627,6 @@ private void accept(final TypeCollector classVisitor) {
// inlined in original ASM source, now a method call
u = readMethod(classVisitor, c, u);
}

}

private int readMethod(TypeCollector classVisitor, char[] c, int u) {
Expand Down

0 comments on commit 1ad7810

Please sign in to comment.