}
private String getClassSource(Project project, String className) throws IntelliJCoderException {
Module module = ModuleManager.getInstance(project).findModuleByName(className);
if(module == null) {
throw new IntelliJCoderException("Cannot find module '" + className + "'.");
}
VirtualFile[] sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots();
if(sourceRoots.length == 0) {
throw new IntelliJCoderException("Module '" + className + "' has no source roots.");
}
VirtualFile source = sourceRoots[0].findChild(classFileName(className));
if(source == null) {
throw new IntelliJCoderException("Cannot find file '" + classFileName(className) + "'.");
}
PsiFile psiFile = PsiManager.getInstance(project).findFile(source);
assert psiFile != null;
return psiFile.getText();
}