aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-12-03 10:20:11 +0000
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>2012-12-03 10:20:11 +0000
commita59694764d04c2cc2e066964f25a5104eb641003 (patch)
treef38c3958604374bb5b8b827d896dc4316827c4fa /src
parente3e129bbcc06ad0be9ee067ed29c349ba88a6ce1 (diff)
downloadjavassist-a59694764d04c2cc2e066964f25a5104eb641003.tar.gz
javassist-a59694764d04c2cc2e066964f25a5104eb641003.zip
fixed JASSIST-182
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@692 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src')
-rw-r--r--src/main/javassist/bytecode/ClassFileWriter.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/main/javassist/bytecode/ClassFileWriter.java b/src/main/javassist/bytecode/ClassFileWriter.java
index 5d63b966..9f934bcf 100644
--- a/src/main/javassist/bytecode/ClassFileWriter.java
+++ b/src/main/javassist/bytecode/ClassFileWriter.java
@@ -643,6 +643,57 @@ public class ClassFileWriter {
}
/**
+ * Adds a new <code>CONSTANT_MethodHandle_info</code>
+ * structure.
+ *
+ * @param kind <code>reference_kind</code>
+ * such as {@link #REF_invokeStatic <code>REF_invokeStatic</code>}.
+ * @param index <code>reference_index</code>.
+ * @return the index of the added entry.
+ *
+ * @since 3.17.1
+ */
+ public int addMethodHandleInfo(int kind, int index) {
+ output.write(MethodHandleInfo.tag);
+ output.write(kind);
+ output.writeShort(index);
+ return num++;
+ }
+
+ /**
+ * Adds a new <code>CONSTANT_MethodType_info</code>
+ * structure.
+ *
+ * @param desc <code>descriptor_index</code>.
+ * @return the index of the added entry.
+ *
+ * @since 3.17.1
+ */
+ public int addMethodTypeInfo(int desc) {
+ output.write(MethodTypeInfo.tag);
+ output.writeShort(desc);
+ return num++;
+ }
+
+ /**
+ * Adds a new <code>CONSTANT_InvokeDynamic_info</code>
+ * structure.
+ *
+ * @param bootstrap <code>bootstrap_method_attr_index</code>.
+ * @param nameAndType <code>name_and_type_index</code>.
+ * @return the index of the added entry.
+ *
+ * @since 3.17.1
+ */
+ public int addInvokeDynamicInfo(int bootstrap,
+ int nameAndTypeInfo) {
+ output.write(InvokeDynamicInfo.tag);
+ output.writeShort(bootstrap);
+ output.writeShort(nameAndTypeInfo);
+ return num++;
+ }
+
+ /**
* Adds a new <code>CONSTANT_String_info</code>
* structure.
*