assert data != null : "Data argument must not be null";
assert errors != null : "Errors argument must not be null";
final Map<MethodInfo, ResolvedMethod> methodMapping = new HashMap<MethodInfo, ResolvedMethod>();
final MethodInfoList methodInfos = data.getMethodInfos();
final MethodBodyList methodBodies = data.getMethodBodies();
final ConstantPool constantPool = data.getConstantPool();
final StringInfoList constantStrings = constantPool.getStrings();
final MultinameInfoList multiNames = constantPool.getMultinames();
final NamespaceInfoList namespaces = constantPool.getNamespaces();
// In the first round we are using the existing mapping between method bodies
// and method information fields to create the inverse mapping.
for (final MethodBody methodBody : methodBodies) {
final int methodIndex = methodBody.getMethod().value();
if (methodIndex >= methodInfos.size()) {
errors.add(String.format("Can not find method header for method %d because method header ID is out of bounds", methodIndex));
}
else {
final MethodInfo methodInfo = data.getMethodInfos().get(methodIndex);