public ClassInfo analyze(IAnalysisCache analysisCache, ClassDescriptor descriptor) throws CheckedAnalysisException {
if (descriptor instanceof ClassInfo) {
return (ClassInfo) descriptor;
}
ClassData classData;
try {
classData = analysisCache.getClassAnalysis(ClassData.class, descriptor);
} catch (edu.umd.cs.findbugs.classfile.MissingClassException e) {
if (!descriptor.getSimpleName().equals("package-info")) {
throw e;
}
ClassInfo.Builder builder = new ClassInfo.Builder();
builder.setClassDescriptor(descriptor);
builder.setAccessFlags(1536);
return builder.build();
}
// Read the class info
FBClassReader reader = analysisCache.getClassAnalysis(FBClassReader.class, descriptor);
ClassParserInterface parser = new ClassParserUsingASM(reader, descriptor, classData.getCodeBaseEntry());
ClassInfo.Builder classInfoBuilder = new ClassInfo.Builder();
parser.parse(classInfoBuilder);
ClassInfo classInfo = classInfoBuilder.build();
if (!classInfo.getClassDescriptor().equals(descriptor)) {
throw new ClassNameMismatchException(descriptor, classInfo.getClassDescriptor(), classData.getCodeBaseEntry());
}
return classInfo;
}