Browse Source

fixed JASSIST-182

git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@692 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
tags/rel_3_17_1_ga
chiba 11 years ago
parent
commit
a59694764d
2 changed files with 52 additions and 1 deletions
  1. 1
    1
      Readme.html
  2. 51
    0
      src/main/javassist/bytecode/ClassFileWriter.java

+ 1
- 1
Readme.html View File

@@ -283,7 +283,7 @@ see javassist.Dump.

<p>-version 3.17.1
<ul>
<li>JIRA JASSIST-177, 178
<li>JIRA JASSIST-177, 178, 182
</ul>



+ 51
- 0
src/main/javassist/bytecode/ClassFileWriter.java View File

@@ -642,6 +642,57 @@ public class ClassFileWriter {
return num++;
}

/**
* 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.

Loading…
Cancel
Save