< prev index next >

src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java

Print this page

        

*** 2489,2498 **** --- 2489,2532 ---- // the first two bytes of this CONSTANT_Class item return readUTF8(items[readUnsignedShort(index)], buf); } /** + * Reads a CONSTANT_Module_info item in {@code b}. This method is intended + * for {@link Attribute} sub classes, and is normally not needed by class + * generators or adapters.</i> + * + * @param index + * the start index of an unsigned short value in {@link #b b}, + * whose value is the index of a module constant pool item. + * @param buf + * buffer to be used to read the item. This buffer must be + * sufficiently large. It is not automatically resized. + * @return the String corresponding to the specified module item. + */ + public String readModule(int index, char[] buf) { + return readUTF8(items[readUnsignedShort(index)], buf); + } + + /** + * Reads a CONSTANT_Pakcage_info item in {@code b}. This method is + * intended for {@link Attribute} sub slasses, and is normally not needed + * by class generators or adapters.</i> + * + * @param index + * the start index of an unsigned short value in {@link #b b}, + * whose value is the index of a package constant pool item. + * @param buf + * buffer to be used to read the item. This buffer must be + * sufficiently large. It is not automatically resized. + * @return the String corresponding to the specified package item. + */ + public String readPackage(int index, char[] buf) { + return readUTF8(items[readUnsignedShort(index)], buf); + } + + /** * Reads a numeric or string constant pool item in {@link #b b}. <i>This * method is intended for {@link Attribute} sub classes, and is normally not * needed by class generators or adapters.</i> * * @param item
*** 2514,2523 **** --- 2548,2559 ---- case ClassWriter.LONG: return readLong(index); case ClassWriter.DOUBLE: return Double.longBitsToDouble(readLong(index)); case ClassWriter.CLASS: + case ClassWriter.MODULE: + case ClassWriter.PACKAGE: return Type.getObjectType(readUTF8(index, buf)); case ClassWriter.STR: return readUTF8(index, buf); case ClassWriter.MTYPE: return Type.getMethodType(readUTF8(index, buf));
< prev index next >