private static boolean shouldDownloadSources(@NotNull ModelBuilderContext context, @NotNull Project project) {
    // this is necessary for the explicit 'Download sources' action, and also to ensure that sources can be disabled for the headless idea
    // regardless of user settings
    String forcePropertyValue = System.getProperty(DOWNLOAD_SOURCES_FORCE_PROPERTY_NAME);
    if (forcePropertyValue != null) {
      return Boolean.parseBoolean(forcePropertyValue);
    }
    IdeaModule ideaModule = GradleIdeaPluginUtil.getIdeaModule(project);
    if (ideaModule != null) {
      return ideaModule.isDownloadSources();
    }
    GradleDependencyDownloadPolicy parentPolicy = getParentDependencyDownloadPolicy(context, project);
    if (parentPolicy != null) {
      return parentPolicy.isDownloadSources();
    }
    // default IDE policy
    return Boolean.parseBoolean(System.getProperty(DOWNLOAD_SOURCES_PROPERTY_NAME, "false"));
  }
private static boolean shouldDownloadSources(@NotNull ModelBuilderContext context, @NotNull Project project)