Program: 40078
Project: 40078
Buggy source:
/** 
 * Creates a repository with the given ID, label and optional override parameters.
 * @param repositoryId    a new repository ID
 * @param repositoryLabel a repository label, or null if none should be set
 * @param overrides       a map of repository creation parameters that override the defaults, or null if none should be overridden
 * @throws RDFParseException
 * @throws IOException
 * @throws RDFHandlerException
 * @throws GraphUtilException
 * @throws RepositoryConfigException
 * @throws RepositoryException
 */
public void createRepository(String repositoryId,String repositoryLabel,Map<String,String> overrides) throws RDFParseException, IOException, RDFHandlerException, RepositoryConfigException, RepositoryException {
  if (repositoryManager.hasRepositoryConfig(repositoryId)) {
    throw new RuntimeException("String_Node_Str" + repositoryId + "String_Node_Str");
  }
  TreeModel graph=new TreeModel();
  InputStream config=EmbeddedGraphDB.class.getResourceAsStream("String_Node_Str");
  RDFParser rdfParser=Rio.createParser(RDFFormat.TURTLE);
  rdfParser.setRDFHandler(new StatementCollector(graph));
  rdfParser.parse(config,RepositoryConfigSchema.NAMESPACE);
  config.close();
  Resource repositoryNode=Models.subject(graph.filter(null,RDF.TYPE,RepositoryConfigSchema.REPOSITORY)).orElse(null);
  graph.add(repositoryNode,RepositoryConfigSchema.REPOSITORYID,SimpleValueFactory.getInstance().createLiteral(repositoryId));
  if (repositoryLabel != null) {
    graph.add(repositoryNode,RDFS.LABEL,SimpleValueFactory.getInstance().createLiteral(repositoryLabel));
  }
  if (overrides != null) {
    Resource configNode=(Resource)Models.object(graph.filter(null,SailRepositorySchema.SAILIMPL,null)).orElse(null);
    for (    Map.Entry<String,String> e : overrides.entrySet()) {
      IRI key=SimpleValueFactory.getInstance().createIRI(OWLIMSailSchema.NAMESPACE + e.getKey());
      Literal value=SimpleValueFactory.getInstance().createLiteral(e.getValue());
      graph.remove(configNode,key,null);
      graph.add(configNode,key,value);
    }
  }
  RepositoryConfig repositoryConfig=RepositoryConfig.create(graph,repositoryNode);
  repositoryManager.addRepositoryConfig(repositoryConfig);
}

Fixed version (ground truth):
/** 
 * Creates a repository with the given ID, label and optional override parameters.
 * @param repositoryId a new repository ID
 * @param repositoryLabel a repository label, or null if none should be set
 * @param overrides a map of repository creation parameters that override the defaults, or null if none should be overridden
 * @throws RDFParseException
 * @throws IOException
 * @throws RDFHandlerException
 * @throws GraphUtilException
 * @throws RepositoryConfigException
 * @throws RepositoryException
 */
public void createRepository(String repositoryId,String repositoryLabel,Map<String,String> overrides) throws RDFParseException, IOException, RDFHandlerException, RepositoryConfigException, RepositoryException {
  if (repositoryManager.hasRepositoryConfig(repositoryId)) {
    repositoryManager.removeRepository(repositoryId);
  }
  TreeModel graph=new TreeModel();
  InputStream config=EmbeddedGraphDB.class.getResourceAsStream("String_Node_Str");
  RDFParser rdfParser=Rio.createParser(RDFFormat.TURTLE);
  rdfParser.setRDFHandler(new StatementCollector(graph));
  rdfParser.parse(config,RepositoryConfigSchema.NAMESPACE);
  config.close();
  Resource repositoryNode=Models.subject(graph.filter(null,RDF.TYPE,RepositoryConfigSchema.REPOSITORY)).orElse(null);
  graph.add(repositoryNode,RepositoryConfigSchema.REPOSITORYID,SimpleValueFactory.getInstance().createLiteral(repositoryId));
  if (repositoryLabel != null) {
    graph.add(repositoryNode,RDFS.LABEL,SimpleValueFactory.getInstance().createLiteral(repositoryLabel));
  }
  if (overrides != null) {
    Resource configNode=(Resource)Models.object(graph.filter(null,SailRepositorySchema.SAILIMPL,null)).orElse(null);
    for (    Map.Entry<String,String> e : overrides.entrySet()) {
      IRI key=SimpleValueFactory.getInstance().createIRI(OWLIMSailSchema.NAMESPACE + e.getKey());
      Literal value=SimpleValueFactory.getInstance().createLiteral(e.getValue());
      graph.remove(configNode,key,null);
      graph.add(configNode,key,value);
    }
  }
  RepositoryConfig repositoryConfig=RepositoryConfig.create(graph,repositoryNode);
  repositoryManager.addRepositoryConfig(repositoryConfig);
}