nus-yam/ex-repair huggingface dataset:
Program: 110534
Project: 110534
Buggy source:
/** 
 * Pauses the current thread's execution, blocking until it's resumed via a ContinueExecutionRequest.
 */
private void pauseCurrentThread(Environment env,Location location,DebugServerTransport transport){
  long threadId=Thread.currentThread().getId();
  SkylarkDebuggingProtos.Thread threadProto;
  PausedThreadState pausedState;
synchronized (threads) {
    ThreadState thread=threads.get(threadId);
    if (thread == null) {
      String fallbackThreadName="String_Node_Str" + threadId;
      transport.postEvent(DebugEventHelper.threadStartedEvent(threadId,fallbackThreadName));
      thread=doRegisterThread(threadId,fallbackThreadName,env);
    }
    threadProto=getThreadProto(thread);
    pausedState=new PausedThreadState(location);
    thread.pausedState=pausedState;
  }
  transport.postEvent(DebugEventHelper.threadPausedEvent(threadProto));
  pausedState.semaphore.acquireUninterruptibly();
  transport.postEvent(DebugEventHelper.threadContinuedEvent(threadProto));
}

Fixed version (ground truth):
/** 
 * Pauses the current thread's execution, blocking until it's resumed via a ContinueExecutionRequest.
 */
private void pauseCurrentThread(Environment env,Location location,DebugServerTransport transport){
  long threadId=Thread.currentThread().getId();
  SkylarkDebuggingProtos.Thread threadProto;
  PausedThreadState pausedState;
synchronized (threads) {
    ThreadState thread=threads.get(threadId);
    if (thread == null) {
      String fallbackThreadName="String_Node_Str" + threadId;
      transport.postEvent(DebugEventHelper.threadStartedEvent(threadId,fallbackThreadName));
      thread=doRegisterThread(threadId,fallbackThreadName,env);
    }
    pausedState=new PausedThreadState(location);
    thread.pausedState=pausedState;
    threadProto=getThreadProto(thread);
  }
  transport.postEvent(DebugEventHelper.threadPausedEvent(threadProto));
  pausedState.semaphore.acquireUninterruptibly();
  transport.postEvent(DebugEventHelper.threadContinuedEvent(threadProto.toBuilder().clearLocation().setIsPaused(false).build()));
}
Program: 110535
Project: 110535
Buggy source:
/** 
 * Returns whether a test with the specified tags matches a filter (as specified by the set of its positive and its negative filters).
 */
public static boolean testMatchesFilters(Collection<String> testTags,Collection<String> requiredTags,Collection<String> excludedTags,boolean mustMatchAllPositive){
  for (  String tag : excludedTags) {
    if (testTags.contains(tag)) {
      return false;
    }
  }
  if (!requiredTags.isEmpty()) {
    if (mustMatchAllPositive) {
      for (      String tag : requiredTags) {
        if (!testTags.contains(tag)) {
          return false;
        }
      }
      return true;
    }
 else {
      for (      String tag : requiredTags) {
        if (testTags.contains(tag)) {
          return true;
        }
      }
    }
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Decides whether to include a test in a test_suite or not.
 * @param testTarget A given test target.
 * @param requiredTags Tags declared by the suite. A Test must match ALL of these.
 * @param excludedTags Tags declared by the suite. A Test must match NONE of these.
 * @return false is the test is to be removed.
 */
private static boolean testMatchesFilters(Rule testTarget,Collection<String> requiredTags,Collection<String> excludedTags){
  AttributeMap nonConfigurableAttrs=NonconfigurableAttributeMapper.of(testTarget);
  Set<String> testTags=new HashSet<>(nonConfigurableAttrs.get("String_Node_Str",Type.STRING_LIST));
  testTags.add(nonConfigurableAttrs.get("String_Node_Str",Type.STRING));
  return testMatchesFilters(testTags,requiredTags,excludedTags);
}
Program: 110536
Project: 110536
Buggy source:
/** 
 * Populates 'result' with all the tests associated with the specified 'testSuite'.  Throws an exception if any target is missing. CAUTION!  Keep this logic consistent with   {@code TestsSuiteConfiguredTarget}!
 */
private void computeTestsInSuite(Rule testSuite,Set<Target> result) throws TargetParsingException {
  List<Target> testsAndSuites=new ArrayList<>();
  testsAndSuites.addAll(getPrerequisites(testSuite,"String_Node_Str"));
  for (  Target test : testsAndSuites) {
    if (TargetUtils.isTestRule(test)) {
      result.add(test);
    }
 else     if (strict && !TargetUtils.isTestSuiteRule(test)) {
      eventHandler.handle(Event.error(testSuite.getLocation(),"String_Node_Str" + testSuite.getLabel() + "String_Node_Str"+ test.getLabel()+ "String_Node_Str"));
      hasError=true;
      if (!keepGoing) {
        throw new TargetParsingException("String_Node_Str");
      }
    }
  }
  for (  Target target : getPrerequisites(testSuite,"String_Node_Str")) {
    if (TargetUtils.isTestRule(target)) {
      result.add(target);
    }
  }
  filterTests(testSuite,result);
  for (  Target suite : testsAndSuites) {
    if (TargetUtils.isTestSuiteRule(suite)) {
      result.addAll(getTestsInSuite((Rule)suite));
    }
  }
}

Fixed version (ground truth):
/** 
 * Populates 'result' with all the tests associated with the specified 'testSuite'.  Throws an exception if any target is missing. CAUTION!  Keep this logic consistent with   {@code TestSuite} and {@code TestsInSuiteFunction}!
 */
private void computeTestsInSuite(Rule testSuite,Set<Target> result) throws TargetParsingException {
  List<Target> testsAndSuites=new ArrayList<>();
  testsAndSuites.addAll(getPrerequisites(testSuite,"String_Node_Str"));
  for (  Target test : testsAndSuites) {
    if (TargetUtils.isTestRule(test)) {
      result.add(test);
    }
 else     if (strict && !TargetUtils.isTestSuiteRule(test)) {
      eventHandler.handle(Event.error(testSuite.getLocation(),"String_Node_Str" + testSuite.getLabel() + "String_Node_Str"+ test.getLabel()+ "String_Node_Str"));
      hasError=true;
      if (!keepGoing) {
        throw new TargetParsingException("String_Node_Str");
      }
    }
  }
  for (  Target target : getPrerequisites(testSuite,"String_Node_Str")) {
    if (TargetUtils.isTestRule(target)) {
      result.add(target);
    }
  }
  filterTests(testSuite,result);
  for (  Target suite : testsAndSuites) {
    if (TargetUtils.isTestSuiteRule(suite)) {
      result.addAll(getTestsInSuite((Rule)suite));
    }
  }
}
Program: 110537
Project: 110537
Buggy source:
/** 
 * Filters 'tests' (by mutation) according to the 'tags' attribute, specifically those that match ALL of the tags in tagsAttribute.
 * @precondition {@code env.getAccessor().isTestSuite(testSuite)}
 * @precondition {@code env.getAccessor().isTestRule(test)} for all test in tests
 */
private void filterTests(Rule testSuite,Set<Target> tests){
  List<String> tagsAttribute=NonconfigurableAttributeMapper.of(testSuite).get("String_Node_Str",Type.STRING_LIST);
  Pair<Collection<String>,Collection<String>> tagLists=sortTagsBySense(tagsAttribute);
  Collection<String> positiveTags=tagLists.first;
  Collection<String> negativeTags=tagLists.second;
  Iterator<Target> it=tests.iterator();
  while (it.hasNext()) {
    Rule test=(Rule)it.next();
    AttributeMap nonConfigurableAttributes=NonconfigurableAttributeMapper.of(test);
    List<String> testTags=new ArrayList<>(nonConfigurableAttributes.get("String_Node_Str",Type.STRING_LIST));
    testTags.add(nonConfigurableAttributes.get("String_Node_Str",Type.STRING));
    if (!includeTest(testTags,positiveTags,negativeTags)) {
      it.remove();
    }
  }
}

Fixed version (ground truth):
/** 
 * Filters 'tests' (by mutation) according to the 'tags' attribute, specifically those that match ALL of the tags in tagsAttribute.
 * @precondition {@code env.getAccessor().isTestSuite(testSuite)}
 * @precondition {@code env.getAccessor().isTestRule(test)} for all test in tests
 */
public static void filterTests(Rule testSuite,Set<Target> tests){
  List<String> tagsAttribute=NonconfigurableAttributeMapper.of(testSuite).get("String_Node_Str",Type.STRING_LIST);
  Pair<Collection<String>,Collection<String>> tagLists=sortTagsBySense(tagsAttribute);
  Collection<String> positiveTags=tagLists.first;
  Collection<String> negativeTags=tagLists.second;
  tests.removeIf((  Target t) -> !testMatchesFilters((Rule)t,positiveTags,negativeTags));
}
Program: 110538
Project: 110538
Buggy source:
/** 
 * Computes and returns the set of test rules in a particular suite.  Uses dynamic programming---a memoized version of   {@link #computeTestsInSuite}.
 */
private Set<Target> getTestsInSuite(Rule testSuite) throws TargetParsingException {
  Set<Target> tests=testsInSuite.get(testSuite);
  if (tests == null) {
    tests=Sets.newHashSet();
    testsInSuite.put(testSuite,tests);
    computeTestsInSuite(testSuite,tests);
  }
  return tests;
}

Fixed version (ground truth):
/** 
 * Computes and returns the set of test rules in a particular suite.  Uses dynamic programming---a memoized version of   {@link #computeTestsInSuite}.
 */
private Set<Target> getTestsInSuite(Rule testSuite) throws TargetParsingException {
  Set<Target> tests=testsInSuite.get(testSuite);
  if (tests == null) {
    tests=new HashSet<>();
    testsInSuite.put(testSuite,tests);
    computeTestsInSuite(testSuite,tests);
  }
  return tests;
}
Program: 110539
Project: 110539
Buggy source:
@Override public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException, RuleErrorException, ActionConflictException {
  checkTestsAndSuites(ruleContext,"String_Node_Str");
  if (ruleContext.hasErrors()) {
    return null;
  }
  List<String> tagsAttribute=new ArrayList<>(ruleContext.attributes().get("String_Node_Str",Type.STRING_LIST));
  tagsAttribute.remove("String_Node_Str");
  Pair<Collection<String>,Collection<String>> requiredExcluded=TestTargetUtils.sortTagsBySense(tagsAttribute);
  List<TransitiveInfoCollection> directTestsAndSuitesBuilder=new ArrayList<>();
  for (  TransitiveInfoCollection dep : Iterables.concat(getPrerequisites(ruleContext,"String_Node_Str"),getPrerequisites(ruleContext,"String_Node_Str"))) {
    if (dep.getProvider(TestProvider.class) != null) {
      List<String> tags=dep.getProvider(TestProvider.class).getTestTags();
      if (!TestTargetUtils.testMatchesFilters(tags,requiredExcluded.first,requiredExcluded.second,true)) {
        continue;
      }
    }
    directTestsAndSuitesBuilder.add(dep);
  }
  Runfiles runfiles=new Runfiles.Builder(ruleContext.getWorkspaceName(),ruleContext.getConfiguration().legacyExternalRunfiles()).addTargets(directTestsAndSuitesBuilder,RunfilesProvider.DATA_RUNFILES).build();
  return new RuleConfiguredTargetBuilder(ruleContext).add(RunfilesProvider.class,RunfilesProvider.withData(Runfiles.EMPTY,runfiles)).add(TransitiveTestsProvider.class,new TransitiveTestsProvider()).build();
}

Fixed version (ground truth):
@Override public ConfiguredTarget create(RuleContext ruleContext) throws InterruptedException, RuleErrorException, ActionConflictException {
  checkTestsAndSuites(ruleContext,"String_Node_Str");
  if (ruleContext.hasErrors()) {
    return null;
  }
  List<String> tagsAttribute=new ArrayList<>(ruleContext.attributes().get("String_Node_Str",Type.STRING_LIST));
  tagsAttribute.remove("String_Node_Str");
  Pair<Collection<String>,Collection<String>> requiredExcluded=TestTargetUtils.sortTagsBySense(tagsAttribute);
  List<TransitiveInfoCollection> directTestsAndSuitesBuilder=new ArrayList<>();
  for (  TransitiveInfoCollection dep : Iterables.concat(getPrerequisites(ruleContext,"String_Node_Str"),getPrerequisites(ruleContext,"String_Node_Str"))) {
    if (dep.getProvider(TestProvider.class) != null) {
      List<String> tags=dep.getProvider(TestProvider.class).getTestTags();
      if (!TestTargetUtils.testMatchesFilters(tags,requiredExcluded.first,requiredExcluded.second)) {
        continue;
      }
    }
    directTestsAndSuitesBuilder.add(dep);
  }
  Runfiles runfiles=new Runfiles.Builder(ruleContext.getWorkspaceName(),ruleContext.getConfiguration().legacyExternalRunfiles()).addTargets(directTestsAndSuitesBuilder,RunfilesProvider.DATA_RUNFILES).build();
  return new RuleConfiguredTargetBuilder(ruleContext).add(RunfilesProvider.class,RunfilesProvider.withData(Runfiles.EMPTY,runfiles)).add(TransitiveTestsProvider.class,new TransitiveTestsProvider()).build();
}
Program: 110540
Project: 110540
Buggy source:
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")}) public Integer invoke(String self,String sub,Integer start,Object end) throws ConversionException {
  return stringFind(true,self,sub,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")}) public Integer invoke(String self,String sub,Integer start,Object end) throws ConversionException {
  return stringFind(true,self,sub,start,end,"String_Node_Str");
}
Program: 110541
Project: 110541
Buggy source:
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")}) public Integer rfind(String self,String sub,Integer start,Object end) throws ConversionException {
  return stringFind(false,self,sub,start,end,"String_Node_Str");
}

Fixed version (ground truth):
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")}) public Integer rfind(String self,String sub,Integer start,Object end) throws ConversionException {
  return stringFind(false,self,sub,start,end,"String_Node_Str");
}
Program: 110542
Project: 110542
Buggy source:
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")},useLocation=true) public Integer rindex(String self,String sub,Integer start,Object end,Location loc) throws EvalException {
  int res=stringFind(false,self,sub,start,end,"String_Node_Str");
  if (res < 0) {
    throw new EvalException(loc,Printer.format("String_Node_Str",sub,self));
  }
  return res;
}

Fixed version (ground truth):
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")},useLocation=true) public Integer rindex(String self,String sub,Integer start,Object end,Location loc) throws EvalException {
  int res=stringFind(false,self,sub,start,end,"String_Node_Str");
  if (res < 0) {
    throw new EvalException(loc,Printer.format("String_Node_Str",sub,self));
  }
  return res;
}
Program: 110543
Project: 110543
Buggy source:
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")},useLocation=true) public Integer index(String self,String sub,Integer start,Object end,Location loc) throws EvalException {
  int res=stringFind(true,self,sub,start,end,"String_Node_Str");
  if (res < 0) {
    throw new EvalException(loc,Printer.format("String_Node_Str",sub,self));
  }
  return res;
}

Fixed version (ground truth):
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")},useLocation=true) public Integer index(String self,String sub,Integer start,Object end,Location loc) throws EvalException {
  int res=stringFind(true,self,sub,start,end,"String_Node_Str");
  if (res < 0) {
    throw new EvalException(loc,Printer.format("String_Node_Str",sub,self));
  }
  return res;
}
Program: 110544
Project: 110544
Buggy source:
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")}) public Boolean endsWith(String self,String sub,Integer start,Object end) throws ConversionException {
  return pythonSubstring(self,start,end,"String_Node_Str").endsWith(sub);
}

Fixed version (ground truth):
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")}) public Boolean endsWith(String self,String sub,Integer start,Object end) throws ConversionException {
  return pythonSubstring(self,start,end,"String_Node_Str").endsWith(sub);
}
Program: 110545
Project: 110545
Buggy source:
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")}) public Boolean startsWith(String self,String sub,Integer start,Object end) throws ConversionException {
  return pythonSubstring(self,start,end,"String_Node_Str").startsWith(sub);
}

Fixed version (ground truth):
@SkylarkCallable(name="String_Node_Str",doc="String_Node_Str" + "String_Node_Str" + "String_Node_Str",parameters={@Param(name="String_Node_Str",type=String.class,doc="String_Node_Str"),@Param(name="String_Node_Str",type=String.class,legacyNamed=true,doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,defaultValue="String_Node_Str",doc="String_Node_Str"),@Param(name="String_Node_Str",type=Integer.class,legacyNamed=true,noneable=true,defaultValue="String_Node_Str",doc="String_Node_Str")}) public Boolean startsWith(String self,String sub,Integer start,Object end) throws ConversionException {
  return pythonSubstring(self,start,end,"String_Node_Str").startsWith(sub);
}
Program: 110548
Project: 110548
Buggy source:
static AndroidAssets empty(){
  return new AndroidAssets(ImmutableList.of(),ImmutableList.of());
}

Fixed version (ground truth):
public static AndroidAssets empty(){
  return new AndroidAssets(ImmutableList.of(),ImmutableList.of());
}
Program: 110551
Project: 110551
Buggy source:
/** 
 * Merges the manifest with any dependent manifests. <p>The resulting manifest will be stamped, even if no merging was done.
 */
public StampedAndroidManifest mergeWithDeps(RuleContext ruleContext){
  return ApplicationManifest.maybeMergeWith(ruleContext,manifest,ResourceDependencies.fromRuleDeps(ruleContext,false),ApplicationManifest.getManifestValues(ruleContext)).map(merged -> new StampedAndroidManifest(merged,pkg,exported)).orElseGet(() -> stamp(ruleContext));
}

Fixed version (ground truth):
private StampedAndroidManifest mergeWithDeps(RuleContext ruleContext,ResourceDependencies resourceDeps){
  Artifact newManifest=ApplicationManifest.maybeMergeWith(ruleContext,manifest,resourceDeps,ApplicationManifest.getManifestValues(ruleContext)).orElse(manifest);
  return new StampedAndroidManifest(newManifest,pkg,exported);
}
Program: 110552
Project: 110552
Buggy source:
public ProcessedAndroidData build(AndroidResources primaryResources,AndroidAssets primaryAssets,StampedAndroidManifest primaryManifest){
  if (aaptVersion == AndroidAaptVersion.AAPT2) {
    createAapt2ApkAction(primaryResources,primaryAssets,primaryManifest);
  }
 else {
    createAaptAction(primaryResources,primaryAssets,primaryManifest);
  }
  ProcessedAndroidManifest processedManifest=new ProcessedAndroidManifest(manifestOut == null ? primaryManifest.getManifest() : manifestOut,primaryManifest.getPackage(),primaryManifest.isExported());
  ParsedAndroidResources parsedResources=ParsedAndroidResources.of(primaryResources,symbols,null,ruleContext.getLabel(),processedManifest);
  ParsedAndroidAssets parsedAssets=ParsedAndroidAssets.of(primaryAssets,symbols,ruleContext.getLabel());
  MergedAndroidAssets mergedAssets=MergedAndroidAssets.of(parsedAssets,mergedResourcesOut,assetDependencies);
  return ProcessedAndroidData.of(parsedResources,mergedAssets,processedManifest,rTxtOut,sourceJarOut,apkOut,dataBindingInfoZip,resourceDependencies);
}

Fixed version (ground truth):
public ProcessedAndroidData build(AndroidResources primaryResources,AndroidAssets primaryAssets,StampedAndroidManifest primaryManifest){
  if (aaptVersion == AndroidAaptVersion.AAPT2) {
    createAapt2ApkAction(primaryResources,primaryAssets,primaryManifest);
  }
 else {
    createAaptAction(primaryResources,primaryAssets,primaryManifest);
  }
  ProcessedAndroidManifest processedManifest=new ProcessedAndroidManifest(manifestOut == null ? primaryManifest.getManifest() : manifestOut,primaryManifest.getPackage(),primaryManifest.isExported());
  ParsedAndroidResources parsedResources=ParsedAndroidResources.of(primaryResources,symbols,null,ruleContext.getLabel(),processedManifest);
  ParsedAndroidAssets parsedAssets=ParsedAndroidAssets.of(primaryAssets,symbols,ruleContext.getLabel());
  MergedAndroidAssets mergedAssets=MergedAndroidAssets.of(parsedAssets,mergedResourcesOut,assetDependencies);
  return ProcessedAndroidData.of(parsedResources,mergedAssets,processedManifest,rTxtOut,sourceJarOut,apkOut,dataBindingInfoZip,resourceDependencies,proguardOut,mainDexProguardOut);
}
Program: 110553
Project: 110553
Buggy source:
@VisibleForTesting static MergedAndroidAssets mergeFrom(RuleContext ruleContext,ParsedAndroidAssets parsed,AssetDependencies deps) throws InterruptedException {
  Artifact mergedAssets=ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_ASSETS_ZIP);
  BusyBoxActionBuilder builder=BusyBoxActionBuilder.create(ruleContext,"String_Node_Str");
  if (AndroidCommon.getAndroidConfig(ruleContext).throwOnResourceConflict()) {
    builder.addFlag("String_Node_Str");
  }
  builder.addOutput("String_Node_Str",mergedAssets).addInput("String_Node_Str",AndroidSdkProvider.fromRuleContext(ruleContext).getAndroidJar()).addInput("String_Node_Str",AndroidDataConverter.MERGABLE_DATA_CONVERTER.map(parsed),Iterables.concat(parsed.getAssets(),ImmutableList.of(parsed.getSymbols()))).addTransitiveFlag("String_Node_Str",deps.getDirectParsedAssets(),AndroidDataConverter.MERGABLE_DATA_CONVERTER).addTransitiveFlag("String_Node_Str",deps.getTransitiveParsedAssets(),AndroidDataConverter.MERGABLE_DATA_CONVERTER).addTransitiveInputValues(deps.getTransitiveAssets()).addTransitiveInputValues(deps.getTransitiveSymbols()).buildAndRegister("String_Node_Str","String_Node_Str");
  return of(parsed,mergedAssets,deps);
}

Fixed version (ground truth):
@VisibleForTesting static MergedAndroidAssets mergeFrom(RuleContext ruleContext,ParsedAndroidAssets parsed,AssetDependencies deps) throws InterruptedException {
  Artifact mergedAssets=ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_ASSETS_ZIP);
  BusyBoxActionBuilder builder=BusyBoxActionBuilder.create(ruleContext,"String_Node_Str");
  if (AndroidCommon.getAndroidConfig(ruleContext).throwOnResourceConflict()) {
    builder.addFlag("String_Node_Str");
  }
  builder.addOutput("String_Node_Str",mergedAssets).addInput("String_Node_Str",AndroidDataConverter.MERGABLE_DATA_CONVERTER.map(parsed),Iterables.concat(parsed.getAssets(),ImmutableList.of(parsed.getSymbols()))).addTransitiveFlag("String_Node_Str",deps.getDirectParsedAssets(),AndroidDataConverter.MERGABLE_DATA_CONVERTER).addTransitiveFlag("String_Node_Str",deps.getTransitiveParsedAssets(),AndroidDataConverter.MERGABLE_DATA_CONVERTER).addTransitiveInputValues(deps.getTransitiveAssets()).addTransitiveInputValues(deps.getTransitiveSymbols()).buildAndRegister("String_Node_Str","String_Node_Str");
  return of(parsed,mergedAssets,deps);
}
Program: 110554
Project: 110554
Buggy source:
public static MergedAndroidResources mergeFrom(RuleContext ruleContext,ParsedAndroidResources parsed,boolean neverlink) throws InterruptedException {
  AndroidConfiguration androidConfiguration=AndroidCommon.getAndroidConfig(ruleContext);
  boolean useCompiledMerge=androidConfiguration.getAndroidAaptVersion().equals(AndroidAaptVersion.AAPT2) && androidConfiguration.skipParsingAction();
  Preconditions.checkState(!useCompiledMerge || parsed.getCompiledSymbols() != null,"String_Node_Str");
  AndroidResourceMergingActionBuilder builder=new AndroidResourceMergingActionBuilder(ruleContext).setJavaPackage(parsed.getJavaPackage()).withDependencies(ResourceDependencies.fromRuleDeps(ruleContext,neverlink)).setThrowOnResourceConflict(androidConfiguration.throwOnResourceConflict()).setUseCompiledMerge(useCompiledMerge);
  if (DataBinding.isEnabled(ruleContext)) {
    builder.setDataBindingInfoZip(DataBinding.getLayoutInfoFile(ruleContext));
  }
  return builder.setManifestOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_PROCESSED_MANIFEST)).setMergedResourcesOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_ZIP)).setClassJarOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_CLASS_JAR)).build(ruleContext,parsed);
}

Fixed version (ground truth):
public static MergedAndroidResources mergeFrom(RuleContext ruleContext,ParsedAndroidResources parsed,boolean neverlink) throws InterruptedException, RuleErrorException {
  AndroidConfiguration androidConfiguration=AndroidCommon.getAndroidConfig(ruleContext);
  boolean useCompiledMerge=AndroidAaptVersion.chooseTargetAaptVersion(ruleContext) == AndroidAaptVersion.AAPT2 && androidConfiguration.skipParsingAction();
  Preconditions.checkState(!useCompiledMerge || parsed.getCompiledSymbols() != null,"String_Node_Str");
  AndroidResourceMergingActionBuilder builder=new AndroidResourceMergingActionBuilder(ruleContext).setJavaPackage(parsed.getJavaPackage()).withDependencies(ResourceDependencies.fromRuleDeps(ruleContext,neverlink)).setThrowOnResourceConflict(androidConfiguration.throwOnResourceConflict()).setUseCompiledMerge(useCompiledMerge);
  if (DataBinding.isEnabled(ruleContext)) {
    builder.setDataBindingInfoZip(DataBinding.getLayoutInfoFile(ruleContext));
  }
  return builder.setManifestOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_PROCESSED_MANIFEST)).setMergedResourcesOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_ZIP)).setClassJarOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_CLASS_JAR)).build(ruleContext,parsed);
}
Program: 110555
Project: 110555
Buggy source:
/** 
 * Validates and packages this rule's resources. <p>See   {@link ValidatedAndroidResources#validateFrom(RuleContext,MergedAndroidResources)}. This method is a convenience method for calling that one.
 */
public ValidatedAndroidResources validate(RuleContext ruleContext) throws InterruptedException {
  return ValidatedAndroidResources.validateFrom(ruleContext,this);
}

Fixed version (ground truth):
/** 
 * Validates and packages this rule's resources. <p>See   {@link ValidatedAndroidResources#validateFrom(RuleContext,MergedAndroidResources)}. This method is a convenience method for calling that one.
 */
public ValidatedAndroidResources validate(RuleContext ruleContext) throws InterruptedException, RuleErrorException {
  return ValidatedAndroidResources.validateFrom(ruleContext,this);
}
Program: 110556
Project: 110556
Buggy source:
public static ParsedAndroidResources parseFrom(RuleContext ruleContext,AndroidResources resources,StampedAndroidManifest manifest) throws RuleErrorException, InterruptedException {
  boolean isAapt2=AndroidAaptVersion.chooseTargetAaptVersion(ruleContext).equals(AndroidAaptVersion.AAPT2);
  AndroidResourceParsingActionBuilder builder=new AndroidResourceParsingActionBuilder(ruleContext);
  if (DataBinding.isEnabled(ruleContext) && isAapt2) {
    builder.setDataBindingInfoZip(DataBinding.getSuffixedInfoFile(ruleContext,"String_Node_Str"));
  }
  return builder.setOutput(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_MERGED_SYMBOLS)).setCompiledSymbolsOutput(isAapt2 ? ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_COMPILED_SYMBOLS) : null).build(resources,manifest);
}

Fixed version (ground truth):
public static ParsedAndroidResources parseFrom(RuleContext ruleContext,AndroidResources resources,StampedAndroidManifest manifest) throws RuleErrorException, InterruptedException {
  boolean isAapt2=AndroidAaptVersion.chooseTargetAaptVersion(ruleContext) == AndroidAaptVersion.AAPT2;
  AndroidResourceParsingActionBuilder builder=new AndroidResourceParsingActionBuilder(ruleContext);
  if (DataBinding.isEnabled(ruleContext) && isAapt2) {
    builder.setDataBindingInfoZip(DataBinding.getSuffixedInfoFile(ruleContext,"String_Node_Str"));
  }
  return builder.setOutput(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_MERGED_SYMBOLS)).setCompiledSymbolsOutput(isAapt2 ? ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_COMPILED_SYMBOLS) : null).build(resources,manifest);
}
Program: 110557
Project: 110557
Buggy source:
/** 
 * Merges this target's resources with resources from dependencies. 
 */
public MergedAndroidResources merge(RuleContext ruleContext,boolean neverlink) throws InterruptedException {
  return MergedAndroidResources.mergeFrom(ruleContext,this,neverlink);
}

Fixed version (ground truth):
/** 
 * Merges this target's resources with resources from dependencies. 
 */
public MergedAndroidResources merge(RuleContext ruleContext,boolean neverlink) throws InterruptedException, RuleErrorException {
  return MergedAndroidResources.mergeFrom(ruleContext,this,neverlink);
}
Program: 110558
Project: 110558
Buggy source:
/** 
 * Common   {@link AndroidResourcesProcessorBuilder} builder for non-incremental top-level targets.<p>The builder will be populated with commonly-used settings and outputs.
 */
private static AndroidResourcesProcessorBuilder builderForNonIncrementalTopLevelTarget(RuleContext ruleContext,StampedAndroidManifest manifest) throws InterruptedException, RuleErrorException {
  return builderForTopLevelTarget(ruleContext,manifest,"String_Node_Str").targetAaptVersion(AndroidAaptVersion.chooseTargetAaptVersion(ruleContext)).setApkOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_APK)).setRTxtOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_R_TXT)).setSourceJarOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_JAVA_SOURCE_JAR));
}

Fixed version (ground truth):
/** 
 * Common   {@link AndroidResourcesProcessorBuilder} builder for non-incremental top-level targets.<p>The builder will be populated with commonly-used settings and outputs.
 */
private static AndroidResourcesProcessorBuilder builderForNonIncrementalTopLevelTarget(RuleContext ruleContext,StampedAndroidManifest manifest) throws InterruptedException, RuleErrorException {
  return builderForTopLevelTarget(ruleContext,manifest,"String_Node_Str").targetAaptVersion(AndroidAaptVersion.chooseTargetAaptVersion(ruleContext)).setApkOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_APK)).setRTxtOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_R_TXT)).setSourceJarOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_JAVA_SOURCE_JAR)).setSymbols(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_MERGED_SYMBOLS));
}
Program: 110559
Project: 110559
Buggy source:
/** 
 * Processes Android data (assets, resources, and manifest) for android_binary targets. 
 */
public static ProcessedAndroidData processBinaryDataFrom(RuleContext ruleContext,StampedAndroidManifest manifest,boolean conditionalKeepRules) throws RuleErrorException, InterruptedException {
  if (conditionalKeepRules && AndroidAaptVersion.chooseTargetAaptVersion(ruleContext) != AndroidAaptVersion.AAPT2) {
    throw ruleContext.throwWithRuleError("String_Node_Str");
  }
  AndroidResourcesProcessorBuilder builder=builderForNonIncrementalTopLevelTarget(ruleContext,manifest).setUseCompiledResourcesForMerge(AndroidAaptVersion.chooseTargetAaptVersion(ruleContext) == AndroidAaptVersion.AAPT2 && AndroidCommon.getAndroidConfig(ruleContext).skipParsingAction()).setManifestOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_PROCESSED_MANIFEST)).setMergedResourcesOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_ZIP)).setMainDexProguardOut(AndroidBinary.createMainDexProguardSpec(ruleContext)).conditionalKeepRules(conditionalKeepRules).setDataBindingInfoZip(DataBinding.isEnabled(ruleContext) ? DataBinding.getLayoutInfoFile(ruleContext) : null);
  return buildActionForBinary(ruleContext,builder,manifest);
}

Fixed version (ground truth):
/** 
 * Processes Android data (assets, resources, and manifest) for android_binary targets. 
 */
public static ProcessedAndroidData processBinaryDataFrom(RuleContext ruleContext,StampedAndroidManifest manifest,boolean conditionalKeepRules) throws RuleErrorException, InterruptedException {
  if (conditionalKeepRules && AndroidAaptVersion.chooseTargetAaptVersion(ruleContext) != AndroidAaptVersion.AAPT2) {
    throw ruleContext.throwWithRuleError("String_Node_Str");
  }
  AndroidResourcesProcessorBuilder builder=builderForNonIncrementalTopLevelTarget(ruleContext,manifest).setUseCompiledResourcesForMerge(AndroidAaptVersion.chooseTargetAaptVersion(ruleContext) == AndroidAaptVersion.AAPT2 && AndroidCommon.getAndroidConfig(ruleContext).skipParsingAction()).setManifestOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_PROCESSED_MANIFEST)).setMergedResourcesOut(ruleContext.getImplicitOutputArtifact(AndroidRuleClasses.ANDROID_RESOURCES_ZIP)).setMainDexProguardOut(AndroidBinary.createMainDexProguardSpec(ruleContext)).conditionalKeepRules(conditionalKeepRules).setDataBindingInfoZip(DataBinding.isEnabled(ruleContext) ? DataBinding.getLayoutInfoFile(ruleContext) : null).setFeatureOf(ruleContext.attributes().isAttributeValueExplicitlySpecified("String_Node_Str") ? ruleContext.getPrerequisite("String_Node_Str",Mode.TARGET,ApkInfo.PROVIDER).getApk() : null).setFeatureAfter(ruleContext.attributes().isAttributeValueExplicitlySpecified("String_Node_Str") ? ruleContext.getPrerequisite("String_Node_Str",Mode.TARGET,ApkInfo.PROVIDER).getApk() : null);
  return buildActionForBinary(ruleContext,builder,manifest);
}
Program: 110560
Project: 110560
Buggy source:
/** 
 * Returns fully processed resources. The R class generator action will not be registered.
 * @param rClassJar an artifact containing the resource class jar for these resources. An actionto generate it must be registered elsewhere.
 */
ResourceApk withValidatedResources(Artifact rClassJar){
  Artifact mergedResources=assets.getMergedAssets();
  MergedAndroidResources merged=MergedAndroidResources.of(resources,mergedResources,rClassJar,dataBindingInfoZip,resourceDeps,manifest);
  ValidatedAndroidResources validated=ValidatedAndroidResources.of(merged,rTxt,sourceJar,apk,null,null,null);
  return ResourceApk.of(validated,assets);
}

Fixed version (ground truth):
/** 
 * Returns fully processed resources. The R class generator action will not be registered.
 * @param rClassJar an artifact containing the resource class jar for these resources. An actionto generate it must be registered elsewhere.
 */
ResourceApk withValidatedResources(Artifact rClassJar){
  Artifact mergedResources=assets.getMergedAssets();
  MergedAndroidResources merged=MergedAndroidResources.of(resources,mergedResources,rClassJar,dataBindingInfoZip,resourceDeps,manifest);
  ValidatedAndroidResources validated=ValidatedAndroidResources.of(merged,rTxt,sourceJar,apk,null,null,null);
  return ResourceApk.of(validated,assets,resourceProguardConfig,mainDexProguardConfig);
}
Program: 110561
Project: 110561
Buggy source:
static ProcessedAndroidData of(ParsedAndroidResources resources,MergedAndroidAssets assets,ProcessedAndroidManifest manifest,Artifact rTxt,Artifact sourceJar,Artifact apk,@Nullable Artifact dataBindingInfoZip,ResourceDependencies resourceDeps){
  return new ProcessedAndroidData(resources,assets,manifest,rTxt,sourceJar,apk,dataBindingInfoZip,resourceDeps);
}

Fixed version (ground truth):
static ProcessedAndroidData of(ParsedAndroidResources resources,MergedAndroidAssets assets,ProcessedAndroidManifest manifest,Artifact rTxt,Artifact sourceJar,Artifact apk,@Nullable Artifact dataBindingInfoZip,ResourceDependencies resourceDeps,@Nullable Artifact resourceProguardConfig,@Nullable Artifact mainDexProguardConfig){
  return new ProcessedAndroidData(resources,assets,manifest,rTxt,sourceJar,apk,dataBindingInfoZip,resourceDeps,resourceProguardConfig,mainDexProguardConfig);
}
Program: 110562
Project: 110562
Buggy source:
private ProcessedAndroidData(ParsedAndroidResources resources,MergedAndroidAssets assets,ProcessedAndroidManifest manifest,Artifact rTxt,Artifact sourceJar,Artifact apk,@Nullable Artifact dataBindingInfoZip,ResourceDependencies resourceDeps){
  this.resources=resources;
  this.assets=assets;
  this.manifest=manifest;
  this.rTxt=rTxt;
  this.sourceJar=sourceJar;
  this.apk=apk;
  this.dataBindingInfoZip=dataBindingInfoZip;
  this.resourceDeps=resourceDeps;
}

Fixed version (ground truth):
private ProcessedAndroidData(ParsedAndroidResources resources,MergedAndroidAssets assets,ProcessedAndroidManifest manifest,Artifact rTxt,Artifact sourceJar,Artifact apk,@Nullable Artifact dataBindingInfoZip,ResourceDependencies resourceDeps,@Nullable Artifact resourceProguardConfig,@Nullable Artifact mainDexProguardConfig){
  this.resources=resources;
  this.assets=assets;
  this.manifest=manifest;
  this.rTxt=rTxt;
  this.sourceJar=sourceJar;
  this.apk=apk;
  this.dataBindingInfoZip=dataBindingInfoZip;
  this.resourceDeps=resourceDeps;
  this.resourceProguardConfig=resourceProguardConfig;
  this.mainDexProguardConfig=mainDexProguardConfig;
}
Program: 110563
Project: 110563
Buggy source:
public static ResourceApk of(ValidatedAndroidResources resources,MergedAndroidAssets assets){
  return new ResourceApk(resources.getApk(),resources.getJavaSourceJar(),resources.getJavaClassJar(),resources.getResourceDependencies(),assets.getAssetDependencies(),resources,resources,assets,resources.getManifest(),resources.getRTxt(),null,null);
}

Fixed version (ground truth):
public static ResourceApk of(ValidatedAndroidResources resources,MergedAndroidAssets assets,@Nullable Artifact resourceProguardConfig,@Nullable Artifact mainDexProguardConfig){
  return new ResourceApk(resources.getApk(),resources.getJavaSourceJar(),resources.getJavaClassJar(),resources.getResourceDependencies(),assets.getAssetDependencies(),resources,resources,assets,resources.getManifest(),resources.getRTxt(),resourceProguardConfig,mainDexProguardConfig);
}
Program: 110564
Project: 110564
Buggy source:
public void addToConfiguredTargetBuilder(RuleConfiguredTargetBuilder builder,Label label,boolean includeSkylarkApiProvider){
  AndroidResourcesInfo resourceInfo=toResourceInfo(label);
  builder.addNativeDeclaredProvider(resourceInfo);
  if (validatedResources instanceof ValidatedAndroidResources) {
    ValidatedAndroidResources validated=(ValidatedAndroidResources)validatedResources;
    builder.addNativeDeclaredProvider(validated.getStampedManifest().toProvider());
  }
  if (primaryAssets instanceof MergedAndroidAssets) {
    MergedAndroidAssets merged=(MergedAndroidAssets)primaryAssets;
    AndroidAssetsInfo assetsInfo=merged.toProvider();
    builder.addNativeDeclaredProvider(assetsInfo);
    builder.addOutputGroup(OutputGroupInfo.HIDDEN_TOP_LEVEL,assetsInfo.getValidationResult());
  }
 else   if (primaryAssets == null) {
    builder.addNativeDeclaredProvider(assetDeps.toInfo(label));
  }
  if (includeSkylarkApiProvider) {
    builder.addSkylarkTransitiveInfo(AndroidSkylarkApiProvider.NAME,new AndroidSkylarkApiProvider(resourceInfo));
  }
}

Fixed version (ground truth):
public void addToConfiguredTargetBuilder(RuleConfiguredTargetBuilder builder,Label label,boolean includeSkylarkApiProvider){
  AndroidResourcesInfo resourceInfo=toResourceInfo(label);
  builder.addNativeDeclaredProvider(resourceInfo);
  if (validatedResources instanceof ValidatedAndroidResources) {
    ValidatedAndroidResources validated=(ValidatedAndroidResources)validatedResources;
    builder.addNativeDeclaredProvider(validated.getStampedManifest().toProvider());
  }
  if (primaryAssets instanceof MergedAndroidAssets) {
    MergedAndroidAssets merged=(MergedAndroidAssets)primaryAssets;
    AndroidAssetsInfo assetsInfo=merged.toProvider();
    builder.addNativeDeclaredProvider(assetsInfo);
    if (assetsInfo.getValidationResult() != null) {
      builder.addOutputGroup(OutputGroupInfo.HIDDEN_TOP_LEVEL,assetsInfo.getValidationResult());
    }
  }
 else   if (primaryAssets == null) {
    builder.addNativeDeclaredProvider(assetDeps.toInfo(label));
  }
  if (includeSkylarkApiProvider) {
    builder.addSkylarkTransitiveInfo(AndroidSkylarkApiProvider.NAME,new AndroidSkylarkApiProvider(resourceInfo));
  }
}
Program: 110565
Project: 110565
Buggy source:
abstract AndroidAssets getAndroidAssets();

Fixed version (ground truth):
public abstract AndroidAssets getAndroidAssets();
Program: 110568
Project: 110568
Buggy source:
@Nullable static ImmutableList<Label> expandTargetPatterns(Environment env,List<String> targetPatterns,FilteringPolicy filteringPolicy) throws InvalidTargetPatternException, InterruptedException {
  List<TargetPatternValue.TargetPatternKey> patternKeys=new ArrayList<>();
  for (  TargetPatternValue.TargetPatternSkyKeyOrException keyOrException : TargetPatternValue.keys(targetPatterns,filteringPolicy,"String_Node_Str")) {
    try {
      patternKeys.add(keyOrException.getSkyKey());
    }
 catch (    TargetParsingException e) {
      throw new InvalidTargetPatternException(keyOrException.getOriginalPattern(),e);
    }
  }
  ImmutableList.Builder<Label> labels=new ImmutableList.Builder<>();
  Map<SkyKey,ValueOrException<TargetParsingException>> resolvedPatterns=env.getValuesOrThrow(patternKeys,TargetParsingException.class);
  if (env.valuesMissing()) {
    return null;
  }
  for (  TargetPatternValue.TargetPatternKey pattern : patternKeys) {
    TargetPatternValue value;
    try {
      value=(TargetPatternValue)resolvedPatterns.get(pattern).get();
      labels.addAll(value.getTargets().getTargets());
    }
 catch (    TargetParsingException e) {
      throw new InvalidTargetPatternException(pattern.getPattern(),e);
    }
  }
  return labels.build();
}

Fixed version (ground truth):
@Nullable static ImmutableList<Label> expandTargetPatterns(Environment env,List<String> targetPatterns,FilteringPolicy filteringPolicy) throws InvalidTargetPatternException, InterruptedException {
  List<TargetPatternValue.TargetPatternKey> patternKeys=new ArrayList<>();
  for (  TargetPatternValue.TargetPatternSkyKeyOrException keyOrException : TargetPatternValue.keys(targetPatterns,filteringPolicy,"String_Node_Str")) {
    try {
      patternKeys.add(keyOrException.getSkyKey());
    }
 catch (    TargetParsingException e) {
      throw new InvalidTargetPatternException(keyOrException.getOriginalPattern(),e);
    }
  }
  Map<SkyKey,ValueOrException<TargetParsingException>> resolvedPatterns=env.getValuesOrThrow(patternKeys,TargetParsingException.class);
  boolean valuesMissing=env.valuesMissing();
  ImmutableList.Builder<Label> labels=valuesMissing ? null : new ImmutableList.Builder<>();
  for (  TargetPatternValue.TargetPatternKey pattern : patternKeys) {
    TargetPatternValue value;
    try {
      value=(TargetPatternValue)resolvedPatterns.get(pattern).get();
      if (!valuesMissing && value != null) {
        labels.addAll(value.getTargets().getTargets());
      }
    }
 catch (    TargetParsingException e) {
      throw new InvalidTargetPatternException(pattern.getPattern(),e);
    }
  }
  if (valuesMissing) {
    return null;
  }
  return labels.build();
}
Program: 110569
Project: 110569
Buggy source:
@Override protected Iterable<Pair<SkyKey,SkyKey>> preprocessInitialVisit(Iterable<SkyKey> keys){
  return Iterables.transform(keys,key -> Pair.of(null,key));
}

Fixed version (ground truth):
@Override protected Iterable<DepAndRdep> preprocessInitialVisit(Iterable<SkyKey> keys){
  return Iterables.transform(keys,key -> new DepAndRdep(null,key));
}