Program: 52866
Project: 52866
Buggy source:
@Test public void testSwiftDependencyBuildPhase() throws IOException {
  BuildTarget fooBuildTarget=BuildTargetFactory.newInstance(rootPath,"String_Node_Str","String_Node_Str");
  BuildTarget barBuildTarget=BuildTargetFactory.newInstance(rootPath,"String_Node_Str","String_Node_Str");
  TargetNode<?,?> fooNode=AppleLibraryBuilder.createBuilder(fooBuildTarget).setConfigs(ImmutableSortedMap.of("String_Node_Str",ImmutableMap.of())).setSrcs(ImmutableSortedSet.of(SourceWithFlags.of(FakeSourcePath.of("String_Node_Str")))).setSwiftVersion(Optional.of("String_Node_Str")).setXcodePublicHeadersSymlinks(false).setXcodePrivateHeadersSymlinks(false).build();
  TargetNode<?,?> barNode=AppleLibraryBuilder.createBuilder(barBuildTarget).setConfigs(ImmutableSortedMap.of("String_Node_Str",ImmutableMap.of())).setSrcs(ImmutableSortedSet.of(SourceWithFlags.of(FakeSourcePath.of("String_Node_Str")))).setDeps(ImmutableSortedSet.of(fooBuildTarget)).setSwiftVersion(Optional.of("String_Node_Str")).setXcodePublicHeadersSymlinks(false).setXcodePrivateHeadersSymlinks(false).build();
  ImmutableSet.Builder<ProjectGenerator.Option> optionsBuilder=ImmutableSet.builder();
  ImmutableSet<ProjectGenerator.Option> projectGeneratorOptions=optionsBuilder.build();
  ProjectGenerator projectGenerator=createProjectGeneratorForCombinedProject(ImmutableSet.of(fooNode,barNode),projectGeneratorOptions);
  projectGenerator.createXcodeProjects();
  PBXProject pbxProject=projectGenerator.getGeneratedProject();
  PBXTarget pbxTarget=assertTargetExistsAndReturnTarget(pbxProject,"String_Node_Str");
  ImmutableSet<PBXBuildPhase> fakeDepPhases=FluentIterable.from(pbxTarget.getBuildPhases()).filter(phase -> {
    return phase.getName().equals(Optional.of("String_Node_Str"));
  }
).toSet();
  assertThat(fakeDepPhases.size(),equalTo(1));
}

Fixed version (ground truth):
@Test public void testSwiftDependencyBuildPhase() throws IOException {
  BuildTarget fooBuildTarget=BuildTargetFactory.newInstance(rootPath,"String_Node_Str","String_Node_Str");
  BuildTarget barBuildTarget=BuildTargetFactory.newInstance(rootPath,"String_Node_Str","String_Node_Str");
  TargetNode<?,?> fooNode=AppleLibraryBuilder.createBuilder(fooBuildTarget).setConfigs(ImmutableSortedMap.of("String_Node_Str",ImmutableMap.of())).setSrcs(ImmutableSortedSet.of(SourceWithFlags.of(FakeSourcePath.of("String_Node_Str")))).setSwiftVersion(Optional.of("String_Node_Str")).setXcodePublicHeadersSymlinks(false).setXcodePrivateHeadersSymlinks(false).build();
  TargetNode<?,?> barNode=AppleLibraryBuilder.createBuilder(barBuildTarget).setConfigs(ImmutableSortedMap.of("String_Node_Str",ImmutableMap.of())).setSrcs(ImmutableSortedSet.of(SourceWithFlags.of(FakeSourcePath.of("String_Node_Str")))).setDeps(ImmutableSortedSet.of(fooBuildTarget)).setSwiftVersion(Optional.of("String_Node_Str")).setXcodePublicHeadersSymlinks(false).setXcodePrivateHeadersSymlinks(false).build();
  ImmutableSet.Builder<ProjectGenerator.Option> optionsBuilder=ImmutableSet.builder();
  ImmutableSet<ProjectGenerator.Option> projectGeneratorOptions=optionsBuilder.build();
  ProjectGenerator projectGenerator=createProjectGeneratorForCombinedProject(ImmutableSet.of(fooNode,barNode),projectGeneratorOptions);
  projectGenerator.createXcodeProjects();
  PBXProject pbxProject=projectGenerator.getGeneratedProject();
  PBXTarget pbxTarget=assertTargetExistsAndReturnTarget(pbxProject,"String_Node_Str");
  ImmutableSet<PBXBuildPhase> fakeDepPhases=FluentIterable.from(pbxTarget.getBuildPhases()).filter(phase -> {
    return phase.getName().equals(Optional.of("String_Node_Str"));
  }
).toSet();
  assertThat(fakeDepPhases.size(),equalTo(1));
  ImmutableMap<String,String> buildSettings=getBuildSettings(barBuildTarget,pbxTarget,"String_Node_Str");
  assertThat(buildSettings.get("String_Node_Str"),equalTo("String_Node_Str"));
}