Program: 51003
Project: 51003
Buggy source:
public double[][] compute(List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> trainGraphs,List<DirectedMultigraphWithRoot<Vertex<String>,Edge<String>>> testGraphs){
  List<DirectedGraph<Vertex<String>,Edge<String>>> graphs=copyGraphs(testGraphs);
  graphs.addAll(copyGraphs(trainGraphs));
  SparseVector[] featureVectors=new SparseVector[graphs.size()];
  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<String>,Edge<String>> graph : trainGraphs) {
    graph.getRootVertex().setLabel(KernelUtils.ROOTID);
  }
  for (  DirectedMultigraphWithRoot<Vertex<String>,Edge<String>> graph : testGraphs) {
    graph.getRootVertex().setLabel(KernelUtils.ROOTID);
  }
  currentLabel=compressGraphLabels(graphs,labelDict,currentLabel);
  if (!skipFirst) {
    computeFeatureVectors(graphs,featureVectors,startLabel,currentLabel);
    computeKernelMatrix(trainGraphs,testGraphs,featureVectors,kernel,ss,1);
  }
  for (int i=0; i < this.iterations; i++) {
    relabelGraphs2MultisetLabels(graphs,startLabel,currentLabel);
    startLabel=currentLabel;
    currentLabel=compressGraphLabels(graphs,labelDict,currentLabel);
    computeFeatureVectors(graphs,featureVectors,startLabel,currentLabel);
    computeKernelMatrix(trainGraphs,testGraphs,featureVectors,kernel,ss,i + 2);
  }
  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<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;
  }
}