Skip to content

Commit 9ccd96f

Browse files
committed
Extend ByteCodeFilter to Java 8 ocpsoft#229
1 parent 4dffdf3 commit 9ccd96f

1 file changed

Lines changed: 37 additions & 1 deletion

File tree

annotations-impl/src/main/java/org/ocpsoft/rewrite/annotation/scan/ByteCodeFilter.java

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import java.io.IOException;
2020
import java.io.InputStream;
2121
import java.lang.annotation.Annotation;
22-
import java.util.HashSet;
2322
import java.util.LinkedHashSet;
2423
import java.util.Set;
2524

@@ -66,6 +65,9 @@ public class ByteCodeFilter
6665
private final static int CONSTANT_Double = 6;
6766
private final static int CONSTANT_NameAndType = 12;
6867
private final static int CONSTANT_Utf8 = 1;
68+
private static final int CONSTANT_MethodHandle = 15;
69+
private static final int CONSTANT_MethodType = 16;
70+
private static final int CONSTANT_InvokeDynamic = 18;
6971

7072
/**
7173
* The strings to look for in the constants table
@@ -240,6 +242,40 @@ public boolean accept(InputStream classFileStream) throws IOException
240242
return true;
241243
}
242244
break;
245+
246+
case CONSTANT_MethodHandle:
247+
/*
248+
* CONSTANT_MethodHandle_info {
249+
* u1 tag;
250+
* u1 reference_kind;
251+
* u2 reference_index;
252+
* }
253+
*/
254+
in.readByte();
255+
in.readShort();
256+
break;
257+
258+
case CONSTANT_MethodType:
259+
/*
260+
* CONSTANT_MethodType_info {
261+
* u1 tag;
262+
* u2 descriptor_index;
263+
* }
264+
*/
265+
in.readShort();
266+
break;
267+
268+
case CONSTANT_InvokeDynamic:
269+
/*
270+
* CONSTANT_InvokeDynamic_info {
271+
* u1 tag;
272+
* u2 bootstrap_method_attr_index;
273+
* u2 name_and_type_index;
274+
* }
275+
*/
276+
in.readShort();
277+
in.readShort();
278+
break;
243279

244280
default:
245281
/*

0 commit comments

Comments
 (0)