AbstractMethodDeclaration amd, Throwable e) {
if (e instanceof OutOfMemoryError) {
// Always rethrow OOMs (might have no memory to load ICE class anyway).
throw (OutOfMemoryError) e;
}
InternalCompilerException ice;
if (e instanceof InternalCompilerException) {
ice = (InternalCompilerException) e;
} else {
ice = new InternalCompilerException("Error building type map", e);
}
ice.addNode(amd.getClass().getName(), amd.toString(), makeSourceInfo(amd,
null));
return ice;
}