aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2011-06-06 23:22:47 +0200
committerRoel Spilker <r.spilker@gmail.com>2011-06-06 23:22:47 +0200
commitef220339b69f151812c0adc87522069c540a2b84 (patch)
tree8a528ec04b1d0abdc0d58c729a3c7532c5ad006f /src
parent3171afd5bcacf48125ac3dff071ee7e420c6d2ad (diff)
downloadlombok-ef220339b69f151812c0adc87522069c540a2b84.tar.gz
lombok-ef220339b69f151812c0adc87522069c540a2b84.tar.bz2
lombok-ef220339b69f151812c0adc87522069c540a2b84.zip
Issue 188: add class file pool constants for methodhandles and invokedynamic (java7)
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/bytecode/ClassFileMetaData.java26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/core/lombok/bytecode/ClassFileMetaData.java b/src/core/lombok/bytecode/ClassFileMetaData.java
index 618ba8f0..b1e0eff3 100644
--- a/src/core/lombok/bytecode/ClassFileMetaData.java
+++ b/src/core/lombok/bytecode/ClassFileMetaData.java
@@ -38,8 +38,12 @@ public class ClassFileMetaData {
private static final byte STRING = 8;
private static final byte FIELD = 9;
private static final byte METHOD = 10;
- private static final byte IMETHOD = 11;
+ private static final byte INTERFACE_METHOD = 11;
private static final byte NAME_TYPE = 12;
+ // New in java7: support for methodhandles and invokedynamic
+ private static final byte METHOD_HANDLE = 15;
+ private static final byte METHOD_TYPE = 16;
+ private static final byte INVOKE_DYNAMIC = 18;
private static final int NOT_FOUND = -1;
private static final int START_OF_CONSTANT_POOL = 8;
@@ -74,14 +78,19 @@ public class ClassFileMetaData {
break;
case CLASS:
case STRING:
+ case METHOD_TYPE:
position += 2;
break;
+ case METHOD_HANDLE:
+ position += 3;
+ break;
case INTEGER:
case FLOAT:
case FIELD:
case METHOD:
- case IMETHOD:
+ case INTERFACE_METHOD:
case NAME_TYPE:
+ case INVOKE_DYNAMIC:
position += 4;
break;
case LONG:
@@ -356,7 +365,7 @@ public class ClassFileMetaData {
appendAccess(result.append("Field "), i);
break;
case METHOD:
- case IMETHOD:
+ case INTERFACE_METHOD:
appendAccess(result.append("Method "), i);
break;
case NAME_TYPE:
@@ -368,6 +377,15 @@ public class ClassFileMetaData {
case DOUBLE:
result.append("double ").append(readDouble(i));
break;
+ case METHOD_HANDLE:
+ result.append("MethodHandle...");
+ break;
+ case METHOD_TYPE:
+ result.append("MethodType...");
+ break;
+ case INVOKE_DYNAMIC:
+ result.append("InvokeDynamic...");
+ break;
case 0:
result.append("(cont.)");
break;
@@ -395,7 +413,7 @@ public class ClassFileMetaData {
private boolean isMethod(int i) {
byte type = types[i];
- return type == METHOD || type == IMETHOD;
+ return type == METHOD || type == INTERFACE_METHOD;
}
private int findNameAndType(String name, String descriptor) {