nus-yam/ex-repair huggingface dataset:
Program: 26096
Project: 26096
Buggy source:
private double calculateScoreSum(PageRank<Vertex,Edge> pageRank,Graph subgraph){
  double scoreSum=0;
  Iterable<Vertex> vertices=subgraph.getVertices();
  for (  Vertex v : vertices)   scoreSum+=pageRank.getVertexScore(v);
  return scoreSum;
}

Fixed version (ground truth):
private double calculateScoreSum(PageRank<Vertex,Edge> pageRank,Graph subgraph){
  double scoreSum=0;
  for (  Vertex v : subgraph.getVertices())   scoreSum+=pageRank.getVertexScore(v);
  return scoreSum;
}
Program: 26097
Project: 26097
Buggy source:
public static Iterable<Edge> connectedEdges(Vertex v,GraphType graphDirection){
switch (graphDirection) {
case DIRECTED_GRAPH:
    return v.getEdges(Direction.OUT);
case UNDIRECTED_GRAPH:
  return v.getEdges(Direction.BOTH);
default :
throw new IllegalArgumentException("String_Node_Str" + graphDirection);
}
}

Fixed version (ground truth):
public static Collection<Edge> connectedEdges(Vertex vertex,Direction direction,String... labels){
  Collection<Edge> edges;
  final Iterable<Edge> itty=vertex.getEdges(direction,labels);
  if (itty instanceof Collection)   edges=(Collection<Edge>)itty;
 else {
    edges=new ArrayList<Edge>();
    for (    final Edge edge : itty)     edges.add(edge);
  }
  return edges;
}
Program: 26098
Project: 26098
Buggy source:
/** 
 * Converts the uris to vertices. Omits uris that cannot be found in the provided graph.
 */
public static Set<Vertex> verticesByFullUris(Graph graph,Collection<String> fullUris){
  Set<Vertex> vertices=new HashSet<Vertex>();
  for (  String fullUri : fullUris) {
    Vertex v=vertexByUri(graph,fullUri);
    if (v != null)     vertices.add(v);
  }
  return vertices;
}

Fixed version (ground truth):
/** 
 * Converts the uris to vertices. Omits uris that cannot be found in the provided graph.
 */
public static Set<Vertex> verticesByFullUris(Graph graph,Collection<String> fullUris){
  Set<Vertex> vertices=new HashSet<Vertex>();
  for (  String fullUri : fullUris) {
    Vertex v=vertexByFullUri(graph,fullUri);
    if (v != null)     vertices.add(v);
  }
  return vertices;
}
Program: 26099
Project: 26099
Buggy source:
public static boolean isNodeOnPath(Vertex child,Collection<Edge> path){
  for (  Edge edge : path)   if (child.equals(edge.getVertex(Direction.IN)) || child.equals(edge.getVertex(Direction.OUT)))   return true;
  return false;
}

Fixed version (ground truth):
public static boolean isNodeOnPath(Vertex child,List<Edge> path){
  for (  Edge edge : path)   if (child.equals(edge.getVertex(Direction.IN)) || child.equals(edge.getVertex(Direction.OUT)))   return true;
  return false;
}
Program: 26100
Project: 26100
Buggy source:
public static Set<Vertex> verticesFromSenses(Graph graph,Collection<? extends Sense> senses){
  Set<Vertex> vertices=new HashSet<>(senses.size());
  for (  Sense sense : senses) {
    Vertex v=Graphs.vertexByUri(graph,sense.fullUri());
    if (v != null)     vertices.add(v);
  }
  return vertices;
}

Fixed version (ground truth):
public static Set<Vertex> verticesFromSenses(Graph graph,Collection<? extends Sense> senses){
  Set<Vertex> vertices=new HashSet<>(senses.size());
  for (  Sense sense : senses) {
    Vertex v=Graphs.vertexByFullUri(graph,sense.fullUri());
    if (v != null)     vertices.add(v);
  }
  return vertices;
}
Program: 26101
Project: 26101
Buggy source:
@Override protected void dfs(Path path,Set<Vertex> targets,Graph subgraph,Set<Vertex> stopVertices){
  Deque<Path> stack=new ArrayDeque<>();
  stack.push(path);
  while (!stack.isEmpty()) {
    traversedNodes++;
    path=stack.pop();
    Vertex current=path.getLast();
    if (path.getEdges().size() > settings.maxDistance)     continue;
    if (targets.contains(current))     SubgraphConstructions.addPathToSubGraph(current,path,subgraph,settings.graphType);
    for (    Edge edge : Graphs.connectedEdges(current,settings.graphType)) {
      Vertex child=Graphs.oppositeVertexUnsafe(edge,current);
      if (settings.graphType.equals(GraphType.UNDIRECTED_GRAPH) && !settings.explorationThreshold.isBelowThreshold(child,edge))       continue;
      if (!path.getVertices().contains(child) && !stopVertices.contains(child)) {
        Path newPath=Path.newHop(path,edge,child);
        stack.push(newPath);
      }
    }
  }
}

Fixed version (ground truth):
@Override protected void dfs(Path path,Set<Vertex> targets,Graph subgraph,Set<Vertex> stopVertices){
  Deque<Path> stack=new ArrayDeque<>();
  stack.push(path);
  while (!stack.isEmpty()) {
    traversedNodes++;
    path=stack.pop();
    Vertex current=path.getLast();
    if (path.getEdges().size() > settings.maxDistance)     continue;
    if (targets.contains(current))     SubgraphConstructions.addPathToSubGraph(current,path,subgraph,settings.graphType);
    for (    Edge edge : current.getEdges(settings.graphType.getDirection())) {
      Vertex child=Graphs.oppositeVertexUnsafe(edge,current);
      if (settings.graphType.equals(GraphType.UNDIRECTED_GRAPH) && !settings.explorationThreshold.isBelowThreshold(child,edge))       continue;
      if (!path.getVertices().contains(child) && !stopVertices.contains(child)) {
        Path newPath=Path.newHop(path,edge,child);
        stack.push(newPath);
      }
    }
  }
}
Program: 26102
Project: 26102
Buggy source:
private GraphConfig(){
  throw new AssertionError();
}

Fixed version (ground truth):
private GraphConfig(){
}
Program: 26103
Project: 26103
Buggy source:
public static String graphDirectory(){
  return config.getString(GRAPH_DIRECTORY_KEY);
}

Fixed version (ground truth):
public static String graphDirectory(){
  return config.getString(CONFIG_GRAPH_DIRECTORY);
}
Program: 26104
Project: 26104
Buggy source:
@Test public void testNewGlobalDisambiguator(){
  GlobalGraphDisambiguator<DefaultSurfaceForm,DefaultSense> disambiguator=GraphConfig.newGlobalDisambiguator(config,subgraphConstructionSettings,graphWeights);
  assertNotNull(disambiguator);
}

Fixed version (ground truth):
@Test public void testNewGlobalDisambiguator(){
  GlobalGraphDisambiguator<DefaultSurfaceForm,DefaultSense> disambiguator=GraphDisambiguatorFactory.newGlobalFromConfig(config,subgraphConstructionSettings,graphWeights);
  assertNotNull(disambiguator);
}
Program: 26105
Project: 26105
Buggy source:
@Test public void testNewLocalDisambiguator(){
  LocalGraphDisambiguator<DefaultSurfaceForm,DefaultSense> disambiguator=GraphConfig.newLocalDisambiguator(graphType,graphWeights);
  assertNotNull(disambiguator);
}

Fixed version (ground truth):
@Test public void testNewLocalDisambiguator(){
  LocalGraphDisambiguator<DefaultSurfaceForm,DefaultSense> disambiguator=GraphDisambiguatorFactory.newLocalFromConfig(config,graphType,graphWeights);
  assertNotNull(disambiguator);
}
Program: 26106
Project: 26106
Buggy source:
public static void main(String[] args) throws IOException, URISyntaxException {
  Graph graph=GraphFactory.getDBpediaGraph();
  for (  String uri : uris) {
    Vertex v=Graphs.vertexByUri(graph,URLDecoder.decode(uri,"String_Node_Str"));
    String id=(v == null) ? "String_Node_Str" : v.getId().toString();
    System.out.println(uri + "String_Node_Str" + id);
  }
  graph.shutdown();
}

Fixed version (ground truth):
public static void main(String[] args) throws IOException, URISyntaxException {
  Graph graph=GraphFactory.getDBpediaGraph();
  for (  String fullUri : fullUris) {
    Vertex v=Graphs.vertexByUri(graph,URLDecoder.decode(fullUri,"String_Node_Str"));
    String id=(v == null) ? "String_Node_Str" : v.getId().toString();
    System.out.println(fullUri + "String_Node_Str" + id);
  }
  graph.shutdown();
}
Program: 26107
Project: 26107
Buggy source:
public AbstractLocalGraphDisambiguator(GraphType graphType,EdgeWeights graphWeights){
  this.graphType=graphType;
  this.graphWeights=graphWeights;
}

Fixed version (ground truth):
public AbstractLocalGraphDisambiguator(GraphType graphType,EdgeWeights edgeWeights){
  this.graphType=graphType;
  this.edgeWeights=edgeWeights;
}
Program: 26108
Project: 26108
Buggy source:
@Override public double globalConnectivityMeasure(Graph sensegraph){
  Graphs.checkHasVertices(sensegraph);
  if (Graphs.hasNoEdges(sensegraph))   return 0;
  GraphJung<Graph> graphJung=Graphs.asGraphJung(subgraphConstructionSettings.graphType,sensegraph);
  Distance<Vertex> distances=new UnweightedShortestPath<>(graphJung);
  int sumDistances=0;
  for (  Vertex source : sensegraph.getVertices()) {
    Map<Vertex,Number> distancesFromSource=distances.getDistanceMap(source);
    for (    Vertex target : sensegraph.getVertices()) {
      Number distance=distancesFromSource.get(target);
      sumDistances+=distance == null ? 0 : distance.intValue();
    }
  }
  int totalVertices=Graphs.verticesCount(sensegraph);
  int min=totalVertices * (totalVertices - 1);
  int K=totalVertices;
  int max=K * min;
  double compactness=((double)(max - sumDistances)) / (max - min);
  return compactness;
}

Fixed version (ground truth):
@Override public double globalConnectivityMeasure(Graph sensegraph){
  Graphs.checkHasVertices(sensegraph);
  if (Graphs.hasNoEdges(sensegraph))   return 0;
  GraphJung<Graph> graphJung=Graphs.asGraphJung(subgraphConstructionSettings.graphType,sensegraph);
  Distance<Vertex> distances=new DijkstraDistance<>(graphJung,edgeWeights);
  double sumDistances=0;
  for (  Vertex source : sensegraph.getVertices()) {
    Map<Vertex,Number> distancesFromSource=distances.getDistanceMap(source);
    for (    Vertex target : sensegraph.getVertices()) {
      Number distance=distancesFromSource.get(target);
      sumDistances+=distance == null ? 0.0 : distance.doubleValue();
    }
  }
  int totalVertices=Graphs.verticesCount(sensegraph);
  int min=totalVertices * (totalVertices - 1);
  int K=totalVertices;
  int max=K * min;
  double compactness=(max - sumDistances) / (max - min);
  return compactness;
}
Program: 26109
Project: 26109
Buggy source:
@Override public double globalConnectivityMeasure(Graph sensegraph){
  Graphs.checkHasVertices(sensegraph);
  int totalVertices=Graphs.verticesCount(sensegraph);
  int totalEdges=Graphs.edgesCount(sensegraph);
  double edgesCompleteGraph=(totalVertices * (totalVertices - 1)) / 2.0;
  return totalEdges / edgesCompleteGraph;
}

Fixed version (ground truth):
@Override public double globalConnectivityMeasure(Graph sensegraph){
  Graphs.checkHasVertices(sensegraph);
  int totalVertices=Graphs.verticesCount(sensegraph);
  double totalEdgesWeighted=Graphs.edgesCountWeighted(sensegraph,edgeWeights);
  double edgesCompleteGraph=(totalVertices * (totalVertices - 1)) / 2.0;
  return totalEdgesWeighted / edgesCompleteGraph;
}
Program: 26110
Project: 26110
Buggy source:
@Override public double globalConnectivityMeasure(Graph sensegraph){
  Graphs.checkHasVertices(sensegraph);
  int totalVertices=Graphs.verticesCount(sensegraph);
  int totalEdges=Graphs.edgesCount(sensegraph);
  if (totalEdges == 0)   return 0;
  double graphEntropy=0;
  for (  Vertex vertex : sensegraph.getVertices()) {
    double degree=Graphs.vertexDegreeWeighted(vertex,Direction.BOTH,edgeWeights);
    if (degree != 0) {
      double vertexProbability=degree / (2.0 * totalEdges);
      graphEntropy+=vertexProbability * Math.log(vertexProbability);
    }
  }
  graphEntropy*=-1;
  graphEntropy/=Math.log(totalVertices);
  return graphEntropy;
}

Fixed version (ground truth):
@Override public double globalConnectivityMeasure(Graph sensegraph){
  Graphs.checkHasVertices(sensegraph);
  int totalVertices=Graphs.verticesCount(sensegraph);
  double totalEdgesWeighted=Graphs.edgesCountWeighted(sensegraph,edgeWeights);
  if (totalEdgesWeighted == 0)   return 0;
  double graphEntropy=0;
  for (  Vertex vertex : sensegraph.getVertices()) {
    double degree=Graphs.vertexDegreeWeighted(vertex,Direction.BOTH,edgeWeights);
    if (degree != 0) {
      double vertexProbability=degree / (2.0 * totalEdgesWeighted);
      graphEntropy+=vertexProbability * Math.log(vertexProbability);
    }
  }
  graphEntropy*=-1;
  graphEntropy/=Math.log(totalVertices);
  return graphEntropy;
}
Program: 26111
Project: 26111
Buggy source:
public BetweennessVertexScorer(Graph subgraph){
  GraphJung<Graph> graphJung=Graphs.asGraphJung(graphType,subgraph);
  betweenness=new edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality<Vertex,Edge>(graphJung);
  verticesCount=Graphs.verticesCount(subgraph);
}

Fixed version (ground truth):
public BetweennessVertexScorer(Graph subgraph){
  GraphJung<Graph> graphJung=Graphs.asGraphJung(graphType,subgraph);
  betweenness=new edu.uci.ics.jung.algorithms.scoring.BetweennessCentrality<Vertex,Edge>(graphJung,edgeWeights);
  verticesCount=Graphs.verticesCount(subgraph);
}
Program: 26112
Project: 26112
Buggy source:
@Override public Double getVertexScore(Vertex v){
  double degree=Graphs.vertexDegreeWeighted(v,graphType.getDirection(),graphWeights);
  double centrality=degree / (verticesCount - 1);
  return centrality;
}

Fixed version (ground truth):
@Override public Double getVertexScore(Vertex v){
  double degree=Graphs.vertexDegreeWeighted(v,graphType.getDirection(),edgeWeights);
  double centrality=degree / (verticesCount - 1);
  return centrality;
}
Program: 26113
Project: 26113
Buggy source:
public HITSVertexScorer(Graph subgraph){
  GraphJung<Graph> graphJung=Graphs.asGraphJung(graphType,subgraph);
  hits=new HITS<Vertex,Edge>(graphJung,alpha);
  hits.acceptDisconnectedGraph(true);
  hits.setMaxIterations(iterations);
  hits.evaluate();
}

Fixed version (ground truth):
public HITSVertexScorer(Graph subgraph){
  GraphJung<Graph> graphJung=Graphs.asGraphJung(graphType,subgraph);
  hits=new HITS<Vertex,Edge>(graphJung,edgeWeights,alpha);
  hits.acceptDisconnectedGraph(true);
  hits.setMaxIterations(iterations);
  hits.evaluate();
}
Program: 26114
Project: 26114
Buggy source:
@Override public Double getVertexScore(Vertex v){
  Scores scores=hits.getVertexScore(v);
  double authority=CollectionUtils.iterableItemCount(Graphs.connectedEdges(v,graphType)) != 0 ? scores.authority : 0;
  return authority;
}

Fixed version (ground truth):
@Override public Double getVertexScore(Vertex v){
  Scores scores=hits.getVertexScore(v);
  double authority=Iterables.size(Graphs.connectedEdges(v,graphType)) != 0 ? scores.authority : 0;
  return authority;
}
Program: 26115
Project: 26115
Buggy source:
/** 
 * Get a   {@link Predicate} implementation from config.
 * @param config A configuration object where the  {@link LoadingType} is looked up.
 * @return A {@link Predicate} instance.
 */
static Predicate<Statement> fromConfig(final Configuration config){
  List<LoadingType> loadingTypes=loadingTypesFromConfig(config);
  if (loadingTypes == null || loadingTypes.isEmpty())   return DUMMY_PREDICATE;
  return fromLoadingTypes(loadingTypes);
}

Fixed version (ground truth):
/** 
 * Get a   {@link Predicate} implementation from config.
 * @param config A configuration object where the  {@link LoadingType} is looked up.
 * @return A {@link Predicate} instance.
 */
static Predicate<Statement> fromConfig(final Configuration config){
  List<LoadingType> loadingTypes=LoadingType.fromConfig(config);
  if (loadingTypes == null || loadingTypes.isEmpty())   return DUMMY_PREDICATE;
  return fromLoadingTypes(loadingTypes);
}
Program: 26116
Project: 26116
Buggy source:
public static EdgeWeight getDBpediaImpl(Configuration config){
  EdgeWeightType edgeWeightType=EdgeWeightType.fromConfig(config);
switch (edgeWeightType) {
case COMB_IC:
    return new CombinedInformationContent(occCounts);
case IC_PMI:
  return new InfContentAndPointwiseMutuaInf(occCounts);
case JOINT_IC:
return new JointInformationContent(occCounts);
default :
throw new IllegalArgumentException("String_Node_Str" + edgeWeightType);
}
}

Fixed version (ground truth):
public static EdgeWeight getDBpediaImpl(Configuration config){
  EdgeWeightType edgeWeightType=EdgeWeightType.fromConfig(config);
switch (edgeWeightType) {
case COMB_IC:
    return new CombinedInformationContent(occCounts);
case IC_PMI:
  return new InfContentAndPointwiseMutuaInf(occCounts);
case JOINT_IC:
return new JointInformationContent(occCounts);
}
throw new IllegalArgumentException("String_Node_Str" + EdgeWeightType.class.getSimpleName() + "String_Node_Str"+ edgeWeightType);
}
Program: 26117
Project: 26117
Buggy source:
@Test public void testConfig2LoadingTypes(){
  List<LoadingType> loadingTypes=StatementPredicateFactory.loadingTypesFromConfig(config2);
  assertTrue(loadingTypes.size() == 1);
  assertTrue(loadingTypes.get(0).equals(LoadingType.COMPLETE));
}

Fixed version (ground truth):
@Test public void testConfig2LoadingTypes(){
  List<LoadingType> loadingTypes=StatementPredicateFactory.LoadingType.fromConfig(config2);
  assertTrue(loadingTypes.size() == 1);
  assertTrue(loadingTypes.get(0).equals(LoadingType.COMPLETE));
}
Program: 26118
Project: 26118
Buggy source:
@Test public void testConfig3LoadingTypes(){
  List<LoadingType> loadingTypes=StatementPredicateFactory.loadingTypesFromConfig(config3);
  assertTrue(loadingTypes.size() == 0);
}

Fixed version (ground truth):
@Test public void testConfig3LoadingTypes(){
  List<LoadingType> loadingTypes=StatementPredicateFactory.LoadingType.fromConfig(config3);
  assertTrue(loadingTypes.size() == 0);
}
Program: 26119
Project: 26119
Buggy source:
@Test public void testConfig1LoadingTypes(){
  List<LoadingType> loadingTypes=StatementPredicateFactory.loadingTypesFromConfig(config1);
  assertTrue(loadingTypes.size() == 2);
  assertTrue(loadingTypes.get(0).equals(LoadingType.BLACKLIST));
  assertTrue(loadingTypes.get(1).equals(LoadingType.COMPLETE));
}

Fixed version (ground truth):
@Test public void testConfig1LoadingTypes(){
  List<LoadingType> loadingTypes=StatementPredicateFactory.LoadingType.fromConfig(config1);
  assertTrue(loadingTypes.size() == 2);
  assertTrue(loadingTypes.get(0).equals(LoadingType.BLACKLIST));
  assertTrue(loadingTypes.get(1).equals(LoadingType.COMPLETE));
}
Program: 26120
Project: 26120
Buggy source:
BlacklistStatementPredicate(){
  Configuration conf=GraphConfig.config();
  categories=new HashSet<String>();
  predicates=new HashSet<String>();
  String categoriesFileName=conf.getString(KEY_CATEGORIES_FILE);
  try {
    categories.addAll(FileUtils.readNonEmptyNonCommentLinesFromFile(getClass(),categoriesFileName));
  }
 catch (  URISyntaxException|IOException e) {
    logger.warn("String_Node_Str",e);
  }
  String predicatesFileName=conf.getString(KEY_PREDICATES_FILE);
  try {
    predicates.addAll(FileUtils.readNonEmptyNonCommentLinesFromFile(getClass(),predicatesFileName));
  }
 catch (  URISyntaxException|IOException e) {
    logger.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
BlacklistStatementPredicate(Configuration config){
  categories=new HashSet<String>();
  predicates=new HashSet<String>();
  String categoriesFileName=config.getString(CONFIG_CATEGORIES_FILE);
  try {
    categories.addAll(FileUtils.readNonEmptyNonCommentLinesFromFile(getClass(),categoriesFileName));
  }
 catch (  URISyntaxException|IOException e) {
    logger.warn("String_Node_Str",e);
  }
  String predicatesFileName=config.getString(CONFIG_PREDICATES_FILE);
  try {
    predicates.addAll(FileUtils.readNonEmptyNonCommentLinesFromFile(getClass(),predicatesFileName));
  }
 catch (  URISyntaxException|IOException e) {
    logger.warn("String_Node_Str",e);
  }
}
Program: 26121
Project: 26121
Buggy source:
@Override public void run(){
  if (db != null) {
    logger.info("String_Node_Str");
    db.close();
  }
}

Fixed version (ground truth):
@Override public void run(){
  if (db instanceof PersistentMap) {
    logger.info("String_Node_Str");
    db.close();
  }
}
Program: 26122
Project: 26122
Buggy source:
static PersistentMap<String,Integer> loadPersistentOccCountsMap(Configuration config,boolean clear,boolean readOnly){
  long startTime=System.currentTimeMillis();
  String dbName="String_Node_Str";
  String location=config.getString("String_Node_Str");
  final PersistentMap<String,Integer> db=new BerkeleyDB.Builder<>(new File(location),dbName,String.class,Integer.class).readOnly(readOnly).build();
  if (clear)   db.clear();
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      if (db != null) {
        logger.info("String_Node_Str");
        db.close();
      }
    }
  }
);
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime) / 1000.0);
  return db;
}

Fixed version (ground truth):
static PersistentMap<String,Integer> loadPersistentOccCountsMap(Configuration config,boolean clear,boolean readOnly){
  long startTime=System.currentTimeMillis();
  String dbName="String_Node_Str";
  String location=config.getString("String_Node_Str");
  final PersistentMap<String,Integer> db=new BerkeleyDB.Builder<>(new File(location),dbName,String.class,Integer.class).readOnly(readOnly).build();
  if (clear)   db.clear();
  Runtime.getRuntime().addShutdownHook(new Thread(){
    @Override public void run(){
      if (db instanceof PersistentMap) {
        logger.info("String_Node_Str");
        db.close();
      }
    }
  }
);
  logger.info("String_Node_Str",(System.currentTimeMillis() - startTime) / 1000.0);
  return db;
}
Program: 26123
Project: 26123
Buggy source:
@BeforeClass public static void beforeClass(){
  predicate=new BlacklistStatementPredicate();
  invalidSubject=fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
  invalidObject=fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
  validStatement=fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass(){
  predicate=new BlacklistStatementPredicate(GraphConfig.config());
  invalidSubject=fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
  invalidObject=fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
  validStatement=fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 26124
Project: 26124
Buggy source:
@Override public String transform(Edge edge){
  String uriProp=edge.getProperty(GraphConfig.URI_PROPERTY);
  return uriProp != null ? uriProp : "String_Node_Str";
}

Fixed version (ground truth):
@Override public String transform(Edge edge){
  return Graphs.edgeToString(edge);
}
Program: 26125
Project: 26125
Buggy source:
private static void visualizeGraph(Graph graph,String frameTitle){
  GraphJung<Graph> graphJung=new GraphJung<>(graph);
  Layout<Vertex,Edge> layout=new ISOMLayout<Vertex,Edge>(graphJung);
  layout.setSize(SCREEN_DIMENSION);
  BasicVisualizationServer<Vertex,Edge> viz=new BasicVisualizationServer<Vertex,Edge>(layout);
  viz.setPreferredSize(SCREEN_DIMENSION);
  Transformer<Vertex,String> vertexLabelTransformer=new Transformer<Vertex,String>(){
    @Override public String transform(    Vertex vertex){
      return vertex.getProperty(GraphConfig.URI_PROPERTY).toString();
    }
  }
;
  Transformer<Edge,String> edgeLabelTransformer=new Transformer<Edge,String>(){
    @Override public String transform(    Edge edge){
      String uriProp=edge.getProperty(GraphConfig.URI_PROPERTY);
      return uriProp != null ? uriProp : "String_Node_Str";
    }
  }
;
  viz.getRenderContext().setEdgeLabelTransformer(edgeLabelTransformer);
  viz.getRenderContext().setVertexLabelTransformer(vertexLabelTransformer);
  JFrame frame=new JFrame(frameTitle);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.getContentPane().add(viz);
  frame.pack();
  frame.setVisible(true);
}

Fixed version (ground truth):
private static void visualizeGraph(Graph graph,String frameTitle){
  GraphJung<Graph> graphJung=new GraphJung<>(graph);
  Layout<Vertex,Edge> layout=new ISOMLayout<Vertex,Edge>(graphJung);
  layout.setSize(SCREEN_DIMENSION);
  BasicVisualizationServer<Vertex,Edge> viz=new BasicVisualizationServer<Vertex,Edge>(layout);
  viz.setPreferredSize(SCREEN_DIMENSION);
  Transformer<Vertex,String> vertexLabelTransformer=new Transformer<Vertex,String>(){
    @Override public String transform(    Vertex vertex){
      return vertex.getProperty(GraphConfig.URI_PROPERTY).toString();
    }
  }
;
  Transformer<Edge,String> edgeLabelTransformer=new Transformer<Edge,String>(){
    @Override public String transform(    Edge edge){
      return Graphs.edgeToString(edge);
    }
  }
;
  viz.getRenderContext().setEdgeLabelTransformer(edgeLabelTransformer);
  viz.getRenderContext().setVertexLabelTransformer(vertexLabelTransformer);
  JFrame frame=new JFrame(frameTitle);
  frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  frame.getContentPane().add(viz);
  frame.pack();
  frame.setVisible(true);
}
Program: 26126
Project: 26126
Buggy source:
public AbstractGlobalGraphDisambiguator(SubgraphConstructionSettings subgraphConstructionSettings,GraphWeights graphWeights){
  this.subgraphConstructionSettings=subgraphConstructionSettings;
  this.graphWeights=graphWeights;
}

Fixed version (ground truth):
public AbstractGlobalGraphDisambiguator(SubgraphConstructionSettings subgraphConstructionSettings,EdgeWeight graphWeights){
  this.subgraphConstructionSettings=subgraphConstructionSettings;
  this.graphWeights=graphWeights;
}
Program: 26127
Project: 26127
Buggy source:
public AbstractLocalGraphDisambiguator(GraphType graphType,GraphWeights graphWeights){
  this.graphType=graphType;
  this.graphWeights=graphWeights;
}

Fixed version (ground truth):
public AbstractLocalGraphDisambiguator(GraphType graphType,EdgeWeight graphWeights){
  this.graphType=graphType;
  this.graphWeights=graphWeights;
}
Program: 26128
Project: 26128
Buggy source:
public Compactness(SubgraphConstructionSettings settings,GraphWeights graphWeights){
  super(settings,graphWeights);
}

Fixed version (ground truth):
public Compactness(SubgraphConstructionSettings settings,EdgeWeight graphWeights){
  super(settings,graphWeights);
}
Program: 26129
Project: 26129
Buggy source:
public EdgeDensity(SubgraphConstructionSettings settings,GraphWeights graphWeights){
  super(settings,graphWeights);
}

Fixed version (ground truth):
public EdgeDensity(SubgraphConstructionSettings settings,EdgeWeight graphWeights){
  super(settings,graphWeights);
}
Program: 26130
Project: 26130
Buggy source:
public GraphEntropy(SubgraphConstructionSettings settings,GraphWeights graphWeights){
  super(settings,graphWeights);
}

Fixed version (ground truth):
public GraphEntropy(SubgraphConstructionSettings settings,EdgeWeight graphWeights){
  super(settings,graphWeights);
}
Program: 26131
Project: 26131
Buggy source:
public BetweennessCentrality(GraphType graphType,GraphWeights graphWeights){
  super(graphType,graphWeights);
}

Fixed version (ground truth):
public BetweennessCentrality(GraphType graphType,EdgeWeight graphWeights){
  super(graphType,graphWeights);
}
Program: 26132
Project: 26132
Buggy source:
public DegreeCentrality(GraphType graphType,GraphWeights graphWeights){
  super(graphType,graphWeights);
}

Fixed version (ground truth):
public DegreeCentrality(GraphType graphType,EdgeWeight graphWeights){
  super(graphType,graphWeights);
}
Program: 26133
Project: 26133
Buggy source:
public HITSCentrality(GraphType graphType,GraphWeights graphWeights){
  this(graphType,graphWeights,DEFAULT_ALPHA,DEFAULT_ITERATIONS);
}

Fixed version (ground truth):
public HITSCentrality(GraphType graphType,EdgeWeight graphWeights){
  this(graphType,graphWeights,DEFAULT_ALPHA,DEFAULT_ITERATIONS);
}
Program: 26134
Project: 26134
Buggy source:
public KPPCentrality(GraphType graphType,GraphWeights graphWeights){
  super(graphType,graphWeights);
}

Fixed version (ground truth):
public KPPCentrality(GraphType graphType,EdgeWeight graphWeights){
  super(graphType,graphWeights);
}
Program: 26135
Project: 26135
Buggy source:
public PageRankCentrality(GraphType graphType,GraphWeights graphWeights){
  this(graphType,graphWeights,DEFAULT_ALPHA,DEFAULT_ITERATIONS);
}

Fixed version (ground truth):
public PageRankCentrality(GraphType graphType,EdgeWeight graphWeights){
  this(graphType,graphWeights,DEFAULT_ALPHA,DEFAULT_ITERATIONS);
}
Program: 26136
Project: 26136
Buggy source:
@SuppressWarnings("String_Node_Str") public static <T extends SurfaceForm,U extends Sense>LocalGraphDisambiguator<T,U> newLocalDisambiguator(GraphType graphType,GraphWeights graphWeights){
  String disambiguatorClassName=config.getString(LOCAL_DISAMBIGUATOR_KEY,DEFAULT_LOCAL_DISAMBIGUATOR);
  try {
    @SuppressWarnings("String_Node_Str") Class<? extends LocalGraphDisambiguator> localDisambiguatorClass=Class.forName(disambiguatorClassName).asSubclass(LocalGraphDisambiguator.class);
    return localDisambiguatorClass.getConstructor(GraphType.class,GraphWeights.class).newInstance(graphType,graphWeights);
  }
 catch (  ClassNotFoundException|NoSuchMethodException|SecurityException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T extends SurfaceForm,U extends Sense>LocalGraphDisambiguator<T,U> newLocalDisambiguator(GraphType graphType,EdgeWeight graphWeights){
  String disambiguatorClassName=config.getString(LOCAL_DISAMBIGUATOR_KEY,DEFAULT_LOCAL_DISAMBIGUATOR);
  try {
    @SuppressWarnings("String_Node_Str") Class<? extends LocalGraphDisambiguator> localDisambiguatorClass=Class.forName(disambiguatorClassName).asSubclass(LocalGraphDisambiguator.class);
    return localDisambiguatorClass.getConstructor(GraphType.class,EdgeWeight.class).newInstance(graphType,graphWeights);
  }
 catch (  ClassNotFoundException|NoSuchMethodException|SecurityException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 26137
Project: 26137
Buggy source:
@SuppressWarnings("String_Node_Str") public static <T extends SurfaceForm,U extends Sense>GlobalGraphDisambiguator<T,U> newGlobalDisambiguator(Configuration configuration,SubgraphConstructionSettings subgraphConstructionSettings,GraphWeights graphWeights){
  String disambiguatorClassName=config.getString(GLOBAL_DISAMBIGUATOR_KEY,DEFAULT_GLOBAL_DISAMBIGUATOR);
  try {
    @SuppressWarnings("String_Node_Str") Class<? extends GlobalGraphDisambiguator> globalDisambiguatorClass=Class.forName(disambiguatorClassName).asSubclass(GlobalGraphDisambiguator.class);
    return globalDisambiguatorClass.getConstructor(SubgraphConstructionSettings.class,GraphWeights.class).newInstance(subgraphConstructionSettings,graphWeights);
  }
 catch (  ClassNotFoundException|NoSuchMethodException|SecurityException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public static <T extends SurfaceForm,U extends Sense>GlobalGraphDisambiguator<T,U> newGlobalDisambiguator(Configuration configuration,SubgraphConstructionSettings subgraphConstructionSettings,EdgeWeight graphWeights){
  String disambiguatorClassName=config.getString(GLOBAL_DISAMBIGUATOR_KEY,DEFAULT_GLOBAL_DISAMBIGUATOR);
  try {
    @SuppressWarnings("String_Node_Str") Class<? extends GlobalGraphDisambiguator> globalDisambiguatorClass=Class.forName(disambiguatorClassName).asSubclass(GlobalGraphDisambiguator.class);
    return globalDisambiguatorClass.getConstructor(SubgraphConstructionSettings.class,EdgeWeight.class).newInstance(subgraphConstructionSettings,graphWeights);
  }
 catch (  ClassNotFoundException|NoSuchMethodException|SecurityException|InstantiationException|IllegalAccessException|IllegalArgumentException|InvocationTargetException e) {
    throw new RuntimeException("String_Node_Str",e);
  }
}
Program: 26138
Project: 26138
Buggy source:
public static Set<String> urisOfVertices(Iterable<Vertex> vertices){
  Set<String> uris=new HashSet<>();
  for (  Vertex v : vertices)   uris.add(uriOfVertex(v));
  return uris;
}

Fixed version (ground truth):
public static Set<String> urisOfVertices(Iterable<Vertex> vertices){
  Set<String> uris=new HashSet<>();
  for (  Vertex v : vertices)   uris.add(shortUriOfVertex(v));
  return uris;
}
Program: 26139
Project: 26139
Buggy source:
private static void addEdgeIfNonExistentUnsafe(Graph graph,Edge edge,Vertex outVertex,Vertex inVertex){
  if (graph.getEdge(edge.getId()) == null)   graph.addEdge(edge.getId(),outVertex,inVertex,edge.getLabel());
}

Fixed version (ground truth):
private static void addEdgeIfNonExistentUnsafe(Graph graph,Edge edge,Vertex outVertex,Vertex inVertex){
  if (graph.getEdge(edge.getId()) == null) {
    Edge newEdge=graph.addEdge(edge.getId(),outVertex,inVertex,edge.getLabel());
    newEdge.setProperty(GraphConfig.URI_PROPERTY,edge.getProperty(GraphConfig.URI_PROPERTY));
  }
}
Program: 26140
Project: 26140
Buggy source:
public static boolean isVertexInGraph(Vertex v,Graph graph){
  String uri=Graphs.uriOfVertex(v);
  Vertex graphVertex=vertexByUri(graph,uri);
  return graphVertex != null;
}

Fixed version (ground truth):
public static boolean isVertexInGraph(Vertex v,Graph graph){
  String uri=Graphs.shortUriOfVertex(v);
  Vertex graphVertex=vertexByUri(graph,uri);
  return graphVertex != null;
}
Program: 26141
Project: 26141
Buggy source:
@Deprecated public static boolean equalByUri(Vertex v1,Vertex v2){
  return uriOfVertex(v1).equals(uriOfVertex(v2));
}

Fixed version (ground truth):
@Deprecated public static boolean equalByUri(Vertex v1,Vertex v2){
  return shortUriOfVertex(v1).equals(shortUriOfVertex(v2));
}
Program: 26142
Project: 26142
Buggy source:
/** 
 * Main method.
 * @param args each arg can be a directory containing RDF files or a RDF file itself.
 */
public static void main(String[] args) throws ConfigurationException {
  DBpediaGraphLoader.loadFromFiles(FileUtils.extractFilesFromArgs(args));
  PredObjOccsCounter.countDBpediaGraphOccsIntoDB();
}

Fixed version (ground truth):
/** 
 * Main method.
 * @param args each arg can be a directory containing RDF files or a RDF file itself.
 */
public static void main(String[] args) throws ConfigurationException {
  DBpediaGraphLoader.loadFromFiles(FileUtils.extractFilesFromArgs(args));
  PredObjOccsCounter.countAndPersistDBpediaGraphOccs();
}
Program: 26143
Project: 26143
Buggy source:
@Override public String toString(){
  return new StringBuilder().append("String_Node_Str").append(Graphs.uriOfVertex(start)).append("String_Node_Str").append(Graphs.uriOfVertex(last)).append("String_Node_Str").append(edges).toString();
}

Fixed version (ground truth):
@Override public String toString(){
  return new StringBuilder().append("String_Node_Str").append(Graphs.shortUriOfVertex(start)).append("String_Node_Str").append(Graphs.shortUriOfVertex(last)).append("String_Node_Str").append(edges).toString();
}
Program: 26144
Project: 26144
Buggy source:
@Override public void handleStatement(Statement st){
  Triple triple=Triple.fromStatement(st);
  if (!tripleFilter.apply(triple)) {
    invalidTriples++;
  }
 else {
    validTriples++;
    String subject=UriTransformer.shorten(triple.subject());
    String predicate=UriTransformer.shorten(triple.predicate());
    String object=UriTransformer.shorten(triple.object());
    Vertex out=addVertexByUriBatchIfNonExistent(subject);
    Vertex in=addVertexByUriBatchIfNonExistent(object);
    Edge e=bgraph.addEdge(null,out,in,GraphConfig.EDGE_LABEL);
    e.setProperty(GraphConfig.URI_PROPERTY,predicate);
  }
  long totalTriples=validTriples + invalidTriples;
  if (totalTriples % TICK_SIZE == 0) {
    long timeDelta=(System.currentTimeMillis() - tick);
    logger.info(String.format("String_Node_Str",totalTriples,validTriples,invalidTriples,timeDelta / 1000.0,TICK_SIZE));
    tick=System.currentTimeMillis();
  }
}

Fixed version (ground truth):
@Override public void handleStatement(Statement st){
  if (st.getObject() instanceof Literal)   invalidTriples++;
 else {
    Triple triple=Triple.fromStatement(st);
    if (!tripleFilter.apply(triple))     invalidTriples++;
 else {
      validTriples++;
      String subject=UriTransformer.shorten(triple.subject());
      String predicate=UriTransformer.shorten(triple.predicate());
      String object=UriTransformer.shorten(triple.object());
      Vertex out=addVertexByUriBatchIfNonExistent(subject);
      Vertex in=addVertexByUriBatchIfNonExistent(object);
      Edge e=bgraph.addEdge(null,out,in,GraphConfig.EDGE_LABEL);
      e.setProperty(GraphConfig.URI_PROPERTY,predicate);
    }
  }
  long totalTriples=validTriples + invalidTriples;
  if (totalTriples % TICK_SIZE == 0) {
    long timeDelta=(System.currentTimeMillis() - tick);
    logger.info(String.format("String_Node_Str",totalTriples,validTriples,invalidTriples,timeDelta / 1000.0,TICK_SIZE));
    tick=System.currentTimeMillis();
  }
}
Program: 26145
Project: 26145
Buggy source:
public Triple(String subject,String predicate,String object){
  this.subject=UriTransformer.decode(subject);
  this.predicate=UriTransformer.decode(predicate);
  this.object=UriTransformer.decode(object);
}

Fixed version (ground truth):
Triple(Resource subject,URI predicate,Value object){
  this.subject=UriTransformer.decode(subject.stringValue());
  this.predicate=UriTransformer.decode(predicate.stringValue());
  if (object instanceof Literal)   this.object=object.stringValue();
 else   this.object=UriTransformer.decode(object.stringValue());
}
Program: 26146
Project: 26146
Buggy source:
public String predicate(){
  return predicate;
}

Fixed version (ground truth):
String predicate(){
  return predicate;
}
Program: 26147
Project: 26147
Buggy source:
public String subject(){
  return subject;
}

Fixed version (ground truth):
String subject(){
  return subject;
}
Program: 26148
Project: 26148
Buggy source:
public static Triple fromStatement(Statement st){
  return new Triple(st.getSubject().stringValue(),st.getPredicate().stringValue(),st.getObject().stringValue());
}

Fixed version (ground truth):
static Triple fromStatement(Statement st){
  return new Triple(st.getSubject(),st.getPredicate(),st.getObject());
}
Program: 26149
Project: 26149
Buggy source:
public String object(){
  return object;
}

Fixed version (ground truth):
String object(){
  return object;
}
Program: 26150
Project: 26150
Buggy source:
@BeforeClass public static void beforeClass(){
  predicate=new BlacklistTriplePredicate(GraphConfig.config());
  invalidSubject=new Triple("String_Node_Str","String_Node_Str","String_Node_Str");
  invalidObject=new Triple("String_Node_Str","String_Node_Str","String_Node_Str");
  validTriple=new Triple("String_Node_Str","String_Node_Str","String_Node_Str");
}

Fixed version (ground truth):
@BeforeClass public static void beforeClass(){
  predicate=new BlacklistTriplePredicate(GraphConfig.config());
  invalidSubject=Triple.fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
  invalidObject=Triple.fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
  validTriple=Triple.fromStringUris("String_Node_Str","String_Node_Str","String_Node_Str");
}
Program: 26151
Project: 26151
Buggy source:
private static void checkUri(String fullUriEncoded,String fullUriDecoded){
  Triple t=new Triple(fullUriEncoded,fullUriEncoded,fullUriEncoded);
  assertEquals(fullUriDecoded,t.subject());
  assertEquals(fullUriDecoded,t.predicate());
  assertEquals(fullUriDecoded,t.object());
}

Fixed version (ground truth):
private static void checkUri(String fullUriEncoded,String fullUriDecoded){
  Triple t=Triple.fromStringUris(fullUriEncoded,fullUriEncoded,fullUriEncoded);
  assertEquals(fullUriDecoded,t.subject());
  assertEquals(fullUriDecoded,t.predicate());
  assertEquals(fullUriDecoded,t.object());
}
Program: 26152
Project: 26152
Buggy source:
private void createDBEnvironment(final File location){
  if (!location.exists())   location.mkdirs();
  try {
    final EnvironmentConfig envConfig=new EnvironmentConfig();
    envConfig.setCachePercent(60);
    envConfig.setAllowCreate(true);
    envConfig.setConfigParam(EnvironmentConfig.LOG_FILE_MAX,"String_Node_Str");
    this.dbEnv=new Environment(location,envConfig);
  }
 catch (  DatabaseException dbe) {
    dbe.printStackTrace();
  }
}

Fixed version (ground truth):
private void createDBEnvironment(final File location,boolean allowCreate){
  if (!location.exists())   location.mkdirs();
  try {
    final EnvironmentConfig envConfig=new EnvironmentConfig();
    envConfig.setAllowCreate(allowCreate);
    envConfig.setConfigParam(EnvironmentConfig.LOG_FILE_MAX,"String_Node_Str");
    this.dbEnv=new Environment(location,envConfig);
  }
 catch (  DatabaseException dbe) {
    dbe.printStackTrace();
  }
}
Program: 26153
Project: 26153
Buggy source:
public BerkeleyDB<K,V> build(){
  return new BerkeleyDB<>(location,dbName,keyClass,valueClass,allowSortedDuplicates,readOnly);
}

Fixed version (ground truth):
public BerkeleyDB<K,V> build(){
  return new BerkeleyDB<>(location,dbName,keyClass,valueClass,allowSortedDuplicates,readOnly,allowCreate);
}
Program: 26154
Project: 26154
Buggy source:
public BerkeleyDB(final File location,final String dbName,final Class<K> keyClass,final Class<V> valueClass,boolean allowSortedDuplicates,boolean readOnly){
  createDBEnvironment(location);
  initDB(dbName,keyClass,valueClass,allowSortedDuplicates,readOnly);
}

Fixed version (ground truth):
public BerkeleyDB(final File location,final String dbName,final Class<K> keyClass,final Class<V> valueClass,boolean allowSortedDuplicates,boolean readOnly,boolean allowCreate){
  createDBEnvironment(location,allowCreate);
  initDB(dbName,keyClass,valueClass,allowSortedDuplicates,readOnly);
}
Program: 26155
Project: 26155
Buggy source:
/** 
 * Parse all non-empty and non-comment lines (comment lines start with '#') from a test results file into a map.
 * @param clazz the class whose classpath will be used.
 * @throws ClassNotFoundException
 */
public static Map<String,Map<Class<?>,Double>> parseDisambiguationResults(String fileName,Class<?> clazz,String packageNameDisambiguator) throws IOException, URISyntaxException, ClassNotFoundException {
  Map<String,Map<Class<?>,Double>> results=new HashMap<>();
  List<String> lines=FileUtils.readRelevantLinesFromFile(clazz,fileName);
  if (lines.isEmpty())   throw new RuntimeException(fileName + "String_Node_Str");
  String[] headers=lines.remove(0).split(DELIMITER);
  for (  String line : lines) {
    String[] values=line.split(DELIMITER);
    String uri=values[0];
    Map<Class<?>,Double> map=new HashMap<>();
    for (int i=1; i < values.length; i++) {
      Double value=Double.parseDouble(values[i]);
      String fullClassName=packageNameDisambiguator + "String_Node_Str" + headers[i];
      Class<?> keyClazz=Class.forName(fullClassName);
      map.put(keyClazz,value);
    }
    results.put(uri,map);
  }
  return results;
}

Fixed version (ground truth):
/** 
 * Parse all non-empty and non-comment lines (comment lines start with '#') from a test results file into a map.
 * @param clazz the class whose classpath will be used.
 * @throws ClassNotFoundException
 */
public static Map<String,Map<Class<?>,Double>> parseDisambiguationResults(String fileName,Class<?> clazz,String packageNameDisambiguator) throws IOException, URISyntaxException, ClassNotFoundException {
  Map<String,Map<Class<?>,Double>> results=new HashMap<>();
  List<String> lines=FileUtils.readRelevantLinesFromFile(clazz,fileName);
  if (lines.isEmpty())   throw new RuntimeException(fileName + "String_Node_Str");
  String[] headers=lines.get(0).split(DELIMITER);
  for (  String line : lines.subList(1,lines.size())) {
    String[] values=line.split(DELIMITER);
    String uri=values[0];
    Map<Class<?>,Double> map=new HashMap<>();
    for (int i=1; i < values.length; i++) {
      Double value=Double.parseDouble(values[i]);
      String fullClassName=packageNameDisambiguator + "String_Node_Str" + headers[i];
      Class<?> keyClazz=Class.forName(fullClassName);
      map.put(keyClazz,value);
    }
    results.put(uri,map);
  }
  return results;
}
Program: 26156
Project: 26156
Buggy source:
/** 
 * Read all lines from a file and return all non-empty and non-comment lines (comment lines start with '#').
 * @param clazz the class whose classpath will be used.
 */
public static List<String> readRelevantLinesFromFile(Class<?> clazz,String fileName) throws IOException, URISyntaxException {
  URL url=clazz.getResource(fileName);
  if (url == null)   throw new IllegalArgumentException("String_Node_Str" + fileName);
  List<String> lines=Files.readAllLines(Paths.get(url.toURI()),StandardCharsets.UTF_8);
  Iterator<String> iter=lines.iterator();
  while (iter.hasNext()) {
    String line=iter.next();
    if (line.trim().isEmpty() || line.startsWith("String_Node_Str"))     iter.remove();
  }
  return lines;
}

Fixed version (ground truth):
/** 
 * Read all lines from a file and return all non-empty and non-comment lines (comment lines start with '#').
 * @param clazz the class whose classpath will be used.
 */
public static List<String> readRelevantLinesFromFile(Class<?> clazz,String fileName) throws IOException, URISyntaxException {
  URL resource=clazz.getResource(fileName);
  if (resource == null)   throw new IllegalArgumentException("String_Node_Str" + fileName);
  List<String> lines=Resources.readLines(resource,Charsets.UTF_8,new NonEmptyNonCommentLinesCollector());
  return lines;
}
Program: 26157
Project: 26157
Buggy source:
@Override public List<SurfaceFormSenseScore<T,U>> disambiguate(Collection<? extends SurfaceFormSenses<T,U>> surfaceFormsSenses,Graph subgraph){
  VertexScorer<Vertex,Double> vertexScorer=getVertexScorer(subgraph);
  List<SurfaceFormSenseScore<T,U>> senseScores=ModelTransformer.initializeScores(surfaceFormsSenses,factory);
  for (  SurfaceFormSenseScore<T,U> senseScore : senseScores) {
    double score=vertexScorer.getVertexScore(Graphs.vertexByUri(subgraph,senseScore.sense().fullUri()));
    senseScore.setScore(score);
  }
  Collections.sort(senseScores);
  Collections.reverse(senseScores);
  return senseScores;
}

Fixed version (ground truth):
@Override public List<SurfaceFormSenseScore<T,U>> disambiguate(Collection<? extends SurfaceFormSenses<T,U>> surfaceFormsSenses,Graph subgraph){
  VertexScorer<Vertex,Double> vertexScorer=getVertexScorer(subgraph);
  List<SurfaceFormSenseScore<T,U>> senseScores=ModelTransformer.initializeScores(surfaceFormsSenses,factory);
  for (  SurfaceFormSenseScore<T,U> senseScore : senseScores) {
    Vertex v=Graphs.vertexByUri(subgraph,senseScore.sense().fullUri());
    double score=(v == null) ? -1 : vertexScorer.getVertexScore(v);
    senseScore.setScore(score);
  }
  Collections.sort(senseScores);
  Collections.reverse(senseScores);
  return senseScores;
}
Program: 26158
Project: 26158
Buggy source:
public static Vertex vertexByUri(Graph graph,String uri){
  String shortUri=UriShortener.shorten(uri);
  List<Vertex> vertices=new LinkedList<Vertex>();
  Iterable<Vertex> verticesIter=graph.getVertices(GraphConfig.URI_PROPERTY,shortUri);
  for (  Vertex v : verticesIter)   vertices.add(v);
  if (vertices.size() == 0) {
    logger.warn("String_Node_Str",uri);
    return null;
  }
  if (vertices.size() > 1) {
    logger.warn("String_Node_Str",uri);
    for (    Vertex v : vertices) {
      int inDegree=vertexDegree(v,Direction.IN);
      int outDegree=vertexDegree(v,Direction.OUT);
      logger.warn("String_Node_Str",v.getId(),v.getProperty(GraphConfig.URI_PROPERTY),inDegree,outDegree);
    }
    logger.warn("String_Node_Str");
  }
  return vertices.get(0);
}

Fixed version (ground truth):
public static Vertex vertexByUri(Graph graph,String uri){
  String shortUri=UriShortener.shorten(uri);
  List<Vertex> vertices=new LinkedList<Vertex>();
  Iterable<Vertex> verticesIter=graph.getVertices(GraphConfig.URI_PROPERTY,shortUri);
  for (  Vertex v : verticesIter)   vertices.add(v);
  if (vertices.size() == 0) {
    return null;
  }
  if (vertices.size() > 1) {
    logger.warn("String_Node_Str",uri);
    for (    Vertex v : vertices) {
      int inDegree=vertexDegree(v,Direction.IN);
      int outDegree=vertexDegree(v,Direction.OUT);
      logger.warn("String_Node_Str",v.getId(),v.getProperty(GraphConfig.URI_PROPERTY),inDegree,outDegree);
    }
    logger.warn("String_Node_Str");
  }
  return vertices.get(0);
}