Program: 99084
Project: 99084
Buggy source:
@Override protected void generateResult(){
  AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  PreviewModel model=Lookup.getDefault().lookup(PreviewController.class).getModel();
  FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
  RankingController rankingController=Lookup.getDefault().lookup(RankingController.class);
  int totalNodes=undirectedGraph.getNodeCount();
  System.out.println("String_Node_Str" + totalNodes);
  System.out.println("String_Node_Str" + undirectedGraph.getEdgeCount());
  Degree degree=new Degree();
  degree.execute(graphModel,attributeModel);
  System.out.println("String_Node_Str" + degree.getAverageDegree());
  AttributeColumn degreeColumn=attributeModel.getNodeTable().getColumn("String_Node_Str");
  int[] degreeArray;
  degreeArray=new int[undirectedGraph.getNodeCount()];
  int i1=0;
  for (  Node n : graphModel.getGraph().getNodes()) {
    int val=Integer.valueOf(n.getNodeData().getAttributes().getValue(Ranking.DEGREE_RANKING).toString());
    degreeArray[i1++]=val;
  }
  reportStatistics(degreeArray);
  int degreeFilterRange=0;
  if (totalNodes > 1000)   degreeFilterRange=6;
 else   if (totalNodes > 800)   degreeFilterRange=5;
 else   if (totalNodes > 600)   degreeFilterRange=4;
 else   if (totalNodes > 400)   degreeFilterRange=3;
 else   if (totalNodes > 200)   degreeFilterRange=2;
 else   if (totalNodes > 100)   degreeFilterRange=1;
 else   if (totalNodes > 50)   degreeFilterRange=0;
  System.out.println("String_Node_Str" + totalNodes + "String_Node_Str"+ degreeFilterRange);
  System.out.println("String_Node_Str");
  DegreeRangeFilter degreeFilter=new DegreeRangeFilter();
  degreeFilter.init(undirectedGraph);
  degreeFilter.setRange(new Range(degreeFilterRange,Integer.MAX_VALUE));
  Query query=filterController.createQuery(degreeFilter);
  GraphView view=filterController.filter(query);
  graphModel.setVisibleView(view);
  UndirectedGraph graphVisible=graphModel.getUndirectedGraphVisible();
  System.out.println("String_Node_Str" + graphVisible.getNodeCount());
  System.out.println("String_Node_Str" + graphVisible.getEdgeCount() + "String_Node_Str");
  ForceAtlas2 fa2Layout=new ForceAtlas2(new ForceAtlas2Builder());
  fa2Layout.setGraphModel(graphModel);
  fa2Layout.resetPropertiesValues();
  fa2Layout.setEdgeWeightInfluence(1.0);
  fa2Layout.setGravity(1.0);
  fa2Layout.setScalingRatio(2.0);
  fa2Layout.setBarnesHutTheta(1.2);
  fa2Layout.setJitterTolerance(0.1);
  fa2Layout.initAlgo();
  int cnt=0;
  for (int i=0; i < 250 && fa2Layout.canAlgo(); i++) {
    fa2Layout.goAlgo();
    cnt++;
  }
  System.out.println("String_Node_Str" + cnt + "String_Node_Str");
  fa2Layout.endAlgo();
  GraphDistance distance=new GraphDistance();
  distance.setDirected(false);
  distance.execute(graphModel,attributeModel);
  System.out.println("String_Node_Str");
  AttributeColumn centralityColumn=attributeModel.getNodeTable().getColumn(GraphDistance.BETWEENNESS);
  double maxVal=0;
  double secondMax=0;
  double thirdMax=0;
  double extremVal=0;
  Node nMax=null;
  Node nSecond=null;
  int numNode=graphModel.getGraph().getNodeCount();
  for (  Node n : graphModel.getGraph().getNodes()) {
    double val=Double.valueOf(n.getNodeData().getAttributes().getValue(GraphDistance.BETWEENNESS).toString());
    if (val > maxVal) {
      thirdMax=secondMax;
      secondMax=maxVal;
      nSecond=nMax;
      maxVal=val;
      nMax=n;
    }
 else     if (val > secondMax) {
      thirdMax=secondMax;
      secondMax=val;
      nSecond=n;
    }
 else     if (val > thirdMax) {
      thirdMax=val;
    }
  }
  System.out.println(numNode + "String_Node_Str" + maxVal+ "String_Node_Str"+ secondMax+ "String_Node_Str"+ thirdMax);
  nMax.getNodeData().getAttributes().setValue(GraphDistance.BETWEENNESS,thirdMax * 1.5);
  nSecond.getNodeData().getAttributes().setValue(GraphDistance.BETWEENNESS,thirdMax * 1.2);
  Ranking centralityRanking=rankingController.getModel().getRanking(Ranking.NODE_ELEMENT,centralityColumn.getId());
  AbstractSizeTransformer sizeTransformer=(AbstractSizeTransformer)rankingController.getModel().getTransformer(Ranking.NODE_ELEMENT,Transformer.RENDERABLE_SIZE);
  sizeTransformer.setMinSize(6);
  sizeTransformer.setMaxSize(30);
  rankingController.transform(centralityRanking,sizeTransformer);
  System.out.println("String_Node_Str");
  model.getProperties().putValue(PreviewProperty.SHOW_NODE_LABELS,Boolean.TRUE);
  model.getProperties().putValue(PreviewProperty.EDGE_COLOR,new EdgeColor(Color.GRAY));
  model.getProperties().putValue(PreviewProperty.EDGE_THICKNESS,new Float(0.1f));
  model.getProperties().putValue(PreviewProperty.NODE_LABEL_FONT,model.getProperties().getFontValue(PreviewProperty.NODE_LABEL_FONT).deriveFont(8));
  PartitionController partitionController=Lookup.getDefault().lookup(PartitionController.class);
  Modularity modularity=new Modularity();
  modularity.execute(graphModel,attributeModel);
  AttributeColumn modColumn=attributeModel.getNodeTable().getColumn(Modularity.MODULARITY_CLASS);
  Partition p2=partitionController.buildPartition(modColumn,undirectedGraph);
  System.out.println(p2.getPartsCount() + "String_Node_Str");
  NodeColorTransformer nodeColorTransformer2=new NodeColorTransformer();
  Map<Object,Color> color_map=nodeColorTransformer2.getMap();
  setColorsAndSaveLabelsToMongo(p2,color_map);
  partitionController.transform(p2,nodeColorTransformer2);
}

Fixed version (ground truth):
@Override protected void generateResult(){
  AttributeModel attributeModel=Lookup.getDefault().lookup(AttributeController.class).getModel();
  PreviewModel model=Lookup.getDefault().lookup(PreviewController.class).getModel();
  FilterController filterController=Lookup.getDefault().lookup(FilterController.class);
  RankingController rankingController=Lookup.getDefault().lookup(RankingController.class);
  int totalNodes=undirectedGraph.getNodeCount();
  System.out.println("String_Node_Str" + totalNodes);
  System.out.println("String_Node_Str" + undirectedGraph.getEdgeCount());
  Degree degree=new Degree();
  degree.execute(graphModel,attributeModel);
  System.out.println("String_Node_Str" + degree.getAverageDegree());
  AttributeColumn degreeColumn=attributeModel.getNodeTable().getColumn("String_Node_Str");
  int[] degreeArray;
  degreeArray=new int[undirectedGraph.getNodeCount()];
  int i1=0;
  for (  Node n : graphModel.getGraph().getNodes()) {
    int val=Integer.valueOf(n.getNodeData().getAttributes().getValue(Ranking.DEGREE_RANKING).toString());
    degreeArray[i1++]=val;
  }
  reportStatistics(degreeArray);
  int degreeFilterRange=0;
  if (totalNodes > 1000)   degreeFilterRange=6;
 else   if (totalNodes > 800)   degreeFilterRange=5;
 else   if (totalNodes > 600)   degreeFilterRange=4;
 else   if (totalNodes > 400)   degreeFilterRange=3;
 else   if (totalNodes > 200)   degreeFilterRange=2;
 else   if (totalNodes > 100)   degreeFilterRange=1;
 else   if (totalNodes > 50)   degreeFilterRange=0;
  System.out.println("String_Node_Str" + totalNodes + "String_Node_Str"+ degreeFilterRange);
  System.out.println("String_Node_Str");
  DegreeRangeFilter degreeFilter=new DegreeRangeFilter();
  degreeFilter.init(undirectedGraph);
  degreeFilter.setRange(new Range(degreeFilterRange,Integer.MAX_VALUE));
  Query query=filterController.createQuery(degreeFilter);
  GraphView view=filterController.filter(query);
  graphModel.setVisibleView(view);
  UndirectedGraph graphVisible=graphModel.getUndirectedGraphVisible();
  System.out.println("String_Node_Str" + graphVisible.getNodeCount());
  System.out.println("String_Node_Str" + graphVisible.getEdgeCount() + "String_Node_Str");
  ForceAtlas2 fa2Layout=new ForceAtlas2(new ForceAtlas2Builder());
  fa2Layout.setGraphModel(graphModel);
  fa2Layout.resetPropertiesValues();
  fa2Layout.setEdgeWeightInfluence(1.0);
  fa2Layout.setGravity(1.0);
  fa2Layout.setScalingRatio(2.0);
  fa2Layout.setBarnesHutTheta(1.2);
  fa2Layout.setJitterTolerance(0.1);
  fa2Layout.initAlgo();
  int cnt=0;
  for (int i=0; i < 250 && fa2Layout.canAlgo(); i++) {
    fa2Layout.goAlgo();
    cnt++;
  }
  System.out.println("String_Node_Str" + cnt + "String_Node_Str");
  fa2Layout.endAlgo();
  GraphDistance distance=new GraphDistance();
  distance.setDirected(false);
  distance.execute(graphModel,attributeModel);
  System.out.println("String_Node_Str");
  AttributeColumn centralityColumn=attributeModel.getNodeTable().getColumn(GraphDistance.BETWEENNESS);
  double maxVal=0;
  double secondMax=0;
  double thirdMax=0;
  double extremVal=0;
  Node nMax=null;
  Node nSecond=null;
  int numNode=graphModel.getGraph().getNodeCount();
  if (numNode > 20) {
    for (    Node n : graphModel.getGraph().getNodes()) {
      double val=Double.valueOf(n.getNodeData().getAttributes().getValue(GraphDistance.BETWEENNESS).toString());
      if (val > maxVal) {
        thirdMax=secondMax;
        secondMax=maxVal;
        nSecond=nMax;
        maxVal=val;
        nMax=n;
      }
 else       if (val > secondMax) {
        thirdMax=secondMax;
        secondMax=val;
        nSecond=n;
      }
 else       if (val > thirdMax) {
        thirdMax=val;
      }
    }
    System.out.println(numNode + "String_Node_Str" + maxVal+ "String_Node_Str"+ secondMax+ "String_Node_Str"+ thirdMax);
    nMax.getNodeData().getAttributes().setValue(GraphDistance.BETWEENNESS,thirdMax * 1.5);
    nSecond.getNodeData().getAttributes().setValue(GraphDistance.BETWEENNESS,thirdMax * 1.2);
  }
  Ranking centralityRanking=rankingController.getModel().getRanking(Ranking.NODE_ELEMENT,centralityColumn.getId());
  AbstractSizeTransformer sizeTransformer=(AbstractSizeTransformer)rankingController.getModel().getTransformer(Ranking.NODE_ELEMENT,Transformer.RENDERABLE_SIZE);
  sizeTransformer.setMinSize(6);
  sizeTransformer.setMaxSize(30);
  rankingController.transform(centralityRanking,sizeTransformer);
  System.out.println("String_Node_Str");
  model.getProperties().putValue(PreviewProperty.SHOW_NODE_LABELS,Boolean.TRUE);
  model.getProperties().putValue(PreviewProperty.EDGE_COLOR,new EdgeColor(Color.GRAY));
  model.getProperties().putValue(PreviewProperty.EDGE_THICKNESS,new Float(0.1f));
  model.getProperties().putValue(PreviewProperty.NODE_LABEL_FONT,model.getProperties().getFontValue(PreviewProperty.NODE_LABEL_FONT).deriveFont(8));
  PartitionController partitionController=Lookup.getDefault().lookup(PartitionController.class);
  Modularity modularity=new Modularity();
  modularity.execute(graphModel,attributeModel);
  AttributeColumn modColumn=attributeModel.getNodeTable().getColumn(Modularity.MODULARITY_CLASS);
  Partition p2=partitionController.buildPartition(modColumn,undirectedGraph);
  System.out.println(p2.getPartsCount() + "String_Node_Str");
  NodeColorTransformer nodeColorTransformer2=new NodeColorTransformer();
  Map<Object,Color> color_map=nodeColorTransformer2.getMap();
  setColorsAndSaveLabelsToMongo(p2,color_map);
  partitionController.transform(p2,nodeColorTransformer2);
}