private static int getClassModifiers(IClassFileReader cfReader) { IInnerClassesAttribute innerClassesAttribute = cfReader.getInnerClassesAttribute(); if (innerClassesAttribute != null) { IInnerClassesAttributeEntry[] entries = innerClassesAttribute.getInnerClassAttributesEntries(); for (int i = 0; i < entries.length; i++) { IInnerClassesAttributeEntry entry = entries[i]; char[] innerClassName = entry.getInnerClassName(); if (innerClassName != null) { if (CharOperation.equals(cfReader.getClassName(), innerClassName)) { return entry.getAccessFlags(); } } } } return cfReader.getAccessFlags(); }
private static int getClassModifiers(IClassFileReader cfReader) { IInnerClassesAttribute innerClassesAttribute= cfReader.getInnerClassesAttribute(); if (innerClassesAttribute != null) { IInnerClassesAttributeEntry[] entries = innerClassesAttribute.getInnerClassAttributesEntries(); for (int i= 0; i < entries.length; i++) { IInnerClassesAttributeEntry entry = entries[i]; char[] innerClassName = entry.getInnerClassName(); if (innerClassName != null) { if (CharOperation.equals(cfReader.getClassName(), innerClassName)) { return entry.getAccessFlags(); } } } } return cfReader.getAccessFlags(); }
/** * Constructor for InnerClassesAttribute. * @param classFileBytes * @param constantPool * @param offset * @throws ClassFormatException */ public InnerClassesAttribute( byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException { super(classFileBytes, constantPool, offset); this.numberOfClasses = u2At(classFileBytes, 6, offset); final int length = this.numberOfClasses; if (length != 0) { int readOffset = 8; this.entries = new IInnerClassesAttributeEntry[length]; for (int i = 0; i < length; i++) { this.entries[i] = new InnerClassesAttributeEntry(classFileBytes, constantPool, offset + readOffset); readOffset += 8; } } else { this.entries = NO_ENTRIES; } }
/** * @see IInnerClassesAttribute#getInnerClassAttributesEntries() */ public IInnerClassesAttributeEntry[] getInnerClassAttributesEntries() { return this.entries; }