nus-yam/ex-repair huggingface dataset:
Program: 17584
Project: 17584
Buggy source:
/** 
 * <p>Getter for the field <code>testSource</code>.</p>
 * @return a  object.
 */
public TestSource getTestSource(){
  if (testSource != null) {
    Collection<SchemaSource> schemata=getAllSchemata();
    if (testSource.getReferencesSchemata().isEmpty() && !schemata.isEmpty()) {
      testSource=TestSourceFactory.createTestSource(testSource,schemata);
    }
    return testSource;
  }
  testSourceBuilder.setPrefixUri(prefix,datasetURI);
  testSourceBuilder.setReferenceSchemata(getAllSchemata());
  if (customDereferenceURI != null && "String_Node_Str".equals(customDereferenceURI)) {
    testSourceBuilder.setInMemFromPipe();
  }
  if (getEndpointURI() == null || getEndpointURI().isEmpty()) {
    String tmp_customDereferenceURI=datasetURI;
    if (customDereferenceURI != null && !customDereferenceURI.isEmpty()) {
      tmp_customDereferenceURI=customDereferenceURI;
    }
    testSourceBuilder.setInMemReader(RDFReaderFactory.createDereferenceReader(tmp_customDereferenceURI));
  }
  if (this.endpointQueryCacheTTL != -1)   testSourceBuilder.setCacheTTL(this.endpointQueryCacheTTL);
  if (this.endpointQueryDelayMS != -1)   testSourceBuilder.setQueryDelay(this.endpointQueryDelayMS);
  if (this.endpointQueryPagination != -1)   testSourceBuilder.setPagination(this.endpointQueryPagination);
  if (this.endpointQueryLimit != -1)   testSourceBuilder.setQueryLimit(this.endpointQueryLimit);
  testSource=testSourceBuilder.build();
  return testSource;
}

Fixed version (ground truth):
/** 
 * <p>Getter for the field <code>testSource</code>.</p>
 * @return a  object.
 */
public TestSource getTestSource(){
  if (testSource != null) {
    Collection<SchemaSource> schemata=getAllSchemata();
    if (testSource.getReferencesSchemata().isEmpty() && !schemata.isEmpty()) {
      testSource=TestSourceFactory.createTestSource(testSource,schemata);
    }
    return testSource;
  }
  testSourceBuilder.setPrefixUri(prefix,datasetURI);
  testSourceBuilder.setReferenceSchemata(getAllSchemata());
  if (customDereferenceURI != null && "String_Node_Str".equals(customDereferenceURI)) {
    testSourceBuilder.setInMemFromPipe();
  }
  if (getEndpointURI() == null || getEndpointURI().isEmpty()) {
    String tmp_customDereferenceURI=datasetURI;
    if (customDereferenceURI != null && !customDereferenceURI.isEmpty()) {
      tmp_customDereferenceURI=customDereferenceURI;
    }
    if (testSourceBuilder.getInMemReader() == null) {
      testSourceBuilder.setInMemReader(RDFReaderFactory.createDereferenceReader(tmp_customDereferenceURI));
    }
  }
  if (this.endpointQueryCacheTTL > 0)   testSourceBuilder.setCacheTTL(this.endpointQueryCacheTTL);
  if (this.endpointQueryDelayMS > 0)   testSourceBuilder.setQueryDelay(this.endpointQueryDelayMS);
  if (this.endpointQueryPagination > 0)   testSourceBuilder.setPagination(this.endpointQueryPagination);
  if (this.endpointQueryLimit > 0)   testSourceBuilder.setQueryLimit(this.endpointQueryLimit);
  testSource=testSourceBuilder.build();
  return testSource;
}
Program: 17585
Project: 17585
Buggy source:
/** 
 * <p>setInMemFromCustomText.</p>
 * @param customTextSource a {@link java.lang.String} object.
 * @param customTextFormat a {@link java.lang.String} object.
 * @return a {@link org.aksw.rdfunit.sources.TestSourceBuilder} object.
 * @throws org.aksw.rdfunit.exceptions.UndefinedSerializationException if any.
 */
public TestSourceBuilder setInMemFromCustomText(String customTextSource,String customTextFormat) throws UndefinedSerializationException {
  SerializationFormat format=FormatService.getInputFormat(customTextFormat);
  if (format == null) {
    throw new UndefinedSerializationException(customTextFormat);
  }
  this.inMemReader=RDFReaderFactory.createReaderFromText(customTextSource,format.getName());
  return this;
}

Fixed version (ground truth):
/** 
 * <p>setInMemFromCustomText.</p>
 * @param customTextSource a {@link java.lang.String} object.
 * @param customTextFormat a {@link java.lang.String} object.
 * @return a {@link org.aksw.rdfunit.sources.TestSourceBuilder} object.
 * @throws org.aksw.rdfunit.exceptions.UndefinedSerializationException if any.
 */
public TestSourceBuilder setInMemFromCustomText(String customTextSource,String customTextFormat) throws UndefinedSerializationException {
  SerializationFormat format=FormatService.getInputFormat(customTextFormat);
  if (format == null) {
    throw new UndefinedSerializationException(customTextFormat);
  }
  this.inMemReader=RDFReaderFactory.createReaderFromText(customTextSource,format.getName());
  if (queryingConfig == null) {
    queryingConfig=QueryingConfig.createInMemory();
  }
  return this;
}
Program: 17586
Project: 17586
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public Collection<ResultAnnotation> getBindedAnnotations(Collection<Binding> bindings){
  Collection<ResultAnnotation> finalAnnotations=new ArrayList<>();
  for (  ResultAnnotation externalAnnotation : annotations) {
    ResultAnnotation sanitizedAnnotation=externalAnnotation;
    if (externalAnnotation.getAnnotationValue().isPresent() && externalAnnotation.getAnnotationValue().get().isLiteral()) {
      String value=externalAnnotation.getAnnotationValue().get().toString();
      for (      Binding binding : bindings) {
        if (value.equals("String_Node_Str" + binding.getParameterId() + "String_Node_Str")) {
          sanitizedAnnotation=new ResultAnnotationImpl.Builder(externalAnnotation.getAnnotationProperty()).setValueRDFUnit(binding.getValue()).build();
        }
      }
    }
    finalAnnotations.add(sanitizedAnnotation);
  }
  return finalAnnotations;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Collection<ResultAnnotation> getBindedAnnotations(Collection<Binding> bindings){
  Collection<ResultAnnotation> finalAnnotations=new ArrayList<>();
  for (  ResultAnnotation externalAnnotation : annotations) {
    ResultAnnotation sanitizedAnnotation=externalAnnotation;
    if (externalAnnotation.getAnnotationValue().isPresent() && externalAnnotation.getAnnotationValue().get().isLiteral()) {
      String value=externalAnnotation.getAnnotationValue().get().toString();
      for (      Binding binding : bindings) {
        if (value.equals("String_Node_Str" + binding.getParameterId() + "String_Node_Str")) {
          sanitizedAnnotation=new ResultAnnotationImpl.Builder(externalAnnotation.getResource().get(),externalAnnotation.getAnnotationProperty()).setValueRDFUnit(binding.getValue()).build();
        }
      }
    }
    finalAnnotations.add(sanitizedAnnotation);
  }
  return finalAnnotations;
}
Program: 17587
Project: 17587
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public PatternParameter read(Resource resource){
  checkNotNull(resource);
  PatternParameterImpl.Builder parameterBuilder=new PatternParameterImpl.Builder();
  parameterBuilder.setElement(resource);
  for (  Statement smt : resource.listProperties(DCTerms.identifier).toList()) {
    parameterBuilder.setID(smt.getObject().asLiteral().getLexicalForm());
  }
  for (  Statement smt : resource.listProperties(RDFUNITv.parameterConstraint).toList()) {
    parameterBuilder.setPatternParameterConstraints(smt.getObject().asResource().getURI());
  }
  for (  Statement smt : resource.listProperties(SHACL.defaultValue).toList()) {
    parameterBuilder.setContraintPattern(smt.getObject().asLiteral().getLexicalForm());
  }
  return parameterBuilder.build();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public PatternParameter read(Resource resource){
  checkNotNull(resource);
  PatternParameterImpl.Builder parameterBuilder=new PatternParameterImpl.Builder();
  parameterBuilder.setElement(resource);
  for (  Statement smt : resource.listProperties(DCTerms.identifier).toList()) {
    parameterBuilder.setID(smt.getObject().asLiteral().getLexicalForm());
  }
  for (  Statement smt : resource.listProperties(RDFUNITv.parameterConstraint).toList()) {
    parameterBuilder.setPatternParameterConstraints(smt.getObject().asResource().getURI());
  }
  for (  Statement smt : resource.listProperties(RDFUNITv.constraintPattern).toList()) {
    parameterBuilder.setContraintPattern(smt.getObject().asLiteral().getLexicalForm());
  }
  return parameterBuilder.build();
}
Program: 17589
Project: 17589
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public ResultAnnotation read(Resource resource){
  checkNotNull(resource);
  ResultAnnotationImpl.Builder resultAnBuilder=null;
  int count=0;
  for (  Statement smt : resource.listProperties(propertyP).toList()) {
    checkArgument(++count == 1,"String_Node_Str",resource.getURI(),smt.getObject().toString());
    resultAnBuilder=new ResultAnnotationImpl.Builder(ResourceFactory.createProperty(smt.getObject().asResource().getURI()));
  }
  checkNotNull(resultAnBuilder);
  count=0;
  for (  Statement smt : resource.listProperties(valueP).toList()) {
    checkArgument(++count == 1,"String_Node_Str",resource.getURI(),smt.getObject().toString());
    RDFNode value=smt.getObject();
    if (!valueP.getNameSpace().equals(RDFUNITv.namespace) || !value.toString().startsWith("String_Node_Str")) {
      resultAnBuilder.setValue(value);
    }
  }
  count=0;
  for (  Statement smt : resource.listProperties(varNameP).toList()) {
    checkArgument(++count == 1,"String_Node_Str",resource.getURI(),smt.getObject().toString());
    String varName=smt.getObject().toString();
    if (!valueP.getNameSpace().equals(RDFUNITv.namespace) || varName.startsWith("String_Node_Str")) {
      resultAnBuilder.setVariableName(varName.startsWith("String_Node_Str") ? varName.substring(1) : varName);
    }
  }
  return resultAnBuilder.build();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public ResultAnnotation read(Resource resource){
  checkNotNull(resource);
  ResultAnnotationImpl.Builder resultAnBuilder=null;
  int count=0;
  for (  Statement smt : resource.listProperties(propertyP).toList()) {
    checkArgument(++count == 1,"String_Node_Str",resource.getURI(),smt.getObject().toString());
    resultAnBuilder=new ResultAnnotationImpl.Builder(smt.getSubject(),ResourceFactory.createProperty(smt.getObject().asResource().getURI()));
  }
  checkNotNull(resultAnBuilder);
  count=0;
  for (  Statement smt : resource.listProperties(valueP).toList()) {
    checkArgument(++count == 1,"String_Node_Str",resource.getURI(),smt.getObject().toString());
    RDFNode value=smt.getObject();
    if (!valueP.getNameSpace().equals(RDFUNITv.namespace) || !value.toString().startsWith("String_Node_Str")) {
      resultAnBuilder.setValue(value);
    }
  }
  count=0;
  for (  Statement smt : resource.listProperties(varNameP).toList()) {
    checkArgument(++count == 1,"String_Node_Str",resource.getURI(),smt.getObject().toString());
    String varName=smt.getObject().toString();
    if (!valueP.getNameSpace().equals(RDFUNITv.namespace) || varName.startsWith("String_Node_Str")) {
      resultAnBuilder.setVariableName(varName.startsWith("String_Node_Str") ? varName.substring(1) : varName);
    }
  }
  return resultAnBuilder.build();
}
Program: 17590
Project: 17590
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override protected void collectInitializationErrors(List<Throwable> errors){
  super.collectInitializationErrors(errors);
  verifySchemaAnnotation(errors);
  verifyTestInputAnnotatedMethods(errors);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override protected void collectInitializationErrors(List<Throwable> errors){
  super.collectInitializationErrors(errors);
  verifySchemaAnnotation(errors);
  verifyTestInputAnnotatedMethods(errors);
  verifyAtMostOneAdditionalDataMethodWithMatchingReturnType(errors);
}
Program: 17591
Project: 17591
Buggy source:
/** 
 * <p>write.</p>
 * @return a {@link com.hp.hpl.jena.rdf.model.Resource} object.
 */
Resource write(Model model);

Fixed version (ground truth):
/** 
 * <p>write.</p>
 * @return a {@link com.hp.hpl.jena.rdf.model.Resource} object.
 * @param model a {@link com.hp.hpl.jena.rdf.model.Model} object.
 */
Resource write(Model model);
Program: 17592
Project: 17592
Buggy source:
public static Resource copyElementResourceInModel(Element element,Model model){
  if (element.getResource().isPresent() && !element.getResource().get().isAnon()) {
    return model.createResource(element.getResource().get().getURI());
  }
 else {
    return model.createResource();
  }
}

Fixed version (ground truth):
/** 
 * <p>copyElementResourceInModel.</p>
 * @param element a {@link org.aksw.rdfunit.elements.interfaces.Element} object.
 * @param model a {@link com.hp.hpl.jena.rdf.model.Model} object.
 * @return a {@link com.hp.hpl.jena.rdf.model.Resource} object.
 */
public static Resource copyElementResourceInModel(Element element,Model model){
  if (element.getResource().isPresent() && !element.getResource().get().isAnon()) {
    return model.createResource(element.getResource().get().getURI());
  }
 else {
    return model.createResource();
  }
}
Program: 17593
Project: 17593
Buggy source:
@Override public Optional<Resource> getResource(){
  return Optional.fromNullable(element);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<Resource> getResource(){
  return Optional.fromNullable(element);
}
Program: 17594
Project: 17594
Buggy source:
@Override public Optional<ValueKind> getValueKind(){
  return Optional.fromNullable(valueKind);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<ValueKind> getValueKind(){
  return Optional.fromNullable(valueKind);
}
Program: 17595
Project: 17595
Buggy source:
@Override public boolean isOptional(){
  return isOptional;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public boolean isOptional(){
  return isOptional;
}
Program: 17596
Project: 17596
Buggy source:
@Override public Optional<RDFNode> getDefaultValue(){
  return Optional.fromNullable(defaultValue);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<RDFNode> getDefaultValue(){
  return Optional.fromNullable(defaultValue);
}
Program: 17597
Project: 17597
Buggy source:
@Override public RDFNode getPredicate(){
  return predicate;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public RDFNode getPredicate(){
  return predicate;
}
Program: 17598
Project: 17598
Buggy source:
@Override public int hashCode(){
  return Objects.hashCode(element,predicate,comment,valueType,valueKind,defaultValue,isOptional);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public int hashCode(){
  return Objects.hashCode(element,predicate,comment,valueType,valueKind,defaultValue,isOptional);
}
Program: 17599
Project: 17599
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  final ArgumentImpl other=(ArgumentImpl)obj;
  return Objects.equal(this.element,other.element) && Objects.equal(this.predicate,other.predicate) && Objects.equal(this.comment,other.comment)&& Objects.equal(this.valueType,other.valueType)&& Objects.equal(this.valueKind,other.valueKind)&& Objects.equal(this.defaultValue,other.defaultValue)&& Objects.equal(this.isOptional,other.isOptional);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  final ArgumentImpl other=(ArgumentImpl)obj;
  return Objects.equal(this.element,other.element) && Objects.equal(this.predicate,other.predicate) && Objects.equal(this.comment,other.comment)&& Objects.equal(this.valueType,other.valueType)&& Objects.equal(this.valueKind,other.valueKind)&& Objects.equal(this.defaultValue,other.defaultValue)&& Objects.equal(this.isOptional,other.isOptional);
}
Program: 17600
Project: 17600
Buggy source:
@Override public String getComment(){
  return comment;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getComment(){
  return comment;
}
Program: 17601
Project: 17601
Buggy source:
@Override public Optional<Resource> getValueType(){
  return Optional.fromNullable(valueType);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<Resource> getValueType(){
  return Optional.fromNullable(valueType);
}
Program: 17602
Project: 17602
Buggy source:
@Override public Optional<Resource> getResource(){
  return Optional.fromNullable(element);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<Resource> getResource(){
  return Optional.fromNullable(element);
}
Program: 17603
Project: 17603
Buggy source:
@Override public String getSparqlString(){
  return sparqlString;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getSparqlString(){
  return sparqlString;
}
Program: 17604
Project: 17604
Buggy source:
@Override public Optional<Resource> getReturnType(){
  return Optional.fromNullable(returnType);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<Resource> getReturnType(){
  return Optional.fromNullable(returnType);
}
Program: 17605
Project: 17605
Buggy source:
@Override public int hashCode(){
  return Objects.hashCode(comment,isCachable,superFunction,arguments,sparqlString,returnType);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public int hashCode(){
  return Objects.hashCode(comment,isCachable,superFunction,arguments,sparqlString,returnType);
}
Program: 17606
Project: 17606
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  final FunctionImpl other=(FunctionImpl)obj;
  return Objects.equal(this.comment,other.comment) && Objects.equal(this.isCachable,other.isCachable) && Objects.equal(this.superFunction,other.superFunction)&& Objects.equal(this.arguments,other.arguments)&& Objects.equal(this.sparqlString,other.sparqlString)&& Objects.equal(this.returnType,other.returnType);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  final FunctionImpl other=(FunctionImpl)obj;
  return Objects.equal(this.comment,other.comment) && Objects.equal(this.isCachable,other.isCachable) && Objects.equal(this.superFunction,other.superFunction)&& Objects.equal(this.arguments,other.arguments)&& Objects.equal(this.sparqlString,other.sparqlString)&& Objects.equal(this.returnType,other.returnType);
}
Program: 17607
Project: 17607
Buggy source:
@Override public boolean isCachable(){
  return isCachable;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public boolean isCachable(){
  return isCachable;
}
Program: 17608
Project: 17608
Buggy source:
@Override public List<Argument> getArguments(){
  return arguments;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public List<Argument> getArguments(){
  return arguments;
}
Program: 17609
Project: 17609
Buggy source:
@Override public String getComment(){
  return comment;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getComment(){
  return comment;
}
Program: 17610
Project: 17610
Buggy source:
@Override public Optional<Resource> getResource(){
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<Resource> getResource(){
  return null;
}
Program: 17611
Project: 17611
Buggy source:
@Override public String getIRI(){
  return element.getURI();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getIRI(){
  return element.getURI();
}
Program: 17612
Project: 17612
Buggy source:
@Override public boolean isValid(){
  if (getParameters() == null || getParameters().isEmpty()) {
    return false;
  }
  for (  PatternParameter p : getParameters()) {
    if (!getSparqlWherePattern().contains("String_Node_Str" + p.getId() + "String_Node_Str")) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public boolean isValid(){
  if (getParameters() == null || getParameters().isEmpty()) {
    return false;
  }
  for (  PatternParameter p : getParameters()) {
    if (!getSparqlWherePattern().contains("String_Node_Str" + p.getId() + "String_Node_Str")) {
      return false;
    }
  }
  return true;
}
Program: 17613
Project: 17613
Buggy source:
@Override public String getSparqlWherePattern(){
  return sparqlWherePattern;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getSparqlWherePattern(){
  return sparqlWherePattern;
}
Program: 17614
Project: 17614
Buggy source:
@Override public Optional<String> getSparqlPatternPrevalence(){
  return Optional.fromNullable(sparqlPatternPrevalence);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<String> getSparqlPatternPrevalence(){
  return Optional.fromNullable(sparqlPatternPrevalence);
}
Program: 17615
Project: 17615
Buggy source:
@Override public String getId(){
  return id;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getId(){
  return id;
}
Program: 17616
Project: 17616
Buggy source:
@Override public String getDescription(){
  return description;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getDescription(){
  return description;
}
Program: 17617
Project: 17617
Buggy source:
@Override public Collection<ResultAnnotation> getBindedAnnotations(Collection<Binding> bindings){
  Collection<ResultAnnotation> finalAnnotations=new ArrayList<>();
  for (  ResultAnnotation externalAnnotation : annotations) {
    ResultAnnotation sanitizedAnnotation=externalAnnotation;
    if (externalAnnotation.getAnnotationValue().isPresent() && externalAnnotation.getAnnotationValue().get().isLiteral()) {
      String value=externalAnnotation.getAnnotationValue().get().toString();
      for (      Binding binding : bindings) {
        if (value.equals("String_Node_Str" + binding.getParameterId() + "String_Node_Str")) {
          sanitizedAnnotation=new ResultAnnotationImpl.Builder(externalAnnotation.getAnnotationProperty()).setValueRDFUnit(binding.getValue()).build();
        }
      }
    }
    finalAnnotations.add(sanitizedAnnotation);
  }
  return finalAnnotations;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Collection<ResultAnnotation> getBindedAnnotations(Collection<Binding> bindings){
  Collection<ResultAnnotation> finalAnnotations=new ArrayList<>();
  for (  ResultAnnotation externalAnnotation : annotations) {
    ResultAnnotation sanitizedAnnotation=externalAnnotation;
    if (externalAnnotation.getAnnotationValue().isPresent() && externalAnnotation.getAnnotationValue().get().isLiteral()) {
      String value=externalAnnotation.getAnnotationValue().get().toString();
      for (      Binding binding : bindings) {
        if (value.equals("String_Node_Str" + binding.getParameterId() + "String_Node_Str")) {
          sanitizedAnnotation=new ResultAnnotationImpl.Builder(externalAnnotation.getAnnotationProperty()).setValueRDFUnit(binding.getValue()).build();
        }
      }
    }
    finalAnnotations.add(sanitizedAnnotation);
  }
  return finalAnnotations;
}
Program: 17618
Project: 17618
Buggy source:
@Override public Collection<PatternParameter> getParameters(){
  return Collections.unmodifiableCollection(parameters);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Collection<PatternParameter> getParameters(){
  return Collections.unmodifiableCollection(parameters);
}
Program: 17619
Project: 17619
Buggy source:
@Override public Optional<PatternParameter> getParameter(String parameterURI){
  for (  PatternParameter parameter : parameters) {
    if (parameter.getUri().equals(parameterURI)) {
      return Optional.of(parameter);
    }
  }
  return Optional.absent();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<PatternParameter> getParameter(String parameterURI){
  for (  PatternParameter parameter : parameters) {
    if (parameter.getUri().equals(parameterURI)) {
      return Optional.of(parameter);
    }
  }
  return Optional.absent();
}
Program: 17620
Project: 17620
Buggy source:
@Override public int hashCode(){
  return Objects.hashCode(element,id,constraint,constraintPattern);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public int hashCode(){
  return Objects.hashCode(element,id,constraint,constraintPattern);
}
Program: 17621
Project: 17621
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  final PatternParameterImpl other=(PatternParameterImpl)obj;
  return Objects.equal(this.element,other.element) && Objects.equal(this.id,other.id) && Objects.equal(this.constraint,other.constraint)&& Objects.equal(this.constraintPattern,other.constraintPattern);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  final PatternParameterImpl other=(PatternParameterImpl)obj;
  return Objects.equal(this.element,other.element) && Objects.equal(this.id,other.id) && Objects.equal(this.constraint,other.constraint)&& Objects.equal(this.constraintPattern,other.constraintPattern);
}
Program: 17622
Project: 17622
Buggy source:
@Override public Optional<Resource> getResource(){
  return Optional.fromNullable(element);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<Resource> getResource(){
  return Optional.fromNullable(element);
}
Program: 17623
Project: 17623
Buggy source:
@Override public Property getAnnotationProperty(){
  return property;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Property getAnnotationProperty(){
  return property;
}
Program: 17624
Project: 17624
Buggy source:
@Override public Optional<RDFNode> getAnnotationValue(){
  return Optional.fromNullable(value);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<RDFNode> getAnnotationValue(){
  return Optional.fromNullable(value);
}
Program: 17625
Project: 17625
Buggy source:
@Override public int hashCode(){
  return Objects.hashCode(property,value,variableName);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public int hashCode(){
  return Objects.hashCode(property,value,variableName);
}
Program: 17626
Project: 17626
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  final ResultAnnotationImpl other=(ResultAnnotationImpl)obj;
  return Objects.equal(this.property,other.property) && Objects.equal(this.value,other.value) && Objects.equal(this.variableName,other.variableName);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public boolean equals(Object obj){
  if (this == obj) {
    return true;
  }
  if (obj == null || getClass() != obj.getClass()) {
    return false;
  }
  final ResultAnnotationImpl other=(ResultAnnotationImpl)obj;
  return Objects.equal(this.property,other.property) && Objects.equal(this.value,other.value) && Objects.equal(this.variableName,other.variableName);
}
Program: 17627
Project: 17627
Buggy source:
@Override public Optional<String> getAnnotationVarName(){
  return Optional.fromNullable(variableName);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<String> getAnnotationVarName(){
  return Optional.fromNullable(variableName);
}
Program: 17628
Project: 17628
Buggy source:
@Override public Pattern getTAGPattern(){
  return pattern;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Pattern getTAGPattern(){
  return pattern;
}
Program: 17629
Project: 17629
Buggy source:
@Override public Optional<Resource> getResource(){
  return Optional.fromNullable(element);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public Optional<Resource> getResource(){
  return Optional.fromNullable(element);
}
Program: 17630
Project: 17630
Buggy source:
public static TestGenerator createTAG(Resource element,String description,String query,Pattern pattern,Collection<ResultAnnotation> generatorAnnotations){
  return new TestGeneratorImpl(element,description,query,pattern,generatorAnnotations);
}

Fixed version (ground truth):
/** 
 * <p>createTAG.</p>
 * @param element a {@link com.hp.hpl.jena.rdf.model.Resource} object.
 * @param description a {@link java.lang.String} object.
 * @param query a {@link java.lang.String} object.
 * @param pattern a {@link org.aksw.rdfunit.elements.interfaces.Pattern} object.
 * @param generatorAnnotations a {@link java.util.Collection} object.
 * @return a {@link org.aksw.rdfunit.elements.interfaces.TestGenerator} object.
 */
public static TestGenerator createTAG(Resource element,String description,String query,Pattern pattern,Collection<ResultAnnotation> generatorAnnotations){
  return new TestGeneratorImpl(element,description,query,pattern,generatorAnnotations);
}
Program: 17631
Project: 17631
Buggy source:
@Override public String getTAGUri(){
  return element.getURI();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getTAGUri(){
  return element.getURI();
}
Program: 17632
Project: 17632
Buggy source:
@Override public boolean isValid(){
  Query q;
  if (pattern == null) {
    log.error("String_Node_Str",getTAGUri(),getTAGPattern());
    return false;
  }
  try {
    q=QueryFactory.create(PrefixNSService.getSparqlPrefixDecl() + getTAGQuery());
  }
 catch (  Exception e) {
    log.error("String_Node_Str",getTAGUri(),PrefixNSService.getSparqlPrefixDecl() + getTAGQuery(),e);
    return false;
  }
  Collection<Var> sv=q.getProjectVars();
  if (sv.size() != pattern.getParameters().size() + 1) {
    log.error("String_Node_Str",getTAGUri());
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public boolean isValid(){
  Query q;
  if (pattern == null) {
    log.error("String_Node_Str",getTAGUri(),getTAGPattern());
    return false;
  }
  try {
    q=QueryFactory.create(PrefixNSService.getSparqlPrefixDecl() + getTAGQuery());
  }
 catch (  Exception e) {
    log.error("String_Node_Str",getTAGUri(),PrefixNSService.getSparqlPrefixDecl() + getTAGQuery(),e);
    return false;
  }
  Collection<Var> sv=q.getProjectVars();
  if (sv.size() != pattern.getParameters().size() + 1) {
    log.error("String_Node_Str",getTAGUri());
    return false;
  }
  return true;
}
Program: 17633
Project: 17633
Buggy source:
@Override public String getTAGDescription(){
  return description;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getTAGDescription(){
  return description;
}
Program: 17635
Project: 17635
Buggy source:
@Override public String getTAGQuery(){
  return query;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public String getTAGQuery(){
  return query;
}
Program: 17636
Project: 17636
Buggy source:
Optional<Resource> getReturnType();

Fixed version (ground truth):
/** 
 * <p>getReturnType.</p>
 * @return a {@link com.google.common.base.Optional} object.
 */
Optional<Resource> getReturnType();
Program: 17637
Project: 17637
Buggy source:
boolean isCachable();

Fixed version (ground truth):
/** 
 * <p>isCachable.</p>
 * @return a boolean.
 */
boolean isCachable();
Program: 17638
Project: 17638
Buggy source:
List<Argument> getArguments();

Fixed version (ground truth):
/** 
 * <p>getArguments.</p>
 * @return a {@link java.util.List} object.
 */
List<Argument> getArguments();
Program: 17639
Project: 17639
Buggy source:
String getComment();

Fixed version (ground truth):
/** 
 * <p>getComment.</p>
 * @return a {@link java.lang.String} object.
 */
String getComment();
Program: 17640
Project: 17640
Buggy source:
String getSparqlString();

Fixed version (ground truth):
/** 
 * <p>getSparqlString.</p>
 * @return a {@link java.lang.String} object.
 */
String getSparqlString();
Program: 17641
Project: 17641
Buggy source:
@Before public void setUp() throws Exception {
  RDFUnitStaticWrapper.initWrapper("String_Node_Str",emptyResource);
  RDFUnit rdfunit=new RDFUnit();
  try {
    rdfunit.init();
  }
 catch (  RDFReaderException e) {
    fail("String_Node_Str");
  }
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  String emptyResource="String_Node_Str";
  RDFUnitStaticWrapper.initWrapper("String_Node_Str",emptyResource);
  RDFUnit rdfunit=new RDFUnit();
  try {
    rdfunit.init();
  }
 catch (  RDFReaderException e) {
    fail("String_Node_Str");
  }
}
Program: 17642
Project: 17642
Buggy source:
/** 
 * <p>Getter for the field <code>testSource</code>.</p>
 * @return a  object.
 */
public TestSource getTestSource(){
  if (testSource != null) {
    Collection<SchemaSource> schemata=getAllSchemata();
    if (testSource.getReferencesSchemata().isEmpty() && !schemata.isEmpty()) {
      testSource=TestSourceFactory.createTestSource(testSource,schemata);
    }
    return testSource;
  }
  testSourceBuilder.setPrefixUri(prefix,datasetURI);
  testSourceBuilder.setReferenceSchemata(getAllSchemata());
  if (customDereferenceURI != null && "String_Node_Str".equals(customDereferenceURI)) {
    testSourceBuilder.setInMemFromPipe();
  }
  if (this.endpointQueryCacheTTL != -1)   testSourceBuilder.setCacheTTL(this.endpointQueryCacheTTL);
  if (this.endpointQueryDelayMS != -1)   testSourceBuilder.setQueryDelay(this.endpointQueryDelayMS);
  if (this.endpointQueryPagination != -1)   testSourceBuilder.setPagination(this.endpointQueryPagination);
  if (this.endpointQueryLimit != -1)   testSourceBuilder.setQueryLimit(this.endpointQueryLimit);
  testSource=testSourceBuilder.build();
  return testSource;
}

Fixed version (ground truth):
/** 
 * <p>Getter for the field <code>testSource</code>.</p>
 * @return a  object.
 */
public TestSource getTestSource(){
  if (testSource != null) {
    Collection<SchemaSource> schemata=getAllSchemata();
    if (testSource.getReferencesSchemata().isEmpty() && !schemata.isEmpty()) {
      testSource=TestSourceFactory.createTestSource(testSource,schemata);
    }
    return testSource;
  }
  testSourceBuilder.setPrefixUri(prefix,datasetURI);
  testSourceBuilder.setReferenceSchemata(getAllSchemata());
  if (customDereferenceURI != null && "String_Node_Str".equals(customDereferenceURI)) {
    testSourceBuilder.setInMemFromPipe();
  }
  if (getEndpointURI() == null || getEndpointURI().isEmpty()) {
    String tmp_customDereferenceURI=datasetURI;
    if (customDereferenceURI != null && !customDereferenceURI.isEmpty()) {
      tmp_customDereferenceURI=customDereferenceURI;
    }
    testSourceBuilder.setInMemReader(RDFReaderFactory.createDereferenceReader(tmp_customDereferenceURI));
  }
  if (this.endpointQueryCacheTTL != -1)   testSourceBuilder.setCacheTTL(this.endpointQueryCacheTTL);
  if (this.endpointQueryDelayMS != -1)   testSourceBuilder.setQueryDelay(this.endpointQueryDelayMS);
  if (this.endpointQueryPagination != -1)   testSourceBuilder.setPagination(this.endpointQueryPagination);
  if (this.endpointQueryLimit != -1)   testSourceBuilder.setQueryLimit(this.endpointQueryLimit);
  testSource=testSourceBuilder.build();
  return testSource;
}
Program: 17643
Project: 17643
Buggy source:
public TestSourceBuilder setInMemReader(RDFReader reader){
  this.inMemReader=reader;
  return this;
}

Fixed version (ground truth):
public TestSourceBuilder setInMemReader(RDFReader reader){
  this.inMemReader=reader;
  if (queryingConfig == null) {
    queryingConfig=QueryingConfig.createInMemory();
  }
  return this;
}
Program: 17644
Project: 17644
Buggy source:
public TestSource build(){
  checkNotNull(sourceConfig);
  checkNotNull(referenceSchemata);
  checkNotNull(queryingConfig);
  if (testSourceType.equals(TestSourceType.Endpoint)) {
    checkNotNull(sparqlEndpoint);
    checkNotNull(endpointGraphs);
    return new EndpointTestSource(sourceConfig,queryingConfig,referenceSchemata,sparqlEndpoint,endpointGraphs);
  }
  checkNotNull(inMemReader);
  if (testSourceType.equals(TestSourceType.InMemSingle)) {
    return new DumpTestSource(sourceConfig,queryingConfig,referenceSchemata,inMemReader);
  }
  if (testSourceType.equals(TestSourceType.InMemDataset)) {
    return new DatasetTestSource(sourceConfig,queryingConfig,referenceSchemata,inMemReader);
  }
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
public TestSource build(){
  checkNotNull(sourceConfig);
  checkNotNull(referenceSchemata,"String_Node_Str");
  if (testSourceType.equals(TestSourceType.Endpoint)) {
    if (queryingConfig == null) {
      queryingConfig=QueryingConfig.createEndpoint();
    }
    checkNotNull(sparqlEndpoint);
    checkNotNull(endpointGraphs);
    return new EndpointTestSource(sourceConfig,queryingConfig,referenceSchemata,sparqlEndpoint,endpointGraphs);
  }
  if (queryingConfig == null) {
    queryingConfig=QueryingConfig.createEndpoint();
  }
  checkNotNull(inMemReader);
  if (testSourceType.equals(TestSourceType.InMemSingle)) {
    return new DumpTestSource(sourceConfig,queryingConfig,referenceSchemata,inMemReader);
  }
  if (testSourceType.equals(TestSourceType.InMemDataset)) {
    return new DatasetTestSource(sourceConfig,queryingConfig,referenceSchemata,inMemReader);
  }
  throw new IllegalStateException("String_Node_Str");
}
Program: 17645
Project: 17645
Buggy source:
public TestSourceBuilder setInMemFromPipe(){
  this.inMemReader=new RDFStreamReader(new BufferedInputStream(System.in),"String_Node_Str");
  return this;
}

Fixed version (ground truth):
public TestSourceBuilder setInMemFromPipe(){
  this.inMemReader=new RDFStreamReader(new BufferedInputStream(System.in),"String_Node_Str");
  setImMemSingle();
  return this;
}
Program: 17646
Project: 17646
Buggy source:
@Override public String getSparqlQueryAsString(TestCase testCase){
  return PrefixNSService.getSparqlPrefixDecl() + "String_Node_Str" + testCase.getSparqlWhere();
}

Fixed version (ground truth):
@Override public String getSparqlQueryAsString(TestCase testCase){
  return getSparqlQuery(testCase).toString();
}
Program: 17647
Project: 17647
Buggy source:
@Override public Query getSparqlQuery(TestCase testCase){
  return QueryFactory.create(getSparqlQueryAsString(testCase));
}

Fixed version (ground truth):
@Override public Query getSparqlQuery(TestCase testCase){
  Query query=QueryFactory.create(PrefixNSService.getSparqlPrefixDecl() + "String_Node_Str" + testCase.getSparqlWhere());
  if (!query.hasHaving()) {
    return query;
  }
  query=QueryFactory.create(PrefixNSService.getSparqlPrefixDecl() + "String_Node_Str" + "String_Node_Str"+ testCase.getSparqlWhere()+ "String_Node_Str");
  return query;
}
Program: 17648
Project: 17648
Buggy source:
public static void fillSchemaServiceFromLOV(){
  Source lov=new EndpointTestSource("String_Node_Str","String_Node_Str","String_Node_Str",new ArrayList<String>(),null);
  QueryExecution qe=null;
  int count=0;
  try {
    qe=lov.getExecutionFactory().createQueryExecution("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    ResultSet rs=qe.execSelect();
    while (rs.hasNext()) {
      QuerySolution row=rs.next();
      String prefix=row.get("String_Node_Str").toString();
      String vocab=row.get("String_Node_Str").toString();
      SchemaService.addSchemaDecl(prefix,vocab);
      count++;
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (qe != null) {
      qe.close();
    }
  }
  log.info("String_Node_Str" + count + "String_Node_Str");
}

Fixed version (ground truth):
public static void fillSchemaServiceFromLOV(){
  Source lov=new EndpointTestSource("String_Node_Str","String_Node_Str","String_Node_Str",new ArrayList<String>(),null);
  QueryExecution qe=null;
  int count=0;
  try {
    qe=lov.getExecutionFactory().createQueryExecution("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str"+ "String_Node_Str");
    ResultSet rs=qe.execSelect();
    while (rs.hasNext()) {
      QuerySolution row=rs.next();
      String prefix=row.get("String_Node_Str").toString();
      String vocab=row.get("String_Node_Str").toString();
      String ns=row.get("String_Node_Str").toString();
      if (ns == null || ns.isEmpty()) {
        ns=vocab;
      }
      SchemaService.addSchemaDecl(prefix,ns);
      count++;
    }
  }
 catch (  Exception e) {
  }
 finally {
    if (qe != null) {
      qe.close();
    }
  }
  log.info("String_Node_Str" + count + "String_Node_Str");
}
Program: 17649
Project: 17649
Buggy source:
public Source getTestSource(){
  if (endpointURI != null && !endpointURI.isEmpty()) {
    EndpointTestSource endpointSource=new EndpointTestSource(CacheUtils.getAutoPrefixForURI(datasetURI),datasetURI,endpointURI,endpointGraphs,getAllSchemata());
    endpointSource.setQueryDelay(this.endpointQueryDelayMS);
    endpointSource.setCacheTTL(this.endpointQueryCacheTTL);
    endpointSource.setPagination(this.endpointQueryPagination);
    endpointSource.setQueryLimit(this.endpointQueryLimit);
    return endpointSource;
  }
  if (customTextSource != null) {
    InputStream is=new ByteArrayInputStream(customTextSource.getBytes());
    RDFReader textReader=new RDFStreamReader(is,customTextFormat.getName());
    return new DumpTestSource(CacheUtils.getAutoPrefixForURI(datasetURI),datasetURI,textReader,getAllSchemata());
  }
  String tmp_customDereferenceURI=datasetURI;
  if (customDereferenceURI != null && !customDereferenceURI.isEmpty()) {
    tmp_customDereferenceURI=customDereferenceURI;
  }
  return new DumpTestSource(CacheUtils.getAutoPrefixForURI(datasetURI),datasetURI,tmp_customDereferenceURI,getAllSchemata());
}

Fixed version (ground truth):
public Source getTestSource(){
  if (endpointURI != null && !endpointURI.isEmpty()) {
    EndpointTestSource endpointSource=new EndpointTestSource(CacheUtils.getAutoPrefixForURI(datasetURI),datasetURI,endpointURI,endpointGraphs,getAllSchemata());
    endpointSource.setQueryDelay(this.endpointQueryDelayMS);
    endpointSource.setCacheTTL(this.endpointQueryCacheTTL);
    endpointSource.setPagination(this.endpointQueryPagination);
    endpointSource.setQueryLimit(this.endpointQueryLimit);
    return endpointSource;
  }
  if (customTextSource != null) {
    InputStream is=null;
    try {
      is=new ByteArrayInputStream(customTextSource.getBytes("String_Node_Str"));
    }
 catch (    UnsupportedEncodingException e) {
      throw new IllegalArgumentException("String_Node_Str" + customTextSource,e);
    }
    RDFReader textReader=new RDFStreamReader(is,customTextFormat.getName());
    return new DumpTestSource(CacheUtils.getAutoPrefixForURI(datasetURI),datasetURI,textReader,getAllSchemata());
  }
  String tmp_customDereferenceURI=datasetURI;
  if (customDereferenceURI != null && !customDereferenceURI.isEmpty()) {
    tmp_customDereferenceURI=customDereferenceURI;
  }
  return new DumpTestSource(CacheUtils.getAutoPrefixForURI(datasetURI),datasetURI,tmp_customDereferenceURI,getAllSchemata());
}
Program: 17650
Project: 17650
Buggy source:
public static String getMD5FromString(String md5){
  try {
    java.security.MessageDigest md=java.security.MessageDigest.getInstance("String_Node_Str");
    byte[] array=md.digest(md5.getBytes());
    StringBuilder sb=new StringBuilder();
    for (    byte anArray : array) {
      sb.append(Integer.toHexString((anArray & 0xFF) | 0x100).substring(1,3));
    }
    return sb.toString();
  }
 catch (  java.security.NoSuchAlgorithmException e) {
  }
  return null;
}

Fixed version (ground truth):
public static String getMD5FromString(String md5){
  try {
    java.security.MessageDigest md=java.security.MessageDigest.getInstance("String_Node_Str");
    byte[] array=md.digest(md5.getBytes("String_Node_Str"));
    StringBuilder sb=new StringBuilder();
    for (    byte anArray : array) {
      sb.append(Integer.toHexString((anArray & 0xFF) | 0x100).substring(1,3));
    }
    return sb.toString();
  }
 catch (  java.security.NoSuchAlgorithmException e) {
    throw new RuntimeException("String_Node_Str" + md5,e);
  }
catch (  UnsupportedEncodingException e) {
    throw new RuntimeException("String_Node_Str" + md5,e);
  }
}
Program: 17651
Project: 17651
Buggy source:
@Override public void write(QueryExecutionFactory qef) throws TripleWriterException {
  final Collection<String> testExecutionURIs=getTestExecutionURI(qef);
  try {
    outputStream.write(getHeader().toString().getBytes());
    for (    String te : testExecutionURIs) {
      outputStream.write(getTestExecutionStats(qef,te).toString().getBytes());
      outputStream.write(getTestExecutionResults(qef,te).toString().getBytes());
    }
    outputStream.write(getFooter().toString().getBytes());
    outputStream.close();
  }
 catch (  IOException e) {
    throw new TripleWriterException("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void write(QueryExecutionFactory qef) throws TripleWriterException {
  final Collection<String> testExecutionURIs=getTestExecutionURI(qef);
  try {
    outputStream.write(getHeader().toString().getBytes("String_Node_Str"));
    for (    String te : testExecutionURIs) {
      outputStream.write(getTestExecutionStats(qef,te).toString().getBytes("String_Node_Str"));
      outputStream.write(getTestExecutionResults(qef,te).toString().getBytes("String_Node_Str"));
    }
    outputStream.write(getFooter().toString().getBytes("String_Node_Str"));
    outputStream.close();
  }
 catch (  IOException e) {
    throw new TripleWriterException("String_Node_Str",e);
  }
}
Program: 17652
Project: 17652
Buggy source:
@Override protected QueryExecutionFactory initQueryFactory(){
  QueryExecutionFactory qef;
  if (getSparqlGraphs() == null || getSparqlGraphs().isEmpty()) {
    qef=new QueryExecutionFactoryHttp(getSparqlEndpoint());
  }
 else {
    qef=new QueryExecutionFactoryHttp(getSparqlEndpoint(),getSparqlGraphs());
  }
  if (this.queryDelay > 0) {
    qef=new QueryExecutionFactoryDelay(qef,this.queryDelay);
  }
  if (this.cacheTTL > 0) {
    try {
      QueryExecutionFactory _qef=CacheUtilsH2.createQueryExecutionFactory(qef,"String_Node_Str" + getPrefix(),false,cacheTTL);
      qef=_qef;
      log.debug("String_Node_Str" + this.getSparqlEndpoint());
    }
 catch (    Exception e) {
      log.debug("String_Node_Str" + this.getSparqlEndpoint(),e);
    }
  }
  if (this.pagination > 0) {
    qef=new QueryExecutionFactoryPaginated(qef,900);
  }
  if (this.queryLimit > 0 || this.queryLimit < Query.NOLIMIT) {
    qef=new QueryExecutionFactoryLimit(qef,true,this.queryLimit);
  }
  return qef;
}

Fixed version (ground truth):
@Override protected QueryExecutionFactory initQueryFactory(){
  QueryExecutionFactory qef;
  if (getSparqlGraphs() == null || getSparqlGraphs().isEmpty()) {
    qef=new QueryExecutionFactoryHttp(getSparqlEndpoint());
  }
 else {
    qef=new QueryExecutionFactoryHttp(getSparqlEndpoint(),getSparqlGraphs());
  }
  if (this.queryDelay > 0) {
    qef=new QueryExecutionFactoryDelay(qef,this.queryDelay);
  }
  if (this.cacheTTL > 0) {
    try {
      QueryExecutionFactory _qef=CacheUtilsH2.createQueryExecutionFactory(qef,"String_Node_Str" + getPrefix(),false,cacheTTL);
      qef=_qef;
      log.debug("String_Node_Str" + this.getSparqlEndpoint());
    }
 catch (    Exception e) {
      log.debug("String_Node_Str" + this.getSparqlEndpoint(),e);
    }
  }
  if (this.pagination > 0) {
    qef=new QueryExecutionFactoryPaginated(qef,this.pagination);
  }
  if (this.queryLimit > 0 || this.queryLimit < Query.NOLIMIT) {
    qef=new QueryExecutionFactoryLimit(qef,true,this.queryLimit);
  }
  return qef;
}