Search in sources :

Example 1 with InnerClasses_attribute

use of com.sun.tools.classfile.InnerClasses_attribute in project ceylon-compiler by ceylon.

the class AttributeWriter method visitInnerClasses.

public Void visitInnerClasses(InnerClasses_attribute attr, Void ignore) {
    boolean first = true;
    if (options.compat) {
        writeInnerClassHeader();
        first = false;
    }
    for (int i = 0; i < attr.classes.length; i++) {
        InnerClasses_attribute.Info info = attr.classes[i];
        //access
        AccessFlags access_flags = info.inner_class_access_flags;
        if (options.compat) {
            // BUG 6622215: javap ignores certain relevant access flags
            access_flags = access_flags.ignore(ACC_STATIC | ACC_PROTECTED | ACC_PRIVATE | ACC_INTERFACE | ACC_SYNTHETIC | ACC_ENUM);
            // BUG 6622232: javap gets whitespace confused
            print("   ");
        }
        if (options.checkAccess(access_flags)) {
            if (first) {
                writeInnerClassHeader();
                first = false;
            }
            print("   ");
            for (String name : access_flags.getInnerClassModifiers()) print(name + " ");
            if (info.inner_name_index != 0) {
                print("#" + info.inner_name_index + "= ");
            }
            print("#" + info.inner_class_info_index);
            if (info.outer_class_info_index != 0) {
                print(" of #" + info.outer_class_info_index);
            }
            print("; //");
            if (info.inner_name_index != 0) {
                print(getInnerName(constant_pool, info) + "=");
            }
            constantWriter.write(info.inner_class_info_index);
            if (info.outer_class_info_index != 0) {
                print(" of ");
                constantWriter.write(info.outer_class_info_index);
            }
            println();
        }
    }
    if (!first)
        indent(-1);
    return null;
}
Also used : InnerClasses_attribute(com.sun.tools.classfile.InnerClasses_attribute) AccessFlags(com.sun.tools.classfile.AccessFlags)

Aggregations

AccessFlags (com.sun.tools.classfile.AccessFlags)1 InnerClasses_attribute (com.sun.tools.classfile.InnerClasses_attribute)1