< prev index next >
src/jdk.jdeps/share/classes/com/sun/tools/classfile/Module_attribute.java
Print this page
*** 25,34 ****
--- 25,36 ----
package com.sun.tools.classfile;
import java.io.IOException;
+ import com.sun.tools.classfile.ConstantPool.CONSTANT_Module_info;
+
/**
* See Jigsaw.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
*** 46,55 ****
--- 48,59 ----
super(name_index, length);
module_name = cr.readUnsignedShort();
module_flags = cr.readUnsignedShort();
+ module_version_index = cr.readUnsignedShort();
+
requires_count = cr.readUnsignedShort();
requires = new RequiresEntry[requires_count];
for (int i = 0; i < requires_count; i++)
requires[i] = new RequiresEntry(cr);
*** 75,92 ****
--- 79,98 ----
}
public Module_attribute(int name_index,
int module_name,
int module_flags,
+ int module_version_index,
RequiresEntry[] requires,
ExportsEntry[] exports,
OpensEntry[] opens,
int[] uses,
ProvidesEntry[] provides) {
super(name_index, 2);
this.module_name = module_name;
this.module_flags = module_flags;
+ this.module_version_index = module_version_index;
requires_count = requires.length;
this.requires = requires;
exports_count = exports.length;
this.exports = exports;
opens_count = opens.length;
*** 107,116 ****
--- 113,123 ----
return visitor.visitModule(this, data);
}
public final int module_name;
public final int module_flags;
+ public final int module_version_index;
public final int requires_count;
public final RequiresEntry[] requires;
public final int exports_count;
public final ExportsEntry[] exports;
public final int opens_count;
*** 122,146 ****
public static class RequiresEntry {
RequiresEntry(ClassReader cr) throws IOException {
requires_index = cr.readUnsignedShort();
requires_flags = cr.readUnsignedShort();
}
! public RequiresEntry(int index, int flags) {
this.requires_index = index;
this.requires_flags = flags;
}
public String getRequires(ConstantPool constant_pool) throws ConstantPoolException {
! return constant_pool.getUTF8Value(requires_index);
}
public static final int length = 4;
public final int requires_index;
public final int requires_flags;
}
public static class ExportsEntry {
ExportsEntry(ClassReader cr) throws IOException {
exports_index = cr.readUnsignedShort();
--- 129,157 ----
public static class RequiresEntry {
RequiresEntry(ClassReader cr) throws IOException {
requires_index = cr.readUnsignedShort();
requires_flags = cr.readUnsignedShort();
+ requires_version_index = cr.readUnsignedShort();
}
! public RequiresEntry(int index, int flags, int version_index) {
this.requires_index = index;
this.requires_flags = flags;
+ this.requires_version_index = version_index;
}
public String getRequires(ConstantPool constant_pool) throws ConstantPoolException {
! CONSTANT_Module_info info = constant_pool.getModuleInfo(requires_index);
! return info.getName();
}
public static final int length = 4;
public final int requires_index;
public final int requires_flags;
+ public final int requires_version_index;
}
public static class ExportsEntry {
ExportsEntry(ClassReader cr) throws IOException {
exports_index = cr.readUnsignedShort();
< prev index next >