Program: 25550
Project: 25550
Buggy source:
public void run() throws IOException, URISyntaxException {
  final SparkConf conf=new SparkConf().setAppName("String_Node_Str");
  final JavaSparkContext sparkContext=new JavaSparkContext(conf);
  final String sparkAppId=sparkContext.getConf().getAppId();
  final String executorsJson=LogUtilities.getExecutorsApiJson(sparkAppId);
  LOG.info("String_Node_Str",sparkAppId,executorsJson);
  final RenderableCanvasIdPairs renderableCanvasIdPairs=RenderableCanvasIdPairsUtilities.load(parameters.pairJson);
  final String renderParametersUrlTemplateForRun=RenderableCanvasIdPairsUtilities.getRenderParametersUrlTemplateForRun(renderableCanvasIdPairs,parameters.baseDataUrl,parameters.renderScale,parameters.renderWithFilter,parameters.renderWithoutMask,false);
  final long cacheMaxKilobytes=parameters.maxFeatureCacheGb * 1000000;
  final CanvasFeatureListLoader featureLoader=new CanvasFeatureListLoader(renderParametersUrlTemplateForRun,getCanvasFeatureExtractor());
  final Broadcast<Long> broadcastCacheMaxKilobytes=sparkContext.broadcast(cacheMaxKilobytes);
  final Broadcast<CanvasFeatureListLoader> broadcastFeatureLoader=sparkContext.broadcast(featureLoader);
  final Broadcast<CanvasFeatureMatcher> broadcastFeatureMatcher=sparkContext.broadcast(getCanvasFeatureMatcher());
  final JavaRDD<OrderedCanvasIdPair> rddCanvasIdPairs=sparkContext.parallelize(renderableCanvasIdPairs.getNeighborPairs());
  final JavaRDD<CanvasMatches> rddMatches=rddCanvasIdPairs.mapPartitionsWithIndex(new Function2<Integer,Iterator<OrderedCanvasIdPair>,Iterator<CanvasMatches>>(){
    @Override public Iterator<CanvasMatches> call(    final Integer partitionIndex,    final Iterator<OrderedCanvasIdPair> pairIterator) throws Exception {
      LogUtilities.setupExecutorLog4j("String_Node_Str" + partitionIndex);
      final Logger log=LoggerFactory.getLogger(SIFTPointMatchClient.class);
      final CanvasDataCache dataCache=CanvasDataCache.getSharedCache(broadcastCacheMaxKilobytes.getValue(),broadcastFeatureLoader.getValue());
      final CanvasFeatureMatcher featureMatcher=broadcastFeatureMatcher.getValue();
      final List<CanvasMatches> matchList=new ArrayList<>();
      int pairCount=0;
      OrderedCanvasIdPair pair;
      CanvasId p;
      CanvasId q;
      List<Feature> pFeatures;
      List<Feature> qFeatures;
      CanvasFeatureMatchResult matchResult;
      Matches inlierMatches;
      while (pairIterator.hasNext()) {
        pair=pairIterator.next();
        pairCount++;
        p=pair.getP();
        q=pair.getQ();
        pFeatures=dataCache.getFeatureList(p);
        qFeatures=dataCache.getFeatureList(q);
        log.info("String_Node_Str",p,q);
        matchResult=featureMatcher.deriveMatchResult(pFeatures,qFeatures);
        inlierMatches=matchResult.getInlierMatches();
        if (inlierMatches.getWs().length > 0) {
          matchList.add(new CanvasMatches(p.getGroupId(),p.getId(),q.getGroupId(),q.getId(),matchResult.getInlierMatches()));
        }
      }
      log.info("String_Node_Str",matchList.size(),pairCount,dataCache.stats());
      return matchList.iterator();
    }
  }
,true);
  final JavaRDD<Integer> rddSavedMatchPairCounts=rddMatches.mapPartitionsWithIndex(new MatchStorageFunction(parameters.baseDataUrl,parameters.owner,parameters.collection),true);
  final int numPartitions=rddSavedMatchPairCounts.getNumPartitions();
  LOG.info("String_Node_Str",numPartitions,rddSavedMatchPairCounts.toDebugString());
  final List<Integer> matchPairCountList=rddSavedMatchPairCounts.collect();
  long total=0;
  for (  final Integer matchCount : matchPairCountList) {
    total+=matchCount;
  }
  LOG.info("String_Node_Str");
  LOG.info("String_Node_Str",total,matchPairCountList.size());
  sparkContext.stop();
}

Fixed version (ground truth):
public void run() throws IOException, URISyntaxException {
  final SparkConf conf=new SparkConf().setAppName("String_Node_Str");
  final JavaSparkContext sparkContext=new JavaSparkContext(conf);
  final String sparkAppId=sparkContext.getConf().getAppId();
  final String executorsJson=LogUtilities.getExecutorsApiJson(sparkAppId);
  LOG.info("String_Node_Str",sparkAppId,executorsJson);
  final RenderableCanvasIdPairs renderableCanvasIdPairs=RenderableCanvasIdPairsUtilities.load(parameters.pairJson);
  final String renderParametersUrlTemplateForRun=RenderableCanvasIdPairsUtilities.getRenderParametersUrlTemplateForRun(renderableCanvasIdPairs,parameters.baseDataUrl,parameters.renderScale,parameters.renderWithFilter,parameters.renderWithoutMask,false);
  final long cacheMaxKilobytes=parameters.maxFeatureCacheGb * 1000000;
  final CanvasFeatureListLoader featureLoader=new CanvasFeatureListLoader(renderParametersUrlTemplateForRun,getCanvasFeatureExtractor());
  final double renderScale=parameters.renderScale;
  final Broadcast<Long> broadcastCacheMaxKilobytes=sparkContext.broadcast(cacheMaxKilobytes);
  final Broadcast<CanvasFeatureListLoader> broadcastFeatureLoader=sparkContext.broadcast(featureLoader);
  final Broadcast<CanvasFeatureMatcher> broadcastFeatureMatcher=sparkContext.broadcast(getCanvasFeatureMatcher());
  final JavaRDD<OrderedCanvasIdPair> rddCanvasIdPairs=sparkContext.parallelize(renderableCanvasIdPairs.getNeighborPairs());
  final JavaRDD<CanvasMatches> rddMatches=rddCanvasIdPairs.mapPartitionsWithIndex(new Function2<Integer,Iterator<OrderedCanvasIdPair>,Iterator<CanvasMatches>>(){
    @Override public Iterator<CanvasMatches> call(    final Integer partitionIndex,    final Iterator<OrderedCanvasIdPair> pairIterator) throws Exception {
      LogUtilities.setupExecutorLog4j("String_Node_Str" + partitionIndex);
      final Logger log=LoggerFactory.getLogger(SIFTPointMatchClient.class);
      final CanvasDataCache dataCache=CanvasDataCache.getSharedCache(broadcastCacheMaxKilobytes.getValue(),broadcastFeatureLoader.getValue());
      final CanvasFeatureMatcher featureMatcher=broadcastFeatureMatcher.getValue();
      final List<CanvasMatches> matchList=new ArrayList<>();
      int pairCount=0;
      OrderedCanvasIdPair pair;
      CanvasId p;
      CanvasId q;
      List<Feature> pFeatures;
      List<Feature> qFeatures;
      CanvasFeatureMatchResult matchResult;
      Matches inlierMatches;
      while (pairIterator.hasNext()) {
        pair=pairIterator.next();
        pairCount++;
        p=pair.getP();
        q=pair.getQ();
        pFeatures=dataCache.getFeatureList(p);
        qFeatures=dataCache.getFeatureList(q);
        log.info("String_Node_Str",p,q);
        matchResult=featureMatcher.deriveMatchResult(pFeatures,qFeatures);
        inlierMatches=matchResult.getInlierMatches();
        if (inlierMatches.getWs().length > 0) {
          if (renderScale != 1.0) {
            scalePoints(inlierMatches.getPs(),renderScale);
            scalePoints(inlierMatches.getQs(),renderScale);
          }
          matchList.add(new CanvasMatches(p.getGroupId(),p.getId(),q.getGroupId(),q.getId(),inlierMatches));
        }
      }
      log.info("String_Node_Str",matchList.size(),pairCount,dataCache.stats());
      return matchList.iterator();
    }
  }
,true);
  final JavaRDD<Integer> rddSavedMatchPairCounts=rddMatches.mapPartitionsWithIndex(new MatchStorageFunction(parameters.baseDataUrl,parameters.owner,parameters.collection),true);
  final int numPartitions=rddSavedMatchPairCounts.getNumPartitions();
  LOG.info("String_Node_Str",numPartitions,rddSavedMatchPairCounts.toDebugString());
  final List<Integer> matchPairCountList=rddSavedMatchPairCounts.collect();
  long total=0;
  for (  final Integer matchCount : matchPairCountList) {
    total+=matchCount;
  }
  LOG.info("String_Node_Str");
  LOG.info("String_Node_Str",total,matchPairCountList.size());
  sparkContext.stop();
}