private ImmutableList<BlazeSourceDirectory> calculateSourceDirectoriesForContentRoot(BlazeContext context,WorkspaceRoot workspaceRoot,ArtifactLocationDecoder artifactLocationDecoder,SourceTestConfig sourceTestConfig,WorkspacePath directoryRoot,Collection<SourceArtifact> sourceArtifacts,Collection<JavaPackageReader> javaPackageReaders){
  List<SourceArtifact> javaArtifacts=Lists.newArrayList();
  for (  SourceArtifact sourceArtifact : sourceArtifacts) {
    if (isJavaFile(sourceArtifact.artifactLocation)) {
      javaArtifacts.add(sourceArtifact);
    }
  }
  List<BlazeSourceDirectory> result=Lists.newArrayList();
  calculateJavaSourceDirectories(context,workspaceRoot,artifactLocationDecoder,directoryRoot,sourceTestConfig,javaArtifacts,javaPackageReaders,result);
  Collections.sort(result,BlazeSourceDirectory.COMPARATOR);
  return ImmutableList.copyOf(result);
}

private ImmutableList < BlazeSourceDirectory > calculateSourceDirectoriesForContentRoot ( BlazeContext context , WorkspaceRoot workspaceRoot , ArtifactLocationDecoder artifactLocationDecoder , SourceTestConfig sourceTestConfig , WorkspacePath directoryRoot , Collection < SourceArtifact > sourceArtifacts , Collection < JavaPackageReader > javaPackageReaders ) { List < SourceArtifact > javaArtifacts = Lists . newArrayList ( ) ; for ( SourceArtifact sourceArtifact : sourceArtifacts ) { if ( isJavaFile ( sourceArtifact . artifactLocation ) ) { javaArtifacts . add ( sourceArtifact ) ; } } List < BlazeSourceDirectory > result = Lists . newArrayList ( ) ; calculateJavaSourceDirectories ( context , workspaceRoot , artifactLocationDecoder , directoryRoot , sourceTestConfig , javaArtifacts , javaPackageReaders , result ) ; Collections . sort ( result , BlazeSourceDirectory . COMPARATOR ) ; return ImmutableList . copyOf ( result ) ; }
calculates all source directories for a single content root .
