Program: 51016
Project: 51016
Buggy source:
public double[][] compute(List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> trainGraphs,List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> testGraphs){
  List<DirectedMultigraphWithRoot<Vertex<StringBuffer>,Edge<StringBuffer>>> graphs=copyGraphs(testGraphs);
  graphs.addAll(copyGraphs(trainGraphs));
  SparseVector[] featureVectors=new SparseVector[graphs.size()];
  for (int i=0; i < featureVectors.length; i++) {
    featureVectors[i]=new SparseVector();
  }
  Map<String,String> labelDict=new HashMap<String,String>();
  double[][] kernel=KernelUtils.initMatrix(testGraphs.size(),trainGraphs.size());
  double[] ss=new double[testGraphs.size() + trainGraphs.size()];
  int startLabel=1;
  int currentLabel=1;
  for (  DirectedMultigraphWithRoot<Vertex<StringBuffer>,Edge<StringBuffer>> graph : graphs) {
    graph.getRootVertex().setLabel(new StringBuffer(KernelUtils.ROOTID));
  }
  currentLabel=compressGraphLabels(graphs,labelDict,currentLabel);
  computeFVs(graphs,featureVectors,Math.sqrt(1.0 / ((double)(iterations + 1))));
  for (int i=0; i < this.iterations; i++) {
    relabelGraphs2MultisetLabels(graphs,startLabel,currentLabel);
    startLabel=currentLabel;
    currentLabel=compressGraphLabels(graphs,labelDict,currentLabel);
    computeFVs(graphs,featureVectors,Math.sqrt((2.0 + i) / ((double)(iterations + 1))));
  }
  computeKernelMatrix(trainGraphs,testGraphs,featureVectors,kernel,ss);
  if (normalize) {
    double[] ssTest=Arrays.copyOfRange(ss,0,testGraphs.size());
    double[] ssTrain=Arrays.copyOfRange(ss,testGraphs.size(),ss.length);
    return KernelUtils.normalize(kernel,ssTrain,ssTest);
  }
 else {
    return kernel;
  }
}

Fixed version (ground truth):
public double[][] compute(List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> trainGraphs,List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> testGraphs){
  List<DirectedMultigraphWithRoot<Vertex<StringBuilder>,Edge<StringBuilder>>> graphs=copyGraphs(testGraphs);
  graphs.addAll(copyGraphs(trainGraphs));
  SparseVector[] featureVectors=new SparseVector[graphs.size()];
  for (int i=0; i < featureVectors.length; i++) {
    featureVectors[i]=new SparseVector();
  }
  Map<String,String> labelDict=new HashMap<String,String>();
  double[][] kernel=KernelUtils.initMatrix(testGraphs.size(),trainGraphs.size());
  double[] ss=new double[testGraphs.size() + trainGraphs.size()];
  int startLabel=1;
  int currentLabel=1;
  for (  DirectedMultigraphWithRoot<Vertex<StringBuilder>,Edge<StringBuilder>> graph : graphs) {
    graph.getRootVertex().setLabel(new StringBuilder(KernelUtils.ROOTID));
  }
  currentLabel=compressGraphLabels(graphs,labelDict,currentLabel);
  computeFVs(graphs,featureVectors,Math.sqrt(1.0 / ((double)(iterations + 1))),currentLabel - 1);
  for (int i=0; i < this.iterations; i++) {
    relabelGraphs2MultisetLabels(graphs,startLabel,currentLabel);
    startLabel=currentLabel;
    currentLabel=compressGraphLabels(graphs,labelDict,currentLabel);
    computeFVs(graphs,featureVectors,Math.sqrt((2.0 + i) / ((double)(iterations + 1))),currentLabel - 1);
  }
  computeKernelMatrix(trainGraphs,testGraphs,featureVectors,kernel,ss);
  if (normalize) {
    double[] ssTest=Arrays.copyOfRange(ss,0,testGraphs.size());
    double[] ssTrain=Arrays.copyOfRange(ss,testGraphs.size(),ss.length);
    return KernelUtils.normalize(kernel,ssTrain,ssTest);
  }
 else {
    return kernel;
  }
}