public static boolean checkSourceRootsConfigured(@NotNull Module module, boolean askUserToSetupSourceRoots) {
    List<VirtualFile> sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots(JavaModuleSourceRootTypes.SOURCES);
    if (sourceRoots.isEmpty()) {
      if (!askUserToSetupSourceRoots) {
        return false;
      }

      Project project = module.getProject();
      Messages.showErrorDialog(project,
                               ProjectBundle.message("module.source.roots.not.configured.error", module.getName()),
                               ProjectBundle.message("module.source.roots.not.configured.title"));

      ProjectSettingsService.getInstance(project).showModuleConfigurationDialog(module.getName(), CommonContentEntriesEditor.getName());

      sourceRoots = ModuleRootManager.getInstance(module).getSourceRoots(JavaModuleSourceRootTypes.SOURCES);
      if (sourceRoots.isEmpty()) return false;
    }
    return true;
  }
public static boolean checkSourceRootsConfigured(@NotNull Module module, boolean askUserToSetupSourceRoots)