for (int i = 0; i < count; i++) {
try {
int accessFlags = bytes.getUnsignedShort(at);
int nameIdx = bytes.getUnsignedShort(at + 2);
int descIdx = bytes.getUnsignedShort(at + 4);
CstUtf8 name = (CstUtf8) pool.get(nameIdx);
CstUtf8 desc = (CstUtf8) pool.get(descIdx);
if (observer != null) {
observer.startParsingMember(bytes, at, name.getString(),
desc.getString());
observer.parsed(bytes, at, 0, "\n" + humanName() +
"s[" + i + "]:\n");
observer.changeIndent(1);
observer.parsed(bytes, at, 2,
"access_flags: " +
humanAccessFlags(accessFlags));
observer.parsed(bytes, at + 2, 2,
"name: " + name.toHuman());
observer.parsed(bytes, at + 4, 2,
"descriptor: " + desc.toHuman());
}
at += 6;
AttributeListParser parser =
new AttributeListParser(cf, attributeContext, at,
attributeFactory);
parser.setObserver(observer);
at = parser.getEndOffset();
StdAttributeList attributes = parser.getList();
attributes.setImmutable();
CstNat nat = new CstNat(name, desc);
Member member = set(i, accessFlags, nat, attributes);
if (observer != null) {
observer.changeIndent(-1);
observer.parsed(bytes, at, 0, "end " + humanName() +
"s[" + i + "]\n");
observer.endParsingMember(bytes, at, name.getString(),
desc.getString(), member);
}
} catch (ParseException ex) {
ex.addContext("...while parsing " + humanName() + "s[" + i +
"]");
throw ex;