Program: 50998
Project: 50998
Buggy source:
private DirectedGraph<Vertex<Map<Integer,StringBuilder>>,Edge<Map<Integer,StringBuilder>>> createGraphFromRDF(RDFDataSet dataset,List<Resource> instances,List<Statement> blackList){
  Map<String,Vertex<Map<Integer,StringBuilder>>> literalMap=new HashMap<String,Vertex<Map<Integer,StringBuilder>>>();
  Map<String,Vertex<Map<Integer,StringBuilder>>> vertexMap=new HashMap<String,Vertex<Map<Integer,StringBuilder>>>();
  Map<String,Edge<Map<Integer,StringBuilder>>> edgeMap=new HashMap<String,Edge<Map<Integer,StringBuilder>>>();
  DirectedGraph<Vertex<Map<Integer,StringBuilder>>,Edge<Map<Integer,StringBuilder>>> graph=new DirectedSparseMultigraph<Vertex<Map<Integer,StringBuilder>>,Edge<Map<Integer,StringBuilder>>>();
  List<Resource> queryNodes=new ArrayList<Resource>();
  List<Resource> newQueryNodes;
  List<Statement> result;
  Vertex<Map<Integer,StringBuilder>> startV;
  Vertex<Map<Integer,StringBuilder>> newV;
  Edge<Map<Integer,StringBuilder>> newE;
  String idStr, idStr2;
  for (  Resource instance : instances) {
    idStr=instance.toString();
    if (vertexMap.containsKey(idStr)) {
      startV=vertexMap.get(idStr);
      for (      int di : startV.getLabel().keySet()) {
        startV.getLabel().put(di,new StringBuilder(ROOT_LABEL));
      }
    }
 else {
      startV=new Vertex<Map<Integer,StringBuilder>>(new HashMap<Integer,StringBuilder>());
      vertexMap.put(idStr,startV);
      graph.addVertex(startV);
    }
    startV.getLabel().put(depth,new StringBuilder(ROOT_LABEL));
    labelMap.put(idStr,ROOT_LABEL);
    instanceVertices.put(idStr,startV);
    queryNodes.add(instance);
    for (int i=depth - 1; i >= 0; i--) {
      newQueryNodes=new ArrayList<Resource>();
      for (      Resource queryNode : queryNodes) {
        result=dataset.getStatements(queryNode,null,null,inference);
        for (        Statement stmt : result) {
          newV=null;
          if (stmt.getObject() instanceof Literal) {
            if (!ignoreLiterals) {
              idStr=stmt.toString();
              idStr2=stmt.getObject().toString();
              if (literalMap.containsKey(idStr)) {
                newV=literalMap.get(idStr);
                newV.getLabel().put(i,new StringBuilder(labelMap.get(idStr2)));
              }
 else {
                newV=new Vertex<Map<Integer,StringBuilder>>(new HashMap<Integer,StringBuilder>());
                labelMap.put(idStr2,Integer.toString(labelCounter));
                newV.getLabel().put(i,new StringBuilder(Integer.toString(labelCounter)));
                labelCounter++;
                literalMap.put(idStr,newV);
                graph.addVertex(newV);
              }
            }
          }
 else {
            idStr=stmt.getObject().toString();
            if (vertexMap.containsKey(idStr)) {
              newV=vertexMap.get(idStr);
              newV.getLabel().put(i,new StringBuilder(labelMap.get(idStr)));
            }
 else {
              newV=new Vertex<Map<Integer,StringBuilder>>(new HashMap<Integer,StringBuilder>());
              labelMap.put(idStr,Integer.toString(labelCounter));
              newV.getLabel().put(i,new StringBuilder(Integer.toString(labelCounter)));
              labelCounter++;
              vertexMap.put(idStr,newV);
              graph.addVertex(newV);
            }
          }
          if (newV != null) {
            idStr=stmt.toString();
            idStr2=stmt.getPredicate().toString();
            if (edgeMap.containsKey(idStr)) {
              newE=edgeMap.get(idStr);
              newE.getLabel().put(i,new StringBuilder(labelMap.get(idStr2)));
            }
 else {
              newE=new Edge<Map<Integer,StringBuilder>>(new HashMap<Integer,StringBuilder>());
              if (!labelMap.containsKey(idStr2)) {
                labelMap.put(idStr2,Integer.toString(labelCounter));
                labelCounter++;
              }
              newE.getLabel().put(i,new StringBuilder(labelMap.get(idStr2)));
              edgeMap.put(idStr,newE);
              graph.addEdge(newE,vertexMap.get(stmt.getSubject().toString()),newV,EdgeType.DIRECTED);
            }
          }
          if (i > 0 && stmt.getObject() instanceof Resource) {
            newQueryNodes.add((Resource)stmt.getObject());
          }
        }
      }
      queryNodes=newQueryNodes;
    }
  }
  for (  Statement stmt : blackList) {
    graph.removeEdge(edgeMap.get(stmt.toString()));
  }
  return graph;
}

Fixed version (ground truth):
private DirectedGraph<Vertex<Map<Integer,StringBuilder>>,Edge<Map<Integer,StringBuilder>>> createGraphFromRDF(RDFDataSet dataset,List<Resource> instances,List<Statement> blackList){
  Map<String,Vertex<Map<Integer,StringBuilder>>> literalMap=new HashMap<String,Vertex<Map<Integer,StringBuilder>>>();
  Map<String,Vertex<Map<Integer,StringBuilder>>> vertexMap=new HashMap<String,Vertex<Map<Integer,StringBuilder>>>();
  Map<String,Edge<Map<Integer,StringBuilder>>> edgeMap=new HashMap<String,Edge<Map<Integer,StringBuilder>>>();
  DirectedGraph<Vertex<Map<Integer,StringBuilder>>,Edge<Map<Integer,StringBuilder>>> graph=new DirectedSparseMultigraph<Vertex<Map<Integer,StringBuilder>>,Edge<Map<Integer,StringBuilder>>>();
  List<Resource> queryNodes=new ArrayList<Resource>();
  List<Resource> newQueryNodes;
  List<Statement> result;
  Vertex<Map<Integer,StringBuilder>> startV;
  Vertex<Map<Integer,StringBuilder>> newV;
  Edge<Map<Integer,StringBuilder>> newE;
  String idStr, idStr2;
  for (  Resource instance : instances) {
    idStr=instance.toString();
    if (vertexMap.containsKey(idStr)) {
      startV=vertexMap.get(idStr);
      for (      int di : startV.getLabel().keySet()) {
        startV.getLabel().put(di,new StringBuilder(ROOT_LABEL));
      }
    }
 else {
      startV=new Vertex<Map<Integer,StringBuilder>>(new HashMap<Integer,StringBuilder>());
      vertexMap.put(idStr,startV);
      graph.addVertex(startV);
    }
    startV.getLabel().put(depth,new StringBuilder(ROOT_LABEL));
    labelMap.put(idStr,ROOT_LABEL);
    instanceVertices.put(idStr,startV);
    queryNodes.add(instance);
    for (int i=depth - 1; i >= 0; i--) {
      newQueryNodes=new ArrayList<Resource>();
      for (      Resource queryNode : queryNodes) {
        result=dataset.getStatements(queryNode,null,null,inference);
        for (        Statement stmt : result) {
          newV=null;
          if (stmt.getObject() instanceof Literal) {
            if (!ignoreLiterals) {
              idStr=stmt.toString();
              idStr2=stmt.getObject().toString();
              if (literalMap.containsKey(idStr)) {
                newV=literalMap.get(idStr);
                newV.getLabel().put(i,new StringBuilder(labelMap.get(idStr2)));
              }
 else {
                newV=new Vertex<Map<Integer,StringBuilder>>(new HashMap<Integer,StringBuilder>());
                if (!labelMap.containsKey(idStr2)) {
                  labelMap.put(idStr2,Integer.toString(labelCounter));
                  labelCounter++;
                }
                newV.getLabel().put(i,new StringBuilder(labelMap.get(idStr2)));
                literalMap.put(idStr,newV);
                graph.addVertex(newV);
              }
            }
          }
 else {
            idStr=stmt.getObject().toString();
            if (vertexMap.containsKey(idStr)) {
              newV=vertexMap.get(idStr);
              newV.getLabel().put(i,new StringBuilder(labelMap.get(idStr)));
            }
 else {
              newV=new Vertex<Map<Integer,StringBuilder>>(new HashMap<Integer,StringBuilder>());
              labelMap.put(idStr,Integer.toString(labelCounter));
              newV.getLabel().put(i,new StringBuilder(Integer.toString(labelCounter)));
              labelCounter++;
              vertexMap.put(idStr,newV);
              graph.addVertex(newV);
            }
          }
          if (newV != null) {
            idStr=stmt.toString();
            idStr2=stmt.getPredicate().toString();
            if (edgeMap.containsKey(idStr)) {
              newE=edgeMap.get(idStr);
              newE.getLabel().put(i,new StringBuilder(labelMap.get(idStr2)));
            }
 else {
              newE=new Edge<Map<Integer,StringBuilder>>(new HashMap<Integer,StringBuilder>());
              if (!labelMap.containsKey(idStr2)) {
                labelMap.put(idStr2,Integer.toString(labelCounter));
                labelCounter++;
              }
              newE.getLabel().put(i,new StringBuilder(labelMap.get(idStr2)));
              edgeMap.put(idStr,newE);
              graph.addEdge(newE,vertexMap.get(stmt.getSubject().toString()),newV,EdgeType.DIRECTED);
            }
          }
          if (i > 0 && stmt.getObject() instanceof Resource) {
            newQueryNodes.add((Resource)stmt.getObject());
          }
        }
      }
      queryNodes=newQueryNodes;
    }
  }
  for (  Statement stmt : blackList) {
    graph.removeEdge(edgeMap.get(stmt.toString()));
  }
  return graph;
}