Program: 52840
Project: 52840
Buggy source:
/** 
 * Create a cell provider at a given root. 
 */
public static CellProvider createForLocalBuild(ProjectFilesystem rootFilesystem,Watchman watchman,BuckConfig rootConfig,CellConfig rootCellConfigOverrides,PluginManager pluginManager,ImmutableMap<String,String> environment,ProcessExecutor processExecutor,ExecutableFinder executableFinder,ProjectFilesystemFactory projectFilesystemFactory){
  DefaultCellPathResolver rootCellCellPathResolver=DefaultCellPathResolver.of(rootFilesystem.getRootPath(),rootConfig.getConfig());
  ImmutableMap<RelativeCellName,Path> cellPathMapping=rootCellCellPathResolver.getPathMapping();
  ImmutableMap<Path,RawConfig> pathToConfigOverrides;
  try {
    pathToConfigOverrides=rootCellConfigOverrides.getOverridesByPath(cellPathMapping);
  }
 catch (  CellConfig.MalformedOverridesException e) {
    throw new HumanReadableException(e.getMessage());
  }
  ImmutableSet<Path> allRoots=ImmutableSet.copyOf(cellPathMapping.values());
  return new CellProvider(cellProvider -> new CacheLoader<Path,Cell>(){
    @Override public Cell load(    Path cellPath) throws IOException, InterruptedException {
      Path normalizedCellPath=cellPath.toRealPath().normalize();
      Preconditions.checkState(allRoots.contains(normalizedCellPath),"String_Node_Str",normalizedCellPath,allRoots);
      RawConfig configOverrides=Optional.ofNullable(pathToConfigOverrides.get(normalizedCellPath)).orElse(RawConfig.of(ImmutableMap.of()));
      Config config=Configs.createDefaultConfig(normalizedCellPath,configOverrides);
      ImmutableMap<String,Path> cellMapping=DefaultCellPathResolver.getCellPathsFromConfigRepositoriesSection(cellPath,config.get(DefaultCellPathResolver.REPOSITORIES_SECTION));
      cellMapping.forEach((name,path) -> {
        Path pathInRootResolver=rootCellCellPathResolver.getCellPaths().get(name);
        if (pathInRootResolver == null) {
          throw new HumanReadableException("String_Node_Str",cellPath.toString(),DefaultCellPathResolver.REPOSITORIES_SECTION,name);
        }
 else         if (!pathInRootResolver.equals(path)) {
          throw new HumanReadableException("String_Node_Str" + "String_Node_Str",cellPath.toString(),DefaultCellPathResolver.REPOSITORIES_SECTION,name,pathInRootResolver,path);
        }
      }
);
      CellPathResolver cellPathResolver=new CellPathResolverView(rootCellCellPathResolver,cellMapping.keySet(),cellPath);
      Optional<EmbeddedCellBuckOutInfo> embeddedCellBuckOutInfo=Optional.empty();
      Optional<String> canonicalCellName=cellPathResolver.getCanonicalCellName(normalizedCellPath);
      if (rootConfig.isEmbeddedCellBuckOutEnabled() && canonicalCellName.isPresent()) {
        embeddedCellBuckOutInfo=Optional.of(EmbeddedCellBuckOutInfo.of(rootFilesystem.resolve(rootFilesystem.getBuckPaths().getBuckOut()),canonicalCellName.get()));
      }
      ProjectFilesystem cellFilesystem=projectFilesystemFactory.createProjectFilesystem(normalizedCellPath,config,embeddedCellBuckOutInfo);
      BuckConfig buckConfig=new BuckConfig(config,cellFilesystem,rootConfig.getArchitecture(),rootConfig.getPlatform(),rootConfig.getEnvironment(),cellPathResolver);
      RuleKeyConfiguration ruleKeyConfiguration=ConfigRuleKeyConfigurationFactory.create(buckConfig,pluginManager);
      ToolchainProvider toolchainProvider=new DefaultToolchainProvider(pluginManager,environment,buckConfig,cellFilesystem,processExecutor,executableFinder,ruleKeyConfiguration);
      return Cell.of(getKnownRoots(cellPathResolver),canonicalCellName,cellFilesystem,watchman,buckConfig,cellProvider,toolchainProvider,ruleKeyConfiguration);
    }
  }
,cellProvider -> {
    Preconditions.checkState(!rootCellCellPathResolver.getCanonicalCellName(rootFilesystem.getRootPath()).isPresent(),"String_Node_Str");
    RuleKeyConfiguration ruleKeyConfiguration=ConfigRuleKeyConfigurationFactory.create(rootConfig,pluginManager);
    ToolchainProvider toolchainProvider=new DefaultToolchainProvider(pluginManager,environment,rootConfig,rootFilesystem,processExecutor,executableFinder,ruleKeyConfiguration);
    return Cell.of(getKnownRoots(rootCellCellPathResolver),Optional.empty(),rootFilesystem,watchman,rootConfig,cellProvider,toolchainProvider,ruleKeyConfiguration);
  }
);
}

Fixed version (ground truth):
/** 
 * Create a cell provider at a given root. 
 */
public static CellProvider createForLocalBuild(ProjectFilesystem rootFilesystem,Watchman watchman,BuckConfig rootConfig,CellConfig rootCellConfigOverrides,PluginManager pluginManager,ImmutableMap<String,String> environment,ProcessExecutor processExecutor,ExecutableFinder executableFinder,ProjectFilesystemFactory projectFilesystemFactory){
  DefaultCellPathResolver rootCellCellPathResolver=DefaultCellPathResolver.of(rootFilesystem.getRootPath(),rootConfig.getConfig());
  ImmutableMap<RelativeCellName,Path> cellPathMapping=rootCellCellPathResolver.getPathMapping();
  ImmutableMap<Path,RawConfig> pathToConfigOverrides;
  try {
    pathToConfigOverrides=rootCellConfigOverrides.getOverridesByPath(cellPathMapping);
  }
 catch (  CellConfig.MalformedOverridesException e) {
    throw new HumanReadableException(e.getMessage());
  }
  ImmutableSet<Path> allRoots=ImmutableSet.copyOf(cellPathMapping.values());
  return new CellProvider(cellProvider -> new CacheLoader<Path,Cell>(){
    @Override public Cell load(    Path cellPath) throws IOException, InterruptedException {
      Path normalizedCellPath=cellPath.toRealPath().normalize();
      Preconditions.checkState(allRoots.contains(normalizedCellPath),"String_Node_Str",normalizedCellPath,allRoots);
      RawConfig configOverrides=Optional.ofNullable(pathToConfigOverrides.get(normalizedCellPath)).orElse(RawConfig.of(ImmutableMap.of()));
      Config config=Configs.createDefaultConfig(normalizedCellPath,configOverrides);
      ImmutableMap<String,Path> cellMapping=DefaultCellPathResolver.getCellPathsFromConfigRepositoriesSection(cellPath,config.get(DefaultCellPathResolver.REPOSITORIES_SECTION));
      cellMapping.forEach((name,path) -> {
        Path pathInRootResolver=rootCellCellPathResolver.getCellPaths().get(name);
        if (pathInRootResolver == null) {
          throw new HumanReadableException("String_Node_Str",cellPath.toString(),DefaultCellPathResolver.REPOSITORIES_SECTION,name);
        }
 else         if (!pathInRootResolver.equals(path)) {
          throw new HumanReadableException("String_Node_Str" + "String_Node_Str",cellPath.toString(),DefaultCellPathResolver.REPOSITORIES_SECTION,name,pathInRootResolver,path);
        }
      }
);
      CellPathResolver cellPathResolver=new CellPathResolverView(rootCellCellPathResolver,cellMapping.keySet(),cellPath);
      Optional<EmbeddedCellBuckOutInfo> embeddedCellBuckOutInfo=Optional.empty();
      Optional<String> canonicalCellName=cellPathResolver.getCanonicalCellName(normalizedCellPath);
      if (rootConfig.isEmbeddedCellBuckOutEnabled() && canonicalCellName.isPresent()) {
        embeddedCellBuckOutInfo=Optional.of(EmbeddedCellBuckOutInfo.of(rootFilesystem.resolve(rootFilesystem.getBuckPaths().getEmbeddedCellsBuckOutBaseDir()),canonicalCellName.get()));
      }
      ProjectFilesystem cellFilesystem=projectFilesystemFactory.createProjectFilesystem(normalizedCellPath,config,embeddedCellBuckOutInfo);
      BuckConfig buckConfig=new BuckConfig(config,cellFilesystem,rootConfig.getArchitecture(),rootConfig.getPlatform(),rootConfig.getEnvironment(),cellPathResolver);
      RuleKeyConfiguration ruleKeyConfiguration=ConfigRuleKeyConfigurationFactory.create(buckConfig,pluginManager);
      ToolchainProvider toolchainProvider=new DefaultToolchainProvider(pluginManager,environment,buckConfig,cellFilesystem,processExecutor,executableFinder,ruleKeyConfiguration);
      return Cell.of(getKnownRoots(cellPathResolver),canonicalCellName,cellFilesystem,watchman,buckConfig,cellProvider,toolchainProvider,ruleKeyConfiguration);
    }
  }
,cellProvider -> {
    Preconditions.checkState(!rootCellCellPathResolver.getCanonicalCellName(rootFilesystem.getRootPath()).isPresent(),"String_Node_Str");
    RuleKeyConfiguration ruleKeyConfiguration=ConfigRuleKeyConfigurationFactory.create(rootConfig,pluginManager);
    ToolchainProvider toolchainProvider=new DefaultToolchainProvider(pluginManager,environment,rootConfig,rootFilesystem,processExecutor,executableFinder,ruleKeyConfiguration);
    return Cell.of(getKnownRoots(rootCellCellPathResolver),Optional.empty(),rootFilesystem,watchman,rootConfig,cellProvider,toolchainProvider,ruleKeyConfiguration);
  }
);
}