Program: 25510
Project: 25510
Buggy source:
private void generateMatchesForTier() throws IOException, URISyntaxException {
  LOG.info("String_Node_Str");
  final RenderDataClient driverMatchClient=new RenderDataClient(parameters.renderWeb.baseDataUrl,parameters.renderWeb.owner,"String_Node_Str");
  final Map<String,Long> existingMatchCollectionPairCounts=getExistingMatchCollectionPairCounts(driverMatchClient);
  if (parameters.keepExisting(PipelineStep.MATCH)) {
    updateSavedMatchPairCounts(existingMatchCollectionPairCounts,false);
  }
 else {
    deleteExistingMatchCollectionsForTier(driverMatchClient,existingMatchCollectionPairCounts);
  }
  final MatchRenderParameters matchRenderParameters=new MatchRenderParameters();
  matchRenderParameters.fillWithNoise=parameters.fillWithNoise;
  matchRenderParameters.renderWithFilter=parameters.renderWithFilter;
  matchRenderParameters.renderWithoutMask=false;
  matchRenderParameters.renderScale=1.0;
  final MatchClipParameters emptyClipParameters=new MatchClipParameters();
  final int numberOfLayers=zValues.size();
  final long potentialPairsPerStack;
  if (parameters.zNeighborDistance >= numberOfLayers) {
    potentialPairsPerStack=getTriangularNumber(numberOfLayers);
  }
 else {
    potentialPairsPerStack=(numberOfLayers * parameters.zNeighborDistance) - getTriangularNumber(parameters.zNeighborDistance);
  }
  final long totalPotentialPairs=potentialPairsPerStack * tierStacks.size();
  if ((totalPotentialPairs < 1000) || ((potentialPairsPerStack < sparkContext.defaultParallelism()) && (totalPotentialPairs < 100000))) {
    generateTierMatchesInOneBatch(matchRenderParameters,emptyClipParameters,driverMatchClient);
  }
 else {
    generateTierMatchesByStack(matchRenderParameters,emptyClipParameters);
  }
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
private void generateMatchesForTier() throws IOException, URISyntaxException {
  LOG.info("String_Node_Str");
  final RenderDataClient driverMatchClient=new RenderDataClient(parameters.renderWeb.baseDataUrl,parameters.renderWeb.owner,"String_Node_Str");
  final Map<String,Long> existingMatchPairCounts=getExistingMatchPairCounts(driverMatchClient);
  if (parameters.keepExisting(PipelineStep.MATCH)) {
    updateSavedMatchPairCounts(existingMatchPairCounts);
  }
 else {
    deleteExistingMatchDataForTier(driverMatchClient,existingMatchPairCounts);
  }
  final MatchRenderParameters matchRenderParameters=new MatchRenderParameters();
  matchRenderParameters.fillWithNoise=parameters.fillWithNoise;
  matchRenderParameters.renderWithFilter=parameters.renderWithFilter;
  matchRenderParameters.renderWithoutMask=false;
  matchRenderParameters.renderScale=1.0;
  final MatchClipParameters emptyClipParameters=new MatchClipParameters();
  final long potentialPairsPerStack=getPotentialPairsPerStack(zValues.size(),parameters.zNeighborDistance);
  final long totalPotentialPairs=potentialPairsPerStack * tierStacks.size();
  LOG.info("String_Node_Str",sparkContext.defaultParallelism(),potentialPairsPerStack,totalPotentialPairs);
  if ((totalPotentialPairs < 1000) || ((potentialPairsPerStack < sparkContext.defaultParallelism()) && (totalPotentialPairs < 100000))) {
    generateTierMatchesInOneBatch(matchRenderParameters,emptyClipParameters,driverMatchClient);
  }
 else {
    generateTierMatchesByStack(matchRenderParameters,emptyClipParameters);
  }
  LOG.info("String_Node_Str");
}