if ((foundThisClass == null) && (membersSize == 0)) {
return null;
}
Annotations result = new Annotations();
if (foundThisClass != null) {
result.add(AnnotationUtils.makeInnerClass(
foundThisClass.getInnerName(),
foundThisClass.getAccessFlags()));
if (needEnclosingClass) {
CstType outer = foundThisClass.getOuterClass();
if (outer == null) {
throw new Warning(
"Ignoring InnerClasses attribute for an " +
"anonymous inner class that doesn't come with " +
"an associated EnclosingMethod attribute. " +
"(This class was probably produced by a broken " +
"compiler.)");
}
result.add(AnnotationUtils.makeEnclosingClass(
foundThisClass.getOuterClass()));
}
}
if (membersSize != 0) {
StdTypeList typeList = new StdTypeList(membersSize);
for (int i = 0; i < membersSize; i++) {
typeList.set(i, membersList.get(i));
}
typeList.setImmutable();
result.add(AnnotationUtils.makeMemberClasses(typeList));
}
result.setImmutable();
return result;
}