// Look for references in class annotations
IBinaryAnnotation[] annotations = reader.getAnnotations();
if (annotations != null) {
for (int a=0, length=annotations.length; a<length; a++) {
IBinaryAnnotation annotation = annotations[a];
addBinaryAnnotation(annotation);
}
}
long tagBits = reader.getTagBits() & TagBits.AllStandardAnnotationsMask;
if (tagBits != 0) {
addBinaryStandardAnnotations(tagBits);
}
int extraFlags = ExtraFlags.getExtraFlags(reader);
// first reference all methods declarations and field declarations
MethodInfo[] methods = (MethodInfo[]) reader.getMethods();
boolean noConstructor = true;
if (methods != null) {
for (int i = 0, max = methods.length; i < max; i++) {
MethodInfo method = methods[i];
boolean isConstructor = method.isConstructor();
char[] descriptor = method.getMethodDescriptor();
char[][] parameterTypes = decodeParameterTypes(descriptor, isConstructor && isNestedType);
char[] returnType = decodeReturnType(descriptor);
char[][] exceptionTypes = replace('/', '.', method.getExceptionTypeNames());
if (isConstructor) {
noConstructor = false;
char[] signature = method.getGenericSignature();
if (signature == null) {
if (reader.isNestedType() && ((modifiers & ClassFileConstants.AccStatic) == 0)) {
signature = removeFirstSyntheticParameter(descriptor);
} else {
signature = descriptor;
}
}
addConstructorDeclaration(
name,
parameterTypes == null ? 0 : parameterTypes.length,
signature,
parameterTypes,
method.getArgumentNames(),
method.getModifiers(),
packageName,
modifiers,
exceptionTypes,
extraFlags);
} else {
if (!method.isClinit()) {
addMethodDeclaration(method.getSelector(), parameterTypes, returnType, exceptionTypes);
}
}
// look for references in method annotations
annotations = method.getAnnotations();
if (annotations != null) {
for (int a=0, length=annotations.length; a<length; a++) {
IBinaryAnnotation annotation = annotations[a];
addBinaryAnnotation(annotation);
}
}
tagBits = method.getTagBits() & TagBits.AllStandardAnnotationsMask;
if (tagBits != 0) {
addBinaryStandardAnnotations(tagBits);
}
}
}
if (noConstructor) {
addDefaultConstructorDeclaration(className, packageName, modifiers, extraFlags);
}
FieldInfo[] fields = (FieldInfo[]) reader.getFields();
if (fields != null) {
for (int i = 0, max = fields.length; i < max; i++) {
FieldInfo field = fields[i];
char[] fieldName = field.getName();
char[] fieldType = decodeFieldType(replace('/', '.', field.getTypeName()));
addFieldDeclaration(fieldType, fieldName);
// look for references in field annotations
annotations = field.getAnnotations();
if (annotations != null) {
for (int a=0, length=annotations.length; a<length; a++) {
IBinaryAnnotation annotation = annotations[a];
addBinaryAnnotation(annotation);
}
}
tagBits = field.getTagBits() & TagBits.AllStandardAnnotationsMask;
if (tagBits != 0) {