nus-yam/ex-repair huggingface dataset:
Program: 12419
Project: 12419
Buggy source:
/** 
 * Removes the given combinatorial derivation from this SBOL document's list of combinatorial derivations.
 * @param combinatorialDerivation the combinatorialDerivation to be removed
 * @return {@code true} if the given combinatorial derivation was successfullyremoved,  {@code false} otherwise
 * @throws SBOLValidationException if either of the following SBOL validation rules was violated: TODO: 10604, 12103.
 */
public boolean removeCombinatorialDerivation(CombinatorialDerivation combinatorialDerivation) throws SBOLValidationException {
  if (complete) {
    for (    CombinatorialDerivation cd : combinatorialDerivations.values()) {
      for (      VariableComponent vc : cd.getVariableComponents()) {
        for (        URI variantURI : vc.getVariantDerivations())         if (variantURI.equals(combinatorialDerivation.getIdentity())) {
          throw new SBOLValidationException("String_Node_Str",vc);
        }
      }
    }
  }
  return removeTopLevel(combinatorialDerivation,combinatorialDerivations);
}

Fixed version (ground truth):
/** 
 * Removes the given combinatorial derivation from this SBOL document's list of combinatorial derivations.
 * @param combinatorialDerivation the combinatorialDerivation to be removed
 * @return {@code true} if the given combinatorial derivation was successfullyremoved,  {@code false} otherwise
 * @throws SBOLValidationException if either of the following SBOL validation rules was violated: TODO: 10604, 12103.
 */
public boolean removeCombinatorialDerivation(CombinatorialDerivation combinatorialDerivation) throws SBOLValidationException {
  if (complete) {
    for (    CombinatorialDerivation cd : combinatorialDerivations.values()) {
      for (      VariableComponent vc : cd.getVariableComponents()) {
        for (        URI variantURI : vc.getVariantURIs())         if (variantURI.equals(combinatorialDerivation.getIdentity())) {
          throw new SBOLValidationException("String_Node_Str",vc);
        }
      }
    }
  }
  return removeTopLevel(combinatorialDerivation,combinatorialDerivations);
}
Program: 12420
Project: 12420
Buggy source:
/** 
 * @param sbolDocument
 * @param combinatorialDerivation
 * @param visited
 * @throws SBOLValidationException if either of the following SBOL validation rule was violated: TODO: 10603, 10605.
 */
static void checkCombinatorialDerivationCycle(SBOLDocument sbolDocument,CombinatorialDerivation combinatorialDerivation,Set<URI> visited) throws SBOLValidationException {
  if (combinatorialDerivation == null)   return;
  visited.add(combinatorialDerivation.getIdentity());
  for (  VariableComponent variableComponent : combinatorialDerivation.getVariableComponents()) {
    for (    URI variantDerivationURI : variableComponent.getVariantDerivations()) {
      CombinatorialDerivation variantDerivation=combinatorialDerivation.getSBOLDocument().getCombinatorialDerivation(variantDerivationURI);
      if (variantDerivation == null)       continue;
      if (visited.contains(variantDerivation.getIdentity())) {
        throw new SBOLValidationException("String_Node_Str",variableComponent);
      }
      try {
        checkCombinatorialDerivationCycle(sbolDocument,variantDerivation,visited);
      }
 catch (      SBOLValidationException e) {
        throw new SBOLValidationException("String_Node_Str",variableComponent);
      }
    }
  }
  visited.remove(combinatorialDerivation.getIdentity());
  return;
}

Fixed version (ground truth):
/** 
 * @param sbolDocument
 * @param combinatorialDerivation
 * @param visited
 * @throws SBOLValidationException if either of the following SBOL validation rule was violated: TODO: 10603, 10605.
 */
static void checkCombinatorialDerivationCycle(SBOLDocument sbolDocument,CombinatorialDerivation combinatorialDerivation,Set<URI> visited) throws SBOLValidationException {
  if (combinatorialDerivation == null)   return;
  visited.add(combinatorialDerivation.getIdentity());
  for (  VariableComponent variableComponent : combinatorialDerivation.getVariableComponents()) {
    for (    URI variantDerivationURI : variableComponent.getVariantDerivationURIs()) {
      CombinatorialDerivation variantDerivation=combinatorialDerivation.getSBOLDocument().getCombinatorialDerivation(variantDerivationURI);
      if (variantDerivation == null)       continue;
      if (visited.contains(variantDerivation.getIdentity())) {
        throw new SBOLValidationException("String_Node_Str",variableComponent);
      }
      try {
        checkCombinatorialDerivationCycle(sbolDocument,variantDerivation,visited);
      }
 catch (      SBOLValidationException e) {
        throw new SBOLValidationException("String_Node_Str",variableComponent);
      }
    }
  }
  visited.remove(combinatorialDerivation.getIdentity());
  return;
}
Program: 12421
Project: 12421
Buggy source:
private static void formatVariableComponents(Set<VariableComponent> variableComponents,List<NamedProperty<QName>> properties){
  for (  VariableComponent variableComponent : variableComponents) {
    List<NamedProperty<QName>> list=new ArrayList<>();
    formatCommonIdentifiedData(list,variableComponent);
    list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariable,variableComponent.getVariable().getIdentity()));
    list.add(NamedProperty(Sbol2Terms.VariableComponent.hasOperator,OperatorType.convertToURI(variableComponent.getOperator())));
    for (    URI variant : variableComponent.getVariantURIs()) {
      list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariants,variant));
    }
    for (    URI variantCollection : variableComponent.getVariantCollections()) {
      list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariantCollections,variantCollection));
    }
    for (    URI variantDerivation : variableComponent.getVariantDerivations()) {
      list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariantDerivations,variantDerivation));
    }
    properties.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.hasVariableComponent,NestedDocument(Sbol2Terms.VariableComponent.VariableComponent,variableComponent.getIdentity(),NamedProperties(list))));
  }
}

Fixed version (ground truth):
private static void formatVariableComponents(Set<VariableComponent> variableComponents,List<NamedProperty<QName>> properties){
  for (  VariableComponent variableComponent : variableComponents) {
    List<NamedProperty<QName>> list=new ArrayList<>();
    formatCommonIdentifiedData(list,variableComponent);
    list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariable,variableComponent.getVariable().getIdentity()));
    list.add(NamedProperty(Sbol2Terms.VariableComponent.hasOperator,OperatorType.convertToURI(variableComponent.getOperator())));
    for (    URI variant : variableComponent.getVariantURIs()) {
      list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariants,variant));
    }
    for (    URI variantCollection : variableComponent.getVariantCollectionURIs()) {
      list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariantCollections,variantCollection));
    }
    for (    URI variantDerivation : variableComponent.getVariantDerivationURIs()) {
      list.add(NamedProperty(Sbol2Terms.VariableComponent.hasVariantDerivations,variantDerivation));
    }
    properties.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.hasVariableComponent,NestedDocument(Sbol2Terms.VariableComponent.VariableComponent,variableComponent.getIdentity(),NamedProperties(list))));
  }
}
Program: 12422
Project: 12422
Buggy source:
public void setVariants(Set<URI> variants){
  this.variants=(HashSet<URI>)variants;
}

Fixed version (ground truth):
/** 
 * @param variants TODO: validation (null check)
 */
public void setVariants(Set<URI> variants){
  this.variants=(HashSet<URI>)variants;
}
Program: 12423
Project: 12423
Buggy source:
public void setVariantCollections(Set<URI> variantCollections){
  this.variantCollections=(HashSet<URI>)variantCollections;
}

Fixed version (ground truth):
/** 
 * @param variantCollections TODO: validation (null check)
 */
public void setVariantCollections(Set<URI> variantCollections){
  this.variantCollections=(HashSet<URI>)variantCollections;
}
Program: 12424
Project: 12424
Buggy source:
public Set<URI> getVariantURIs(){
  return new HashSet<URI>(this.variants);
}

Fixed version (ground truth):
/** 
 * Returns a set of component definition URIs belonging to the variable component.
 * @return the matching set of component definition URIs
 */
public Set<URI> getVariantURIs(){
  return new HashSet<URI>(this.variants);
}
Program: 12425
Project: 12425
Buggy source:
public Set<CombinatorialDerivation> getVariants(){
  HashSet<CombinatorialDerivation> tempVariants=new HashSet<>();
  for (  URI variantURI : variants) {
    variants.add(this.getSBOLDocument().getCombinatorialDerivation(variantURI).getIdentity());
  }
  return tempVariants;
}

Fixed version (ground truth):
/** 
 * Returns a set of component definitions belonging to the variable component.
 * @return the matching set of component definitions
 */
public Set<ComponentDefinition> getVariants(){
  HashSet<ComponentDefinition> tempVariants=new HashSet<>();
  for (  URI variantURI : variants) {
    variants.add(this.getSBOLDocument().getComponentDefinition(variantURI).getIdentity());
  }
  return tempVariants;
}
Program: 12426
Project: 12426
Buggy source:
private VariableComponent(VariableComponent variableComponent) throws SBOLValidationException {
  super(variableComponent.getIdentity());
  this.variable=variableComponent.variable;
  this.operator=variableComponent.operator;
  this.variants=variableComponent.variants;
  this.variantCollections=variableComponent.variantCollections;
  this.variantDerivations=variableComponent.variantDerivations;
}

Fixed version (ground truth):
/** 
 * @param variableComponent
 * @throws SBOLValidationException if an SBOL validation rule violation occurred in any of the following constructors or methods: TODO: copy over objects instead of references like in combinatorial derivation
 */
private VariableComponent(VariableComponent variableComponent) throws SBOLValidationException {
  super(variableComponent.getIdentity());
  this.variable=variableComponent.variable;
  this.operator=variableComponent.operator;
  this.variants=variableComponent.variants;
  this.variantCollections=variableComponent.variantCollections;
  this.variantDerivations=variableComponent.variantDerivations;
}
Program: 12427
Project: 12427
Buggy source:
public OperatorType getOperator(){
  return this.operator;
}

Fixed version (ground truth):
/** 
 * Returns the operator of the given variable component.
 * @return the matching operator if present, or {@code null} otherwise.
 */
public OperatorType getOperator(){
  return this.operator;
}
Program: 12428
Project: 12428
Buggy source:
public void addVariantCollection(String uriPrefix,String displayId,String version) throws SBOLValidationException {
  URI uri=URIcompliance.createCompliantURI(uriPrefix,displayId,version);
  Collection collection=this.getSBOLDocument().getCollection(uri);
  variantCollections.add(collection.getIdentity());
}

Fixed version (ground truth):
/** 
 * Adds the given variant collection to the list of variant collections.
 * @param uriPrefix TODO: change variable name
 * @param displayId
 * @param version
 */
public void addVariantCollection(String uriPrefix,String displayId,String version) throws SBOLValidationException {
  URI uri=URIcompliance.createCompliantURI(uriPrefix,displayId,version);
  Collection collection=this.getSBOLDocument().getCollection(uri);
  variantCollections.add(collection.getIdentity());
}
Program: 12429
Project: 12429
Buggy source:
public void addVariantDerivation(String uriPrefix,String displayId,String version) throws SBOLValidationException {
  URI uri=URIcompliance.createCompliantURI(uriPrefix,displayId,version);
  CombinatorialDerivation combinatorialDerivation=this.getSBOLDocument().getCombinatorialDerivation(uri);
  variants.add(combinatorialDerivation.getIdentity());
}

Fixed version (ground truth):
/** 
 * Adds the given variant derivation to the list of variant derivations.
 * @param uriPrefix TODO: change variable name
 * @param displayId
 * @param version
 */
public void addVariantDerivation(String uriPrefix,String displayId,String version) throws SBOLValidationException {
  URI uri=URIcompliance.createCompliantURI(uriPrefix,displayId,version);
  CombinatorialDerivation combinatorialDerivation=this.getSBOLDocument().getCombinatorialDerivation(uri);
  variants.add(combinatorialDerivation.getIdentity());
}
Program: 12430
Project: 12430
Buggy source:
public void setCombinatorialDerivation(CombinatorialDerivation combinatorialDerivation){
  this.combinatorialDerivation=combinatorialDerivation;
}

Fixed version (ground truth):
/** 
 * Sets the parent combinatorial derivation to the given one.
 * @param combinatorialDerivation the given combinatorial derivation to set to
 * @throws SBOLValidationException if either of the following SBOL validation rules was violated: TODO: 10604, 10605.
 */
public void setCombinatorialDerivation(CombinatorialDerivation combinatorialDerivation){
  this.combinatorialDerivation=combinatorialDerivation;
}
Program: 12431
Project: 12431
Buggy source:
public void setVariantDerivations(Set<URI> variantDerivations){
  this.variantDerivations=(HashSet<URI>)variantDerivations;
}

Fixed version (ground truth):
/** 
 * @param variantDerivations TODO: validation (null check)
 */
public void setVariantDerivations(Set<URI> variantDerivations){
  this.variantDerivations=(HashSet<URI>)variantDerivations;
}
Program: 12432
Project: 12432
Buggy source:
public Component getVariable(){
  return this.variable;
}

Fixed version (ground truth):
/** 
 * Returns the instance matching the given variable component's variable.
 * @return the matching component if present, or {@code null} otherwise.
 */
public Component getVariable(){
  return this.variable;
}
Program: 12433
Project: 12433
Buggy source:
public void addVariant(String uriPrefix,String displayId,String version) throws SBOLValidationException {
  URI uri=URIcompliance.createCompliantURI(uriPrefix,displayId,version);
  ComponentDefinition componentDefinition=this.getSBOLDocument().getComponentDefinition(uri);
  variants.add(componentDefinition.getIdentity());
}

Fixed version (ground truth):
/** 
 * Adds the given variant to the list of variants.
 * @param uriPrefix TODO: change variable name
 * @param displayId
 * @param version
 */
public void addVariant(String uriPrefix,String displayId,String version) throws SBOLValidationException {
  URI uri=URIcompliance.createCompliantURI(uriPrefix,displayId,version);
  ComponentDefinition componentDefinition=this.getSBOLDocument().getComponentDefinition(uri);
  variants.add(componentDefinition.getIdentity());
}
Program: 12434
Project: 12434
Buggy source:
public void submit(String id,String version,String name,String description,String citations,String collections,String overwrite_merge,InputStream fileToUpload) throws SynBioHubException {
  if (user.equals("String_Node_Str")) {
    Exception e=new Exception("String_Node_Str");
    throw new SynBioHubException(e);
  }
  String url=backendUrl + "String_Node_Str";
  HttpPost request=new HttpPost(url);
  request.setHeader("String_Node_Str",user);
  request.setHeader("String_Node_Str","String_Node_Str");
  MultipartEntityBuilder params=MultipartEntityBuilder.create();
  params.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
  params.addTextBody("String_Node_Str",id);
  params.addTextBody("String_Node_Str",version);
  params.addTextBody("String_Node_Str",name);
  params.addTextBody("String_Node_Str",description);
  params.addTextBody("String_Node_Str",citations);
  params.addTextBody("String_Node_Str",collections);
  params.addTextBody("String_Node_Str",overwrite_merge);
  params.addTextBody("String_Node_Str",user);
  if (document != null) {
    InputStream stream=new ByteArrayInputStream(serializeDocument(document).getBytes());
    params.addBinaryBody("String_Node_Str",stream,ContentType.APPLICATION_XML,"String_Node_Str");
  }
 else {
    params.addTextBody("String_Node_Str","String_Node_Str");
  }
  try {
    request.setEntity(params.build());
    HttpResponse response=client.execute(request);
    checkResponseCode(response);
  }
 catch (  Exception e) {
    throw new SynBioHubException(e);
  }
 finally {
    request.releaseConnection();
  }
}

Fixed version (ground truth):
public void submit(String id,String version,String name,String description,String citations,String collections,String overwrite_merge,InputStream upload) throws SynBioHubException {
  if (user.equals("String_Node_Str")) {
    Exception e=new Exception("String_Node_Str");
    throw new SynBioHubException(e);
  }
  String url=backendUrl + "String_Node_Str";
  HttpPost request=new HttpPost(url);
  request.setHeader("String_Node_Str",user);
  request.setHeader("String_Node_Str","String_Node_Str");
  MultipartEntityBuilder params=MultipartEntityBuilder.create();
  params.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
  params.addTextBody("String_Node_Str",id);
  params.addTextBody("String_Node_Str",version);
  params.addTextBody("String_Node_Str",name);
  params.addTextBody("String_Node_Str",description);
  params.addTextBody("String_Node_Str",citations);
  params.addTextBody("String_Node_Str",collections);
  params.addTextBody("String_Node_Str",overwrite_merge);
  params.addTextBody("String_Node_Str",user);
  if (upload != null) {
    params.addBinaryBody("String_Node_Str",upload,ContentType.APPLICATION_XML,"String_Node_Str");
  }
 else {
    params.addTextBody("String_Node_Str","String_Node_Str");
  }
  try {
    request.setEntity(params.build());
    HttpResponse response=client.execute(request);
    checkResponseCode(response);
  }
 catch (  Exception e) {
    throw new SynBioHubException(e);
  }
 finally {
    request.releaseConnection();
  }
}
Program: 12436
Project: 12436
Buggy source:
private String extractDocumentURIPrefix(){
  String documentURIPrefix="String_Node_Str";
  for (  TopLevel topLevel : getTopLevels()) {
    if (documentURIPrefix.equals("String_Node_Str")) {
      documentURIPrefix=URIcompliance.extractURIprefix(topLevel.getIdentity());
    }
 else {
      for (int i=0; i < documentURIPrefix.length(); i++) {
        if (i >= topLevel.getIdentity().toString().length() || documentURIPrefix.charAt(i) != topLevel.getIdentity().toString().charAt(i)) {
          if (i == 0) {
            documentURIPrefix="String_Node_Str";
          }
 else {
            documentURIPrefix=documentURIPrefix.substring(0,i);
          }
          break;
        }
      }
      if (documentURIPrefix.equals("String_Node_Str"))       break;
    }
  }
  return documentURIPrefix;
}

Fixed version (ground truth):
private String extractDocumentURIPrefix(){
  String documentURIPrefix=null;
  for (  TopLevel topLevel : getTopLevels()) {
    if (documentURIPrefix == null || documentURIPrefix.equals("String_Node_Str")) {
      documentURIPrefix=URIcompliance.extractURIprefix(topLevel.getIdentity());
    }
 else {
      for (int i=0; i < documentURIPrefix.length(); i++) {
        if (i >= topLevel.getIdentity().toString().length() || documentURIPrefix.charAt(i) != topLevel.getIdentity().toString().charAt(i)) {
          if (i == 0) {
            documentURIPrefix="String_Node_Str";
          }
 else {
            documentURIPrefix=documentURIPrefix.substring(0,i);
          }
          break;
        }
      }
      if (documentURIPrefix.equals("String_Node_Str"))       break;
    }
  }
  return documentURIPrefix;
}
Program: 12437
Project: 12437
Buggy source:
/** 
 * Copy all objects to an a new SBOL Document and change the URI prefix/version of each object
 * @param URIPrefix new URI prefix
 * @param version new version
 * @return new SBOL document with changed URI prefix
 * @throws SBOLValidationException if URIprefix or version provided is invalid
 */
public SBOLDocument changeURIPrefixVersion(String URIPrefix,String version) throws SBOLValidationException {
  SBOLDocument document=new SBOLDocument();
  SBOLDocument fixed=new SBOLDocument();
  fixed.setDefaultURIprefix(URIPrefix);
  fixed.createCopy(this);
  fixed.fixDocumentURIPrefix();
  String documentURIPrefix=fixed.extractDocumentURIPrefix();
  HashMap<URI,URI> uriMap=new HashMap<URI,URI>();
  for (  TopLevel topLevel : fixed.getTopLevels()) {
    fixed.rename(topLevel,URIPrefix,null,version);
    TopLevel newTL=document.createCopy(topLevel,URIPrefix,null,version);
    uriMap.put(topLevel.getIdentity(),newTL.getIdentity());
    uriMap.put(topLevel.getPersistentIdentity(),newTL.getPersistentIdentity());
  }
  document.updateReferences(uriMap);
  for (  TopLevel topLevel : document.getTopLevels()) {
    document.changeURIPrefixVersion(topLevel,URIPrefix,version,documentURIPrefix);
  }
  document.setDefaultURIprefix(URIPrefix);
  return document;
}

Fixed version (ground truth):
/** 
 * Copy all objects to an a new SBOL Document and change the URI prefix/version of each object
 * @param URIPrefix new URI prefix
 * @param version new version
 * @return new SBOL document with changed URI prefix
 * @throws SBOLValidationException if URIprefix or version provided is invalid
 */
public SBOLDocument changeURIPrefixVersion(String URIPrefix,String version) throws SBOLValidationException {
  SBOLDocument document=new SBOLDocument();
  SBOLDocument fixed=new SBOLDocument();
  fixed.setDefaultURIprefix(URIPrefix);
  this.fixDocumentURIPrefix();
  fixed.createCopy(this);
  String documentURIPrefix=fixed.extractDocumentURIPrefix();
  HashMap<URI,URI> uriMap=new HashMap<URI,URI>();
  for (  TopLevel topLevel : fixed.getTopLevels()) {
    fixed.rename(topLevel,URIPrefix,null,version);
    TopLevel newTL=document.createCopy(topLevel,URIPrefix,null,version);
    uriMap.put(topLevel.getIdentity(),newTL.getIdentity());
    uriMap.put(topLevel.getPersistentIdentity(),newTL.getPersistentIdentity());
  }
  document.updateReferences(uriMap);
  for (  TopLevel topLevel : document.getTopLevels()) {
    document.changeURIPrefixVersion(topLevel,URIPrefix,version,documentURIPrefix);
  }
  document.setDefaultURIprefix(URIPrefix);
  return document;
}
Program: 12439
Project: 12439
Buggy source:
/** 
 * @return the wasInformedBy
 */
public Set<URI> getWasInformedBys(){
  return wasInformedBys;
}

Fixed version (ground truth):
/** 
 * Returns the set of wasInformedBys referenced by this activity.
 * @return the set of wasInformedBys referenced by this activity
 */
public Set<Activity> getWasInformedBys(){
  if (this.getSBOLDocument() == null)   return null;
  Set<Activity> resolved=new HashSet<>();
  for (  URI wib : wasInformedBys) {
    Activity activity=this.getSBOLDocument().getActivity(wib);
    if (activity != null) {
      resolved.add(activity);
    }
  }
  return resolved;
}
Program: 12440
Project: 12440
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  Activity other=(Activity)obj;
  if (startedAtTime == null) {
    if (other.startedAtTime != null)     return false;
  }
 else   if (!startedAtTime.equals(other.startedAtTime))   return false;
  if (endedAtTime == null) {
    if (other.endedAtTime != null)     return false;
  }
 else   if (!endedAtTime.equals(other.endedAtTime))   return false;
  if (wasInformedBys == null) {
    if (other.wasInformedBys != null)     return false;
  }
 else   if (!wasInformedBys.equals(other.wasInformedBys))   return false;
  if (associations == null) {
    if (other.associations != null)     return false;
  }
 else   if (!associations.equals(other.associations))   return false;
  if (usages == null) {
    if (other.usages != null)     return false;
  }
 else   if (!usages.equals(other.usages))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  Activity other=(Activity)obj;
  if (startedAtTime == null) {
    if (other.startedAtTime != null)     return false;
  }
 else   if (!startedAtTime.equals(other.startedAtTime))   return false;
  if (endedAtTime == null) {
    if (other.endedAtTime != null)     return false;
  }
 else   if (!endedAtTime.equals(other.endedAtTime))   return false;
  if (wasInformedBys == null) {
    if (other.wasInformedBys != null)     return false;
  }
 else   if (!wasInformedBys.equals(other.wasInformedBys)) {
    if (getWasInformedBys().size() != getWasInformedByURIs().size() || other.getWasInformedBys().size() != other.getWasInformedByURIs().size() || !getWasInformedBys().equals(other.getWasInformedBys())) {
      return false;
    }
  }
  if (associations == null) {
    if (other.associations != null)     return false;
  }
 else   if (!associations.equals(other.associations))   return false;
  if (usages == null) {
    if (other.usages != null)     return false;
  }
 else   if (!usages.equals(other.usages))   return false;
  return true;
}
Program: 12441
Project: 12441
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  Collection other=(Collection)obj;
  if (members == null) {
    if (other.members != null)     return false;
  }
 else   if (!members.equals(other.members))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  Collection other=(Collection)obj;
  if (members == null) {
    if (other.members != null)     return false;
  }
 else   if (!members.equals(other.members)) {
    if (getMembers().size() != getMemberURIs().size() || other.getMembers().size() != other.getMemberURIs().size() || !getMembers().equals(other.getMembers())) {
      return false;
    }
  }
  if (members == null) {
    if (other.members != null)     return false;
  }
 else   if (!members.equals(other.members))   return false;
  return true;
}
Program: 12442
Project: 12442
Buggy source:
/** 
 * Returns the set of sequence URIs referenced by this component definition.
 * @return the set of sequence URIs referenced by this component definition
 */
public Set<URI> getSequenceURIs(){
  return sequences;
}

Fixed version (ground truth):
/** 
 * Returns the set of sequence URIs referenced by this component definition.
 * @return the set of sequence URIs referenced by this component definition
 */
public Set<URI> getSequenceURIs(){
  Set<URI> result=new HashSet<>();
  result.addAll(sequences);
  return result;
}
Program: 12443
Project: 12443
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  ComponentDefinition other=(ComponentDefinition)obj;
  if (roles == null) {
    if (other.roles != null)     return false;
  }
 else   if (!roles.equals(other.roles))   return false;
  if (sequences == null) {
    if (other.sequences != null)     return false;
  }
 else   if (!sequences.equals(other.sequences))   return false;
  if (sequenceAnnotations == null) {
    if (other.sequenceAnnotations != null)     return false;
  }
 else   if (!sequenceAnnotations.equals(other.sequenceAnnotations))   return false;
  if (sequenceConstraints == null) {
    if (other.sequenceConstraints != null)     return false;
  }
 else   if (!sequenceConstraints.equals(other.sequenceConstraints))   return false;
  if (components == null) {
    if (other.components != null)     return false;
  }
 else   if (!components.equals(other.components))   return false;
  if (types == null) {
    if (other.types != null)     return false;
  }
 else   if (!types.equals(other.types))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  ComponentDefinition other=(ComponentDefinition)obj;
  if (roles == null) {
    if (other.roles != null)     return false;
  }
 else   if (!roles.equals(other.roles))   return false;
  if (sequences == null) {
    if (other.sequences != null)     return false;
  }
 else   if (!sequences.equals(other.sequences)) {
    if (getSequences().size() != getSequenceURIs().size() || other.getSequences().size() != other.getSequenceURIs().size() || !getSequences().equals(other.getSequences())) {
      return false;
    }
  }
  if (sequenceAnnotations == null) {
    if (other.sequenceAnnotations != null)     return false;
  }
 else   if (!sequenceAnnotations.equals(other.sequenceAnnotations))   return false;
  if (sequenceConstraints == null) {
    if (other.sequenceConstraints != null)     return false;
  }
 else   if (!sequenceConstraints.equals(other.sequenceConstraints))   return false;
  if (components == null) {
    if (other.components != null)     return false;
  }
 else   if (!components.equals(other.components))   return false;
  if (types == null) {
    if (other.types != null)     return false;
  }
 else   if (!types.equals(other.types))   return false;
  return true;
}
Program: 12444
Project: 12444
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  ComponentInstance other=(ComponentInstance)obj;
  if (definition == null) {
    if (other.definition != null)     return false;
  }
 else   if (!definition.equals(other.definition))   return false;
  if (access != other.access)   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  ComponentInstance other=(ComponentInstance)obj;
  if (definition == null) {
    if (other.definition != null)     return false;
  }
 else   if (!definition.equals(other.definition)) {
    if (getDefinition() == null || other.getDefinition() == null || !getDefinition().equals(other.getDefinition())) {
      return false;
    }
  }
  if (access != other.access)   return false;
  return true;
}
Program: 12445
Project: 12445
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  MapsTo other=(MapsTo)obj;
  if (local == null) {
    if (other.local != null)     return false;
  }
 else   if (!local.equals(other.local))   return false;
  if (refinement != other.refinement)   return false;
  if (remote == null) {
    if (other.remote != null)     return false;
  }
 else   if (!remote.equals(other.remote))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  MapsTo other=(MapsTo)obj;
  if (local == null) {
    if (other.local != null)     return false;
  }
 else   if (!local.equals(other.local)) {
    if (getLocal() == null || other.getLocal() == null || !getLocal().equals(other.getLocal())) {
      return false;
    }
  }
  if (remote == null) {
    if (other.remote != null)     return false;
  }
 else   if (!remote.equals(other.remote)) {
    if (getRemote() == null || other.getRemote() == null || !getRemote().equals(other.getRemote())) {
      return false;
    }
  }
  if (refinement != other.refinement)   return false;
  return true;
}
Program: 12446
Project: 12446
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  Module other=(Module)obj;
  if (definition == null) {
    if (other.definition != null)     return false;
  }
 else   if (!definition.equals(other.definition))   return false;
  if (mapsTos == null) {
    if (other.mapsTos != null)     return false;
  }
 else   if (!mapsTos.equals(other.mapsTos))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  Module other=(Module)obj;
  if (definition == null) {
    if (other.definition != null)     return false;
  }
 else   if (!definition.equals(other.definition)) {
    if (getDefinition() == null || other.getDefinition() == null || !getDefinition().equals(other.getDefinition())) {
      return false;
    }
  }
  if (mapsTos == null) {
    if (other.mapsTos != null)     return false;
  }
 else   if (!mapsTos.equals(other.mapsTos))   return false;
  return true;
}
Program: 12447
Project: 12447
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  ModuleDefinition other=(ModuleDefinition)obj;
  if (functionalComponents == null) {
    if (other.functionalComponents != null)     return false;
  }
 else   if (!functionalComponents.equals(other.functionalComponents))   return false;
  if (interactions == null) {
    if (other.interactions != null)     return false;
  }
 else   if (!interactions.equals(other.interactions))   return false;
  if (models == null) {
    if (other.models != null)     return false;
  }
 else   if (!models.equals(other.models))   return false;
  if (roles == null) {
    if (other.roles != null)     return false;
  }
 else   if (!roles.equals(other.roles))   return false;
  if (modules == null) {
    if (other.modules != null)     return false;
  }
 else   if (!modules.equals(other.modules))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  ModuleDefinition other=(ModuleDefinition)obj;
  if (functionalComponents == null) {
    if (other.functionalComponents != null)     return false;
  }
 else   if (!functionalComponents.equals(other.functionalComponents))   return false;
  if (interactions == null) {
    if (other.interactions != null)     return false;
  }
 else   if (!interactions.equals(other.interactions))   return false;
  if (models == null) {
    if (other.models != null)     return false;
  }
 else   if (!models.equals(other.models)) {
    if (getModels().size() != getModelURIs().size() || other.getModels().size() != other.getModelURIs().size() || !getModels().equals(other.getModels())) {
      return false;
    }
  }
  if (roles == null) {
    if (other.roles != null)     return false;
  }
 else   if (!roles.equals(other.roles))   return false;
  if (modules == null) {
    if (other.modules != null)     return false;
  }
 else   if (!modules.equals(other.modules))   return false;
  return true;
}
Program: 12448
Project: 12448
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  Participation other=(Participation)obj;
  if (participant == null) {
    if (other.participant != null)     return false;
  }
 else   if (!participant.equals(other.participant))   return false;
  if (roles == null) {
    if (other.roles != null)     return false;
  }
 else   if (!roles.equals(other.roles))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  Participation other=(Participation)obj;
  if (participant == null) {
    if (other.participant != null)     return false;
  }
 else   if (!participant.equals(other.participant)) {
    if (getParticipant() == null || other.getParticipant() == null || !getParticipant().equals(other.getParticipant())) {
      return false;
    }
  }
  if (roles == null) {
    if (other.roles != null)     return false;
  }
 else   if (!roles.equals(other.roles))   return false;
  return true;
}
Program: 12449
Project: 12449
Buggy source:
private static void formatActivities(Set<Activity> activities,List<TopLevelDocument<QName>> topLevelDoc){
  for (  Activity activity : activities) {
    List<NamedProperty<QName>> list=new ArrayList<>();
    formatCommonTopLevelData(list,activity);
    if (activity.isSetStartedAtTime()) {
      list.add(NamedProperty(Sbol2Terms.Activity.startedAtTime,activity.getStartedAtTime().toString()));
    }
    if (activity.isSetEndedAtTime()) {
      list.add(NamedProperty(Sbol2Terms.Activity.endedAtTime,activity.getEndedAtTime().toString()));
    }
    formatAssociations(activity.getAssociations(),list);
    formatUsages(activity.getUsages(),list);
    topLevelDoc.add(TopLevelDocument(Sbol2Terms.Activity.Activity,activity.getIdentity(),NamedProperties(list)));
  }
}

Fixed version (ground truth):
private static void formatActivities(Set<Activity> activities,List<TopLevelDocument<QName>> topLevelDoc){
  for (  Activity activity : activities) {
    List<NamedProperty<QName>> list=new ArrayList<>();
    formatCommonTopLevelData(list,activity);
    if (activity.isSetStartedAtTime()) {
      list.add(NamedProperty(Sbol2Terms.Activity.startedAtTime,activity.getStartedAtTime().toString()));
    }
    if (activity.isSetEndedAtTime()) {
      list.add(NamedProperty(Sbol2Terms.Activity.endedAtTime,activity.getEndedAtTime().toString()));
    }
    formatAssociations(activity.getAssociations(),list);
    formatUsages(activity.getUsages(),list);
    formatWasInformedByProperties(activity.getWasInformedByURIs(),list);
    topLevelDoc.add(TopLevelDocument(Sbol2Terms.Activity.Activity,activity.getIdentity(),NamedProperties(list)));
  }
}
Program: 12450
Project: 12450
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  SequenceAnnotation other=(SequenceAnnotation)obj;
  if (component == null) {
    if (other.component != null)     return false;
  }
 else   if (!component.equals(other.component))   return false;
  if (roles == null) {
    if (other.roles != null)     return false;
  }
 else   if (!roles.equals(other.roles))   return false;
  if (locations == null) {
    if (other.locations != null)     return false;
  }
 else   if (!locations.equals(other.locations))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  SequenceAnnotation other=(SequenceAnnotation)obj;
  if (component == null) {
    if (other.component != null)     return false;
  }
 else   if (!component.equals(other.component)) {
    if (getComponent() == null || other.getComponent() == null || !getComponent().equals(other.getComponent())) {
      return false;
    }
  }
  if (roles == null) {
    if (other.roles != null)     return false;
  }
 else   if (!roles.equals(other.roles))   return false;
  if (locations == null) {
    if (other.locations != null)     return false;
  }
 else   if (!locations.equals(other.locations))   return false;
  return true;
}
Program: 12451
Project: 12451
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  SequenceConstraint other=(SequenceConstraint)obj;
  if (object == null) {
    if (other.object != null)     return false;
  }
 else   if (!object.equals(other.object))   return false;
  if (!restriction.equals(other.restriction))   return false;
  if (subject == null) {
    if (other.subject != null)     return false;
  }
 else   if (!subject.equals(other.subject))   return false;
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (!super.equals(obj))   return false;
  if (getClass() != obj.getClass())   return false;
  SequenceConstraint other=(SequenceConstraint)obj;
  if (subject == null) {
    if (other.subject != null)     return false;
  }
 else   if (!subject.equals(other.subject)) {
    if (getSubject() == null || other.getSubject() == null || !getSubject().equals(other.getSubject())) {
      return false;
    }
  }
  if (object == null) {
    if (other.object != null)     return false;
  }
 else   if (!object.equals(other.object)) {
    if (getObject() == null || other.getObject() == null || !getObject().equals(other.getObject())) {
      return false;
    }
  }
  if (!restriction.equals(other.restriction))   return false;
  return true;
}
Program: 12452
Project: 12452
Buggy source:
private static void formatCombinatorialDerivation(Set<CombinatorialDerivation> combinatorialDerivations,List<TopLevelDocument<QName>> topLevelDoc){
  for (  CombinatorialDerivation combinatorialDerivation : combinatorialDerivations) {
    List<NamedProperty<QName>> list=new ArrayList<>();
    formatCommonTopLevelData(list,combinatorialDerivation);
    list.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.template,combinatorialDerivation.getTemplate()));
    list.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.strategy,combinatorialDerivation.getStrategy()));
    formatVariableComponents(combinatorialDerivation.getVariableComponents(),list);
    topLevelDoc.add(TopLevelDocument(Sbol2Terms.CombinatorialDerivation.CombinatorialDerivation,combinatorialDerivation.getIdentity(),NamedProperties(list)));
  }
}

Fixed version (ground truth):
private static void formatCombinatorialDerivation(Set<CombinatorialDerivation> combinatorialDerivations,List<TopLevelDocument<QName>> topLevelDoc){
  for (  CombinatorialDerivation combinatorialDerivation : combinatorialDerivations) {
    List<NamedProperty<QName>> list=new ArrayList<>();
    formatCommonTopLevelData(list,combinatorialDerivation);
    list.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.template,combinatorialDerivation.getTemplate()));
    list.add(NamedProperty(Sbol2Terms.CombinatorialDerivation.strategy,combinatorialDerivation.getStrategy()));
    formatVariableComponents(new HashSet<VariableComponent>(combinatorialDerivation.getVariableComponents().values()),list);
    topLevelDoc.add(TopLevelDocument(Sbol2Terms.CombinatorialDerivation.CombinatorialDerivation,combinatorialDerivation.getIdentity(),NamedProperties(list)));
  }
}
Program: 12453
Project: 12453
Buggy source:
private static List<TopLevelDocument<QName>> getTopLevelDocument(SBOLDocument doc){
  List<TopLevelDocument<QName>> topLevelDoc=new ArrayList<>();
  formatCollections(doc.getCollections(),topLevelDoc);
  formatModuleDefinitions(doc.getModuleDefinitions(),topLevelDoc);
  formatModels(doc.getModels(),topLevelDoc);
  formatComponentDefinitions(doc.getComponentDefinitions(),topLevelDoc);
  formatSequences(doc.getSequences(),topLevelDoc);
  formatGenericTopLevel(doc.getGenericTopLevels(),topLevelDoc);
  return topLevelDoc;
}

Fixed version (ground truth):
private static List<TopLevelDocument<QName>> getTopLevelDocument(SBOLDocument doc){
  List<TopLevelDocument<QName>> topLevelDoc=new ArrayList<>();
  formatCollections(doc.getCollections(),topLevelDoc);
  formatModuleDefinitions(doc.getModuleDefinitions(),topLevelDoc);
  formatModels(doc.getModels(),topLevelDoc);
  formatComponentDefinitions(doc.getComponentDefinitions(),topLevelDoc);
  formatSequences(doc.getSequences(),topLevelDoc);
  formatGenericTopLevel(doc.getGenericTopLevels(),topLevelDoc);
  formatCombinatorialDerivation(doc.getCombinatorialDerivations(),topLevelDoc);
  return topLevelDoc;
}
Program: 12454
Project: 12454
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((URIValue == null) ? 0 : URIValue.hashCode());
  result=prime * result + ((boolValue == null) ? 0 : boolValue.hashCode());
  result=prime * result + ((doubleValue == null) ? 0 : doubleValue.hashCode());
  result=prime * result + ((intValue == null) ? 0 : intValue.hashCode());
  result=prime * result + ((localPart == null) ? 0 : localPart.hashCode());
  result=prime * result + ((namespaceURI == null) ? 0 : namespaceURI.hashCode());
  result=prime * result + ((nestedAnnotations == null) ? 0 : nestedAnnotations.hashCode());
  result=prime * result + ((nestedLocalPart == null) ? 0 : nestedLocalPart.hashCode());
  result=prime * result + ((nestedNamespaceURI == null) ? 0 : nestedNamespaceURI.hashCode());
  result=prime * result + ((nestedPrefix == null) ? 0 : nestedPrefix.hashCode());
  result=prime * result + ((nestedURI == null) ? 0 : nestedURI.hashCode());
  result=prime * result + ((prefix == null) ? 0 : prefix.hashCode());
  result=prime * result + ((stringValue == null) ? 0 : stringValue.hashCode());
  result=prime * result + ((type == null) ? 0 : type.hashCode());
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  final int prime=31;
  int result=1;
  result=prime * result + ((URIValue == null) ? 0 : URIValue.hashCode());
  result=prime * result + ((boolValue == null) ? 0 : boolValue.hashCode());
  result=prime * result + ((doubleValue == null) ? 0 : doubleValue.hashCode());
  result=prime * result + ((intValue == null) ? 0 : intValue.hashCode());
  result=prime * result + ((localPart == null) ? 0 : localPart.hashCode());
  result=prime * result + ((namespaceURI == null) ? 0 : namespaceURI.hashCode());
  result=prime * result + ((nestedAnnotations == null) ? 0 : nestedAnnotations.hashCode());
  result=prime * result + ((nestedLocalPart == null) ? 0 : nestedLocalPart.hashCode());
  result=prime * result + ((nestedNamespaceURI == null) ? 0 : nestedNamespaceURI.hashCode());
  result=prime * result + ((nestedURI == null) ? 0 : nestedURI.hashCode());
  result=prime * result + ((stringValue == null) ? 0 : stringValue.hashCode());
  result=prime * result + ((type == null) ? 0 : type.hashCode());
  return result;
}
Program: 12460
Project: 12460
Buggy source:
public static void main(String[] args){
  try {
    SynBioHubFrontend sbh=new SynBioHubFrontend("String_Node_Str","String_Node_Str");
    String result=sbh.sparqlQuery("String_Node_Str");
    System.out.println(result);
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SBOLReader.setURIPrefix("String_Node_Str");
    SBOLDocument doc=SBOLReader.read("String_Node_Str");
    SBOLValidate.validateSBOL(doc,true,true,true);
    for (    String error : SBOLValidate.getErrors()) {
      System.out.println(error);
    }
    doc.write("String_Node_Str");
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}