nus-yam/ex-repair huggingface dataset:
Program: 12463
Project: 12463
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();
  String documentURIPrefix=extractDocumentURIPrefix();
  HashMap<URI,URI> uriMap=new HashMap<URI,URI>();
  for (  TopLevel topLevel : this.getTopLevels()) {
    TopLevel newTL=document.createCopy(topLevel,URIPrefix,null,version);
    uriMap.put(topLevel.getIdentity(),newTL.getIdentity());
  }
  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();
  String documentURIPrefix=extractDocumentURIPrefix();
  HashMap<URI,URI> uriMap=new HashMap<URI,URI>();
  for (  TopLevel topLevel : this.getTopLevels()) {
    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: 12467
Project: 12467
Buggy source:
/** 
 * Renames the given top-level's URI prefix, display ID, and version with the given ones.   <p> This method first calls   {@link #createCopy(TopLevel,String,String,String)} to make a copy ofthe given top-level with the URI prefix, display ID, and version. It then removes the given top-level and then returns the newly-copied top-level. 
 * @param topLevel the top-level to be renamed
 * @param URIprefix the given URI prefix to be rename to 
 * @param displayId the given display ID to be renamed to  
 * @param version the given version to be renamed to
 * @return the renamed top-level 
 * @throws SBOLValidationException if either of the following conditions is satisfied:<ul> <li>any of the following SBOL validation rules was violated:  10513, 10604, 11608, 11703, 12103; or</li> <li>an SBOL validation rule violation occurred in the following method:  {@link #createCopy(TopLevel,String,String,String)}.</li> </ul>
 */
public TopLevel rename(TopLevel topLevel,String URIprefix,String displayId,String version) throws SBOLValidationException {
  TopLevel renamedTopLevel=createCopy(topLevel,URIprefix,displayId,version);
  removeTopLevel(topLevel);
  updateReferences(topLevel.getIdentity(),renamedTopLevel.getIdentity());
  updateReferences(topLevel.getPersistentIdentity(),renamedTopLevel.getPersistentIdentity());
  return renamedTopLevel;
}

Fixed version (ground truth):
/** 
 * Renames the given top-level's URI prefix, display ID, and version with the given ones.   <p> This method first calls   {@link #createCopy(TopLevel,String,String,String)} to make a copy ofthe given top-level with the URI prefix, display ID, and version. It then removes the given top-level and then returns the newly-copied top-level. 
 * @param topLevel the top-level to be renamed
 * @param URIprefix the given URI prefix to be rename to 
 * @param displayId the given display ID to be renamed to  
 * @param version the given version to be renamed to
 * @return the renamed top-level 
 * @throws SBOLValidationException if either of the following conditions is satisfied:<ul> <li>any of the following SBOL validation rules was violated:  10513, 10604, 11608, 11703, 12103; or</li> <li>an SBOL validation rule violation occurred in the following method:  {@link #createCopy(TopLevel,String,String,String)}.</li> </ul>
 */
public TopLevel rename(TopLevel topLevel,String URIprefix,String displayId,String version) throws SBOLValidationException {
  if ((URIprefix == null || URIcompliance.extractURIprefix(topLevel.getIdentity()).equals(URIprefix)) && (displayId == null || topLevel.getDisplayId().equals(displayId)) && (version == null || topLevel.getVersion().equals(version))) {
    return topLevel;
  }
  TopLevel renamedTopLevel=createCopy(topLevel,URIprefix,displayId,version);
  removeTopLevel(topLevel);
  updateReferences(topLevel.getIdentity(),renamedTopLevel.getIdentity());
  updateReferences(topLevel.getPersistentIdentity(),renamedTopLevel.getPersistentIdentity());
  return renamedTopLevel;
}
Program: 12470
Project: 12470
Buggy source:
public static void main(String[] args){
  try {
    SBOLDocument doc2=new SBOLDocument();
    doc2.setDefaultURIprefix("String_Node_Str");
    doc2.setComplete(true);
    SynBioHubFrontend sfe=doc2.addRegistry("String_Node_Str","String_Node_Str");
    HashSet<URI> collections=new HashSet<URI>();
    collections.add(URI.create("String_Node_Str"));
    System.out.println(sfe.getMatchingComponentDefinitionMetadata(null,null,null,collections,0,10));
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SBOLReader.setURIPrefix("String_Node_Str");
    SBOLDocument doc3=SBOLReader.read("String_Node_Str");
    doc3.write(System.out);
    SBOLDocument doc2=new SBOLDocument();
    doc2.setDefaultURIprefix("String_Node_Str");
    doc2.setComplete(true);
    SynBioHubFrontend sfe=doc2.addRegistry("String_Node_Str","String_Node_Str");
    HashSet<URI> collections=new HashSet<URI>();
    collections.add(URI.create("String_Node_Str"));
    System.out.println(sfe.getMatchingComponentDefinitionMetadata(null,null,null,collections,0,10));
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 12474
Project: 12474
Buggy source:
/** 
 * Removes the given namespace URI from this SBOL document's list of namespaces.
 * @param namespaceURI the namespaceURI to be removed
 */
public void removeNamespace(URI namespaceURI){
  if (isRequiredNamespaceBinding(namespaceURI)) {
    throw new IllegalStateException("String_Node_Str" + namespaceURI.toString());
  }
  nameSpaces.remove(namespaceURI.toString());
}

Fixed version (ground truth):
/** 
 * Removes the given namespace URI from this SBOL document's list of namespaces.
 * @param namespaceURI the namespaceURI to be removed
 */
public void removeNamespace(URI namespaceURI){
  if (isRequiredNamespaceBinding(namespaceURI)) {
    throw new IllegalStateException("String_Node_Str" + namespaceURI.toString());
  }
  String prefix=getNamespace(namespaceURI).getPrefix();
  nameSpaces.remove(prefix);
}
Program: 12475
Project: 12475
Buggy source:
/** 
 * Removes all non-required namespaces from this SBOL document. <p> This method calls   {@link #removeNamespace(URI)} to iteratively remove each non-required namespace.
 */
public void clearNamespaces(){
  Object[] keySetArray=nameSpaces.keySet().toArray();
  for (  Object key : keySetArray) {
    if (isRequiredNamespaceBinding(URI.create((String)key)))     continue;
    removeNamespace(URI.create((String)key));
  }
}

Fixed version (ground truth):
/** 
 * Removes all non-required namespaces from this SBOL document. <p> This method calls   {@link #removeNamespace(URI)} to iteratively remove each non-required namespace.
 */
public void clearNamespaces(){
  Object[] keySetArray=nameSpaces.keySet().toArray();
  for (  Object key : keySetArray) {
    if (isRequiredNamespaceBinding(URI.create((String)key)))     continue;
    nameSpaces.remove((String)key);
  }
}
Program: 12477
Project: 12477
Buggy source:
public static void main(String[] args){
  try {
    SBOLDocument doc2=new SBOLDocument();
    doc2.setDefaultURIprefix("String_Node_Str");
    SynBioHubFrontend sfe=doc2.addRegistry("String_Node_Str","String_Node_Str");
    System.out.println(sfe.getRootCollectionMetadata());
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SBOLDocument doc=SBOLReader.read("String_Node_Str");
    doc.write(System.out);
    SBOLDocument doc2=new SBOLDocument();
    doc2.setDefaultURIprefix("String_Node_Str");
    SynBioHubFrontend sfe=doc2.addRegistry("String_Node_Str","String_Node_Str");
    System.out.println(sfe.getRootCollectionMetadata());
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 12480
Project: 12480
Buggy source:
private static boolean stradlesOrigin(SequenceAnnotation sa){
  Annotation annotation=sa.getAnnotation(new QName(GBNAMESPACE,STRADLESORIGIN,GBPREFIX));
  if (annotation != null) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
private static boolean stradlesOrigin(SequenceAnnotation sa){
  Annotation annotation=sa.getAnnotation(new QName(GBCONVNAMESPACE,STRADLESORIGIN,GBCONVPREFIX));
  if (annotation != null) {
    return true;
  }
  return false;
}
Program: 12484
Project: 12484
Buggy source:
public static void main(String[] args){
  try {
    SBOLDocument doc2=new SBOLDocument();
    doc2.setDefaultURIprefix("String_Node_Str");
    doc2.setComplete(true);
    SynBioHubFrontend sfe=doc2.addRegistry("String_Node_Str","String_Node_Str");
    System.out.println(sfe.getCountTopLevels("String_Node_Str"));
    doc2.getComponentDefinition(URI.create("String_Node_Str"));
    SBOLWriter.write(doc2,System.out);
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SBOLDocument doc2=new SBOLDocument();
    doc2.setDefaultURIprefix("String_Node_Str");
    doc2.setComplete(true);
    SynBioHubFrontend sfe=doc2.addRegistry("String_Node_Str","String_Node_Str");
    System.out.println(sfe.getCountTopLevels("String_Node_Str"));
    doc2.getComponentDefinition(URI.create("String_Node_Str"));
    SBOLWriter.write(doc2,System.out);
    sfe.login("String_Node_Str","String_Node_Str");
    sfe.submit("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",doc2);
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 12486
Project: 12486
Buggy source:
/** 
 * Sets the wasDerivedFrom property of this instance to the given one.
 * @param wasDerivedFrom the wasDerivedFrom property to set to 
 * @throws SBOLValidationException if the following SBOL validation rules was violated: 10303, 10304, 10305. 
 */
public void setWasDerivedFrom(URI wasDerivedFrom) throws SBOLValidationException {
  if (sbolDocument != null) {
    if (!SBOLValidate.checkWasDerivedFromVersion(sbolDocument,this,wasDerivedFrom)) {
      throw new SBOLValidationException("String_Node_Str",this);
    }
    SBOLValidate.checkWasDerivedFromCycle(sbolDocument,this,wasDerivedFrom,new HashSet<URI>());
  }
  this.wasDerivedFrom=wasDerivedFrom;
}

Fixed version (ground truth):
/** 
 * Sets the wasDerivedFrom property of this instance to the given one.
 * @param wasDerivedFrom the wasDerivedFrom property to set to 
 * @throws SBOLValidationException if the following SBOL validation rules was violated: 10303, 10304, 10305. 
 */
public void setWasDerivedFrom(URI wasDerivedFrom) throws SBOLValidationException {
  if (sbolDocument != null) {
    if (!SBOLValidate.checkWasDerivedFromVersion(sbolDocument,this,wasDerivedFrom)) {
      throw new SBOLValidationException("String_Node_Str",this);
    }
    SBOLValidate.checkWasDerivedFromCycle(sbolDocument,this,wasDerivedFrom,new HashSet<URI>());
  }
  clearWasDerivedFroms();
  addWasDerivedFrom(wasDerivedFrom);
}
Program: 12487
Project: 12487
Buggy source:
/** 
 * Test if the wasDerivedFrom property is set.
 * @return {@code true} if it is not {@code null}, or   {@code false} otherwise
 */
public boolean isSetWasDerivedFrom(){
  return wasDerivedFrom != null;
}

Fixed version (ground truth):
/** 
 * Test if the wasDerivedFrom property is set.
 * @return {@code true} if it is not {@code null}, or   {@code false} otherwise
 */
public boolean isSetWasDerivedFrom(){
  return wasDerivedFroms.size() > 0;
}
Program: 12488
Project: 12488
Buggy source:
/** 
 * Sets the wasDerivedFrom property to   {@code null}.
 */
public void unsetWasDerivedFrom(){
  wasDerivedFrom=null;
}

Fixed version (ground truth):
/** 
 * Sets the wasDerivedFrom property to   {@code null}.
 */
public void unsetWasDerivedFrom(){
  clearWasDerivedFroms();
}
Program: 12490
Project: 12490
Buggy source:
/** 
 * Returns the wasDerivedFrom property of this instance.
 * @return the wasDerivedFrom property of this instance.
 */
public URI getWasDerivedFrom(){
  return wasDerivedFrom;
}

Fixed version (ground truth):
/** 
 * Returns the wasDerivedFrom property of this instance.
 * @return the wasDerivedFrom property of this instance.
 */
public URI getWasDerivedFrom(){
  URI wasDerivedFrom=null;
  if (wasDerivedFroms.size() > 0) {
    wasDerivedFrom=(URI)wasDerivedFroms.toArray()[0];
  }
  return wasDerivedFrom;
}
Program: 12491
Project: 12491
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + identity + (this.isSetPersistentIdentity() ? "String_Node_Str" + persistentIdentity : "String_Node_Str")+ (this.isSetDisplayId() ? "String_Node_Str" + displayId : "String_Node_Str")+ (this.isSetVersion() ? "String_Node_Str" + version : "String_Node_Str")+ (this.isSetName() ? "String_Node_Str" + name : "String_Node_Str")+ (this.isSetDescription() ? "String_Node_Str" + description : "String_Node_Str")+ (annotations.size() > 0 ? "String_Node_Str" + annotations : "String_Node_Str")+ (this.isSetWasDerivedFrom() ? "String_Node_Str" + wasDerivedFrom : "String_Node_Str");
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + identity + (this.isSetPersistentIdentity() ? "String_Node_Str" + persistentIdentity : "String_Node_Str")+ (this.isSetDisplayId() ? "String_Node_Str" + displayId : "String_Node_Str")+ (this.isSetVersion() ? "String_Node_Str" + version : "String_Node_Str")+ (this.isSetName() ? "String_Node_Str" + name : "String_Node_Str")+ (this.isSetDescription() ? "String_Node_Str" + description : "String_Node_Str")+ (annotations.size() > 0 ? "String_Node_Str" + annotations : "String_Node_Str")+ (wasDerivedFroms.size() > 0 ? "String_Node_Str" + wasDerivedFroms : "String_Node_Str");
}
Program: 12492
Project: 12492
Buggy source:
void addNamespaceBinding(NamespaceBinding namespaceBinding) throws SBOLValidationException {
  if (!namespaceBinding.getNamespaceURI().endsWith("String_Node_Str") && !namespaceBinding.getNamespaceURI().endsWith("String_Node_Str") && !namespaceBinding.getNamespaceURI().endsWith("String_Node_Str")) {
    throw new SBOLValidationException("String_Node_Str");
  }
  nameSpaces.put(namespaceBinding.getPrefix(),namespaceBinding);
}

Fixed version (ground truth):
void addNamespaceBinding(NamespaceBinding namespaceBinding) throws SBOLValidationException {
  if (!namespaceBinding.getNamespaceURI().endsWith("String_Node_Str") && !namespaceBinding.getNamespaceURI().endsWith("String_Node_Str") && !namespaceBinding.getNamespaceURI().endsWith("String_Node_Str")) {
    throw new SBOLValidationException("String_Node_Str");
  }
  nameSpaces.put(namespaceBinding.getNamespaceURI(),namespaceBinding);
}
Program: 12493
Project: 12493
Buggy source:
/** 
 * Creates a new SBOLDocument instance with one empty list for the namespaces and one for each top-level instance, and then adds the following namespaces:   {@link Sbol2Terms#sbol2},   {@link Sbol1Terms#rdf},   {@link Sbol2Terms#dc}, and   {@link Sbol2Terms#prov}.
 */
public SBOLDocument(){
  genericTopLevels=new HashMap<>();
  collections=new HashMap<>();
  componentDefinitions=new HashMap<>();
  models=new HashMap<>();
  moduleDefinitions=new HashMap<>();
  sequences=new HashMap<>();
  nameSpaces=new HashMap<>();
  nameSpaces.put(Sbol2Terms.sbol2.getPrefix(),Sbol2Terms.sbol2);
  nameSpaces.put(Sbol1Terms.rdf.getPrefix(),Sbol1Terms.rdf);
  nameSpaces.put(Sbol2Terms.dc.getPrefix(),Sbol2Terms.dc);
  nameSpaces.put(Sbol2Terms.prov.getPrefix(),Sbol2Terms.prov);
  prefixes=new HashSet<>();
  registries=new HashMap<>();
}

Fixed version (ground truth):
/** 
 * Creates a new SBOLDocument instance with one empty list for the namespaces and one for each top-level instance, and then adds the following namespaces:   {@link Sbol2Terms#sbol2},   {@link Sbol1Terms#rdf},   {@link Sbol2Terms#dc}, and   {@link Sbol2Terms#prov}.
 */
public SBOLDocument(){
  genericTopLevels=new HashMap<>();
  collections=new HashMap<>();
  componentDefinitions=new HashMap<>();
  models=new HashMap<>();
  moduleDefinitions=new HashMap<>();
  sequences=new HashMap<>();
  nameSpaces=new HashMap<>();
  nameSpaces.put(Sbol2Terms.sbol2.getNamespaceURI(),Sbol2Terms.sbol2);
  nameSpaces.put(Sbol1Terms.rdf.getNamespaceURI(),Sbol1Terms.rdf);
  nameSpaces.put(Sbol2Terms.dc.getNamespaceURI(),Sbol2Terms.dc);
  nameSpaces.put(Sbol2Terms.prov.getNamespaceURI(),Sbol2Terms.prov);
  prefixes=new HashSet<>();
  registries=new HashMap<>();
}
Program: 12494
Project: 12494
Buggy source:
@Test public void test_namespaceMethods() throws URISyntaxException, SBOLValidationException {
  List<QName> doc_namespaces=doc.getNamespaces();
  doc_namespaces.get(0);
  assertTrue(doc.getNamespaces().size() == 4);
  QName created_ns=new QName("String_Node_Str");
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.removeNamespace(new URI(created_ns.getNamespaceURI()));
  assertTrue(doc.getNamespace(new URI(created_ns.getNamespaceURI())).toString().length() == 0);
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.clearNamespaces();
}

Fixed version (ground truth):
@Test public void test_namespaceMethods() throws URISyntaxException, SBOLValidationException {
  List<QName> doc_namespaces=doc.getNamespaces();
  doc_namespaces.get(0);
  assertTrue(doc.getNamespaces().size() == 4);
  QName created_ns=new QName("String_Node_Str","String_Node_Str");
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.clearNamespaces();
}
Program: 12496
Project: 12496
Buggy source:
/** 
 * Removes the given namespace URI from this SBOL document's list of namespaces.
 * @param namespaceURI the namespaceURI to be removed
 */
public void removeNamespace(URI namespaceURI){
  if (isRequiredNamespaceBinding(namespaceURI)) {
    throw new IllegalStateException("String_Node_Str" + namespaceURI.toString());
  }
  nameSpaces.remove(namespaceURI);
}

Fixed version (ground truth):
/** 
 * Removes the given namespace URI from this SBOL document's list of namespaces.
 * @param namespaceURI the namespaceURI to be removed
 */
public void removeNamespace(URI namespaceURI){
  if (isRequiredNamespaceBinding(namespaceURI)) {
    throw new IllegalStateException("String_Node_Str" + namespaceURI.toString());
  }
  nameSpaces.remove(namespaceURI.toString());
}
Program: 12497
Project: 12497
Buggy source:
@Test public void test_namespaceMethods() throws URISyntaxException, SBOLValidationException {
  List<QName> doc_namespaces=doc.getNamespaces();
  doc_namespaces.get(0);
  assertTrue(doc.getNamespaces().size() == 4);
  QName created_ns=new QName("String_Node_Str","String_Node_Str");
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.clearNamespaces();
}

Fixed version (ground truth):
@Test public void test_namespaceMethods() throws URISyntaxException, SBOLValidationException {
  List<QName> doc_namespaces=doc.getNamespaces();
  doc_namespaces.get(0);
  assertTrue(doc.getNamespaces().size() == 4);
  QName created_ns=new QName("String_Node_Str","String_Node_Str");
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.removeNamespace(new URI(created_ns.getNamespaceURI()));
  assertTrue(doc.getNamespace(new URI(created_ns.getNamespaceURI())) == null);
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.clearNamespaces();
}
Program: 12499
Project: 12499
Buggy source:
public static void main(String[] args){
  try {
    SBOLDocument doc2=new SBOLDocument();
    doc2.setDefaultURIprefix("String_Node_Str");
    doc2.setComplete(false);
    doc2.createSequence("String_Node_Str","String_Node_Str","String_Node_Str",Sequence.IUPAC_DNA);
    StackFrontend sfe=doc2.addRegistry("String_Node_Str");
    sfe.login("String_Node_Str","String_Node_Str");
    sfe.submit("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",doc2);
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public static void main(String[] args){
  try {
    SBOLDocument doc2=new SBOLDocument();
    doc2.setDefaultURIprefix("String_Node_Str");
    doc2.setComplete(false);
    ComponentDefinition cd=doc2.createComponentDefinition("String_Node_Str","String_Node_Str",ComponentDefinition.DNA);
    cd.addSequence(URI.create("String_Node_Str"));
    SBOLWriter.write(doc2,System.out);
    StackFrontend sfe=doc2.addRegistry("String_Node_Str");
    sfe.login("String_Node_Str","String_Node_Str");
    sfe.submit("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str",doc2);
  }
 catch (  Throwable e) {
    e.printStackTrace();
  }
}
Program: 12500
Project: 12500
Buggy source:
static boolean checkWasDerivedFromVersion(SBOLDocument sbolDocument,Identified identified,URI wasDerivedFrom){
  Identified derivedFrom=sbolDocument.getTopLevel(wasDerivedFrom);
  if ((derivedFrom != null) && (derivedFrom.isSetPersistentIdentity() && identified.isSetPersistentIdentity()) && (derivedFrom.getPersistentIdentity().equals(identified.getPersistentIdentity()))&& (derivedFrom.isSetVersion() && identified.isSetVersion())&& (Version.isFirstVersionNewer(derivedFrom.getVersion(),identified.getVersion()))) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
static boolean checkWasDerivedFromVersion(SBOLDocument sbolDocument,Identified identified,URI wasDerivedFrom){
  String wasDerivedFromPI=URIcompliance.extractPersistentId(wasDerivedFrom);
  if (wasDerivedFromPI == null || !wasDerivedFromPI.equals(identified.getPersistentIdentity())) {
    return true;
  }
  Identified derivedFrom=sbolDocument.getTopLevel(wasDerivedFrom);
  if ((derivedFrom != null) && (derivedFrom.isSetPersistentIdentity() && identified.isSetPersistentIdentity()) && (derivedFrom.getPersistentIdentity().equals(identified.getPersistentIdentity()))&& (derivedFrom.isSetVersion() && identified.isSetVersion())&& (Version.isFirstVersionNewer(derivedFrom.getVersion(),identified.getVersion()))) {
    return false;
  }
  return true;
}
Program: 12501
Project: 12501
Buggy source:
/** 
 * Removes all registries from this SBOL document. <p> This method calls   {@link #removeRegistry(URI)} to iteratively remove each registry.
 */
public void clearRegistries(){
  Object[] keySetArray=registries.keySet().toArray();
  for (  Object key : keySetArray) {
    removeRegistry((String)key);
  }
}

Fixed version (ground truth):
/** 
 * Removes all registries from this SBOL document. <p> This method calls   {@link #removeRegistry(String)} to iteratively remove each registry.
 */
public void clearRegistries(){
  Object[] keySetArray=registries.keySet().toArray();
  for (  Object key : keySetArray) {
    removeRegistry((String)key);
  }
}
Program: 12502
Project: 12502
Buggy source:
static boolean checkWasDerivedFromVersion(SBOLDocument sbolDocument,Identified identified,URI wasDerivedFrom){
  String wasDerivedFromPI=URIcompliance.extractPersistentId(wasDerivedFrom);
  if (wasDerivedFromPI == null || !wasDerivedFromPI.equals(identified.getPersistentIdentity())) {
    return true;
  }
  Identified derivedFrom=sbolDocument.getTopLevel(wasDerivedFrom);
  if ((derivedFrom != null) && (derivedFrom.isSetPersistentIdentity() && identified.isSetPersistentIdentity()) && (derivedFrom.getPersistentIdentity().equals(identified.getPersistentIdentity()))&& (derivedFrom.isSetVersion() && identified.isSetVersion())&& (Version.isFirstVersionNewer(derivedFrom.getVersion(),identified.getVersion()))) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
static boolean checkWasDerivedFromVersion(SBOLDocument sbolDocument,Identified identified,URI wasDerivedFrom){
  String wasDerivedFromPI=URIcompliance.extractPersistentId(wasDerivedFrom);
  if (wasDerivedFromPI == null || !wasDerivedFromPI.equals(identified.getPersistentIdentity().toString())) {
    return true;
  }
  Identified derivedFrom=sbolDocument.getTopLevel(wasDerivedFrom);
  if ((derivedFrom != null) && (derivedFrom.isSetPersistentIdentity() && identified.isSetPersistentIdentity()) && (derivedFrom.getPersistentIdentity().equals(identified.getPersistentIdentity()))&& (derivedFrom.isSetVersion() && identified.isSetVersion())&& (Version.isFirstVersionNewer(derivedFrom.getVersion(),identified.getVersion()))) {
    return false;
  }
  return true;
}
Program: 12503
Project: 12503
Buggy source:
private static void checkComponentDefinitionCompleteness(SBOLDocument sbolDocument,ComponentDefinition componentDefinition){
  for (  URI sequenceURI : componentDefinition.getSequenceURIs()) {
    if (sbolDocument.getSequence(sequenceURI) == null) {
      errors.add(new SBOLValidationException("String_Node_Str",componentDefinition).getMessage());
    }
  }
  for (  Component component : componentDefinition.getComponents()) {
    if (component.getDefinition() == null) {
      errors.add(new SBOLValidationException("String_Node_Str",component).getMessage());
    }
    for (    MapsTo mapsTo : component.getMapsTos()) {
      if (mapsTo.getRemote() == null) {
        errors.add(new SBOLValidationException("String_Node_Str",mapsTo).getMessage());
        continue;
      }
      if (mapsTo.getRemote().getAccess().equals(AccessType.PRIVATE)) {
        errors.add(new SBOLValidationException("String_Node_Str",mapsTo).getMessage());
      }
      if (mapsTo.getRefinement().equals(RefinementType.VERIFYIDENTICAL)) {
        if (!mapsTo.getLocal().getDefinitionURI().equals(mapsTo.getRemote().getDefinitionURI())) {
          errors.add(new SBOLValidationException("String_Node_Str").getMessage());
        }
      }
    }
  }
}

Fixed version (ground truth):
private static void checkComponentDefinitionCompleteness(SBOLDocument sbolDocument,ComponentDefinition componentDefinition){
  for (  URI sequenceURI : componentDefinition.getSequenceURIs()) {
    if (sbolDocument.getSequence(sequenceURI) == null) {
      errors.add(new SBOLValidationException("String_Node_Str",componentDefinition).getMessage());
    }
  }
  for (  Component component : componentDefinition.getComponents()) {
    if (component.getDefinition() == null) {
      errors.add(new SBOLValidationException("String_Node_Str",component).getMessage());
    }
    for (    MapsTo mapsTo : component.getMapsTos()) {
      if (mapsTo.getRemote() == null) {
        errors.add(new SBOLValidationException("String_Node_Str",mapsTo).getMessage());
        continue;
      }
      if (mapsTo.getRemote().getAccess().equals(AccessType.PRIVATE)) {
        errors.add(new SBOLValidationException("String_Node_Str",mapsTo).getMessage());
      }
      if (mapsTo.getRefinement().equals(RefinementType.VERIFYIDENTICAL)) {
        if (!mapsTo.getLocal().getDefinitionURI().equals(mapsTo.getRemote().getDefinitionURI())) {
          errors.add(new SBOLValidationException("String_Node_Str",mapsTo).getMessage());
        }
      }
    }
  }
}
Program: 12505
Project: 12505
Buggy source:
void copy(Component component) throws SBOLValidationException {
  ((ComponentInstance)this).copy((ComponentInstance)component);
  if (!component.getMapsTos().isEmpty()) {
    for (    MapsTo mapsTo : component.getMapsTos()) {
      MapsTo newMapsTo=this.createMapsTo(mapsTo.getDisplayId(),mapsTo.getRefinement(),mapsTo.getLocalURI(),mapsTo.getRemoteURI());
      newMapsTo.copy(mapsTo);
    }
  }
  for (  URI role : component.getRoles()) {
    this.addRole(URI.create(role.toString()));
  }
}

Fixed version (ground truth):
void copy(Component component) throws SBOLValidationException {
  ((ComponentInstance)this).copy((ComponentInstance)component);
  if (!component.getMapsTos().isEmpty()) {
    for (    MapsTo mapsTo : component.getMapsTos()) {
      MapsTo newMapsTo=this.createMapsTo(mapsTo.getDisplayId(),mapsTo.getRefinement(),mapsTo.getLocal().getDisplayId(),mapsTo.getRemoteURI());
      newMapsTo.copy(mapsTo);
    }
  }
  for (  URI role : component.getRoles()) {
    this.addRole(URI.create(role.toString()));
  }
}
Program: 12506
Project: 12506
Buggy source:
void copy(FunctionalComponent functionalComponent) throws SBOLValidationException {
  ((ComponentInstance)this).copy((ComponentInstance)functionalComponent);
  this.mapsTos=new HashMap<>();
  if (!functionalComponent.getMapsTos().isEmpty()) {
    for (    MapsTo mapsTo : functionalComponent.getMapsTos()) {
      MapsTo newMapsTo=this.createMapsTo(mapsTo.getDisplayId(),mapsTo.getRefinement(),mapsTo.getLocalURI(),mapsTo.getRemoteURI());
      newMapsTo.copy(mapsTo);
    }
  }
}

Fixed version (ground truth):
void copy(FunctionalComponent functionalComponent) throws SBOLValidationException {
  ((ComponentInstance)this).copy((ComponentInstance)functionalComponent);
  this.mapsTos=new HashMap<>();
  if (!functionalComponent.getMapsTos().isEmpty()) {
    for (    MapsTo mapsTo : functionalComponent.getMapsTos()) {
      MapsTo newMapsTo=this.createMapsTo(mapsTo.getDisplayId(),mapsTo.getRefinement(),mapsTo.getLocal().getDisplayId(),mapsTo.getRemoteURI());
      newMapsTo.copy(mapsTo);
    }
  }
}
Program: 12507
Project: 12507
Buggy source:
void copy(Interaction interaction) throws SBOLValidationException {
  ((Identified)this).copy(interaction);
  for (  Participation participation : interaction.getParticipations()) {
    Participation newParticipation=this.createParticipation(participation.getDisplayId(),participation.getParticipantURI(),participation.getRoles());
    newParticipation.copy(participation);
  }
}

Fixed version (ground truth):
void copy(Interaction interaction) throws SBOLValidationException {
  ((Identified)this).copy(interaction);
  for (  Participation participation : interaction.getParticipations()) {
    Participation newParticipation=this.createParticipation(participation.getDisplayId(),participation.getParticipant().getDisplayId(),participation.getRoles());
    newParticipation.copy(participation);
  }
}
Program: 12508
Project: 12508
Buggy source:
void copy(Module module) throws SBOLValidationException {
  ((Identified)this).copy((Identified)module);
  if (!module.getMapsTos().isEmpty()) {
    for (    MapsTo mapsTo : module.getMapsTos()) {
      MapsTo newMapsTo=this.createMapsTo(mapsTo.getDisplayId(),mapsTo.getRefinement(),mapsTo.getLocalURI(),mapsTo.getRemoteURI());
      newMapsTo.copy(mapsTo);
    }
  }
}

Fixed version (ground truth):
void copy(Module module) throws SBOLValidationException {
  ((Identified)this).copy((Identified)module);
  if (!module.getMapsTos().isEmpty()) {
    for (    MapsTo mapsTo : module.getMapsTos()) {
      MapsTo newMapsTo=this.createMapsTo(mapsTo.getDisplayId(),mapsTo.getRefinement(),mapsTo.getLocal().getDisplayId(),mapsTo.getRemoteURI());
      newMapsTo.copy(mapsTo);
    }
  }
}
Program: 12511
Project: 12511
Buggy source:
@Override void checkDescendantsURIcompliance() throws SBOLValidationException {
  URIcompliance.isTopLevelURIformCompliant(this.getIdentity());
}

Fixed version (ground truth):
@Override void checkDescendantsURIcompliance(){
}
Program: 12513
Project: 12513
Buggy source:
@Override void checkDescendantsURIcompliance() throws SBOLValidationException {
  URIcompliance.isTopLevelURIformCompliant(this.getIdentity());
}

Fixed version (ground truth):
@Override void checkDescendantsURIcompliance(){
}
Program: 12514
Project: 12514
Buggy source:
@Override void checkDescendantsURIcompliance() throws SBOLValidationException {
  URIcompliance.isTopLevelURIformCompliant(this.getIdentity());
}

Fixed version (ground truth):
@Override void checkDescendantsURIcompliance(){
}
Program: 12515
Project: 12515
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + super.toString() + "String_Node_Str"+ source+ "String_Node_Str"+ language+ "String_Node_Str"+ framework+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + "String_Node_Str" + this.getIdentity() + (this.isSetDisplayId() ? "String_Node_Str" + this.getDisplayId() : "String_Node_Str")+ (this.isSetName() ? "String_Node_Str" + this.getName() : "String_Node_Str")+ (this.isSetDescription() ? "String_Node_Str" + this.getDescription() : "String_Node_Str")+ "String_Node_Str"+ source+ "String_Node_Str"+ language+ "String_Node_Str"+ framework+ "String_Node_Str";
}
Program: 12517
Project: 12517
Buggy source:
/** 
 * @param identity a given identifier for this object
 * @return the new module definition
 * @throws SBOLValidationException if any of the following SBOL validation rules was violated: 10201, 10202, 10220.
 */
private ModuleDefinition createModuleDefinition(URI identity) throws SBOLValidationException {
  ModuleDefinition newModule=new ModuleDefinition(identity);
  addModuleDefinition(newModule);
  return newModule;
}

Fixed version (ground truth):
/** 
 * Creates a module definition with the given arguments, and then adds it to this SBOL document's list of module definitions. <p> This method first creates a compliant URI for the module definition to be retrieved. It starts with  the given URI prefix after its been successfully validated, optionally followed by its type, namely   {@link TopLevel#MODULE_DEFINITION}, followed by the given display ID, and ends with the given version.
 * @param URIprefix the URI prefix used to construct the compliant URI for the module definition to be created
 * @param displayId the display ID of the module definition to be created
 * @param version the version of the module definition to be created
 * @return the created module definition
 * @throws SBOLValidationException if any of the following SBOL validation rules was violated: 10201, 10202, 10204, 10206, 10220.
 */
public ModuleDefinition createModuleDefinition(String URIprefix,String displayId,String version) throws SBOLValidationException {
  URIprefix=URIcompliance.checkURIprefix(URIprefix);
  ModuleDefinition md=new ModuleDefinition(createCompliantURI(URIprefix,TopLevel.MODULE_DEFINITION,displayId,version,typesInURIs));
  md.setPersistentIdentity(createCompliantURI(URIprefix,TopLevel.MODULE_DEFINITION,displayId,"String_Node_Str",typesInURIs));
  md.setDisplayId(displayId);
  md.setVersion(version);
  addModuleDefinition(md);
  return md;
}
Program: 12518
Project: 12518
Buggy source:
/** 
 * @param identity a given identifier for this object
 * @param rdfType a given QName for this annotated GenericTopLevel object
 * @return the new generic top level
 * @throws SBOLValidationException if any of the following condition is satisfied:<ul> <li>the following SBOL validation rule was violated: 12302;</li> <li>an SBOL validation rule violation occurred in  {@link GenericTopLevel#GenericTopLevel(URI,QName)}; or </li> <li>an SBOL validation rule violation occurred in   {@link #addGenericTopLevel(GenericTopLevel)}.</li> </ul>
 */
private GenericTopLevel createGenericTopLevel(URI identity,QName rdfType) throws SBOLValidationException {
  if (rdfType.getNamespaceURI().equals(Sbol2Terms.sbol2.getNamespaceURI()) || rdfType.getNamespaceURI().equals(Sbol1Terms.sbol1.getNamespaceURI())) {
    throw new SBOLValidationException("String_Node_Str");
  }
  GenericTopLevel newGenericTopLevel=new GenericTopLevel(identity,rdfType);
  addGenericTopLevel(newGenericTopLevel);
  return newGenericTopLevel;
}

Fixed version (ground truth):
/** 
 * Creates a generic top-level, and then adds it to this SBOL document's list of generic top-levels. <p> This method calls   {@link #createGenericTopLevel(String,String,String,QName)} with the default URIprefix of this SBOL document, the given component definition display ID and version, and the given RDF type. 
 * @param URIprefix the given URI prefix used to create a compliant URI for the generic top-level to be created 
 * @param displayId the display ID of the generic top-level to be created
 * @param version the version of the generic top-level to be created
 * @param rdfType the type of the generic top-level to be created
 * @return the created generic top-level
 * @throws SBOLValidationException if an SBOL validation rules was violated:10201, 10202, 10204, 10206, 10220, 10303, 10304, 10305, 10401, 10501, 10701, 10801, 10901, 11101, 11201, 11301,  11401, 11501, 11601, 11701, 11801, 11901, 12001, 12301, 12302. 
 */
public GenericTopLevel createGenericTopLevel(String URIprefix,String displayId,String version,QName rdfType) throws SBOLValidationException {
  URIprefix=URIcompliance.checkURIprefix(URIprefix);
  if (rdfType.getNamespaceURI().equals(Sbol2Terms.sbol2.getNamespaceURI()) || rdfType.getNamespaceURI().equals(Sbol1Terms.sbol1.getNamespaceURI())) {
    throw new SBOLValidationException("String_Node_Str");
  }
  GenericTopLevel g=new GenericTopLevel(createCompliantURI(URIprefix,TopLevel.GENERIC_TOP_LEVEL,displayId,version,typesInURIs),rdfType);
  g.setPersistentIdentity(createCompliantURI(URIprefix,TopLevel.GENERIC_TOP_LEVEL,displayId,"String_Node_Str",typesInURIs));
  g.setDisplayId(displayId);
  g.setVersion(version);
  addGenericTopLevel(g);
  return g;
}
Program: 12519
Project: 12519
Buggy source:
/** 
 * @param identity a given identifier for this object
 * @param version The given version for this object
 * @param source location of the actual content of the model
 * @param language the language in which the model is implemented
 * @param framework the framework in which the model is implemented
 * @return the new model
 * @throws SBOLValidationException if an SBOL validation rule violation occurred in either of the followingconstructor or method: <ul> <li> {@link Model#Model(URI,URI,URI,URI)}, or</li> <li>  {@link #addModel(Model)}.</li> </ul>
 */
private Model createModel(URI identity,URI source,URI language,URI framework) throws SBOLValidationException {
  Model newModel=new Model(identity,source,language,framework);
  addModel(newModel);
  return newModel;
}

Fixed version (ground truth):
/** 
 * Creates a model, and then adds it to this SBOL document's list of models. <p> This method first creates a compliant URI for the model to be created. It starts with the  given URI prefix, followed by the given display ID, and ends with the given version. 
 * @param URIprefix the URI prefix used to construct the compliant URI for the model to be created
 * @param displayId the display ID of the model to be created
 * @param version the version of the model to be created
 * @param source the source of the model to be created
 * @param language the language of the model to be created
 * @param framework the framework of the model to be created
 * @return the created model 
 * @throws SBOLValidationException if any of the following SBOL validation rules was violated: 10201, 10202, 10204, 10206, 10220,   10303, 10304, 10305, 10401, 10501, 10701, 10801, 10901, 11101, 11201, 11301, 11401,  11501, 11502, 11504, 11508,  11601, 11701, 11801, 11901, 12001, 12301.
 */
public Model createModel(String URIprefix,String displayId,String version,URI source,URI language,URI framework) throws SBOLValidationException {
  URIprefix=URIcompliance.checkURIprefix(URIprefix);
  Model model=new Model(createCompliantURI(URIprefix,TopLevel.MODEL,displayId,version,typesInURIs),source,language,framework);
  model.setPersistentIdentity(createCompliantURI(URIprefix,TopLevel.MODEL,displayId,"String_Node_Str",typesInURIs));
  model.setDisplayId(displayId);
  model.setVersion(version);
  addModel(model);
  return model;
}
Program: 12522
Project: 12522
Buggy source:
/** 
 * Creates a collection first, and then adds to this SBOL document's list of collections. <p> This method creates a compliant URI for the collection to be created first. It starts with  the given URI prefix after its been successfully validated, followed by the given display ID,  and ends with the given version.
 * @param URIprefix the URI prefix for the collection to be created
 * @param displayId the display ID of the collection to be created
 * @param version the version of the collection to be created
 * @return the created collection 
 * @throws SBOLValidationException if any of the following SBOL validation rules was violated:10201, 10204, 10206.
 */
public Collection createCollection(String URIprefix,String displayId,String version) throws SBOLValidationException {
  URIprefix=URIcompliance.checkURIprefix(URIprefix);
  Collection c=createCollection(createCompliantURI(URIprefix,TopLevel.COLLECTION,displayId,version,typesInURIs));
  c.setDisplayId(displayId);
  c.setPersistentIdentity(createCompliantURI(URIprefix,TopLevel.COLLECTION,displayId,"String_Node_Str",typesInURIs));
  c.setVersion(version);
  return c;
}

Fixed version (ground truth):
/** 
 * Creates a collection first, and then adds to this SBOL document's list of collections. <p> This method creates a compliant URI for the collection to be created first. It starts with  the given URI prefix after its been successfully validated, followed by the given display ID,  and ends with the given version.
 * @param URIprefix the URI prefix for the collection to be created
 * @param displayId the display ID of the collection to be created
 * @param version the version of the collection to be created
 * @return the created collection 
 * @throws SBOLValidationException if any of the following SBOL validation rules was violated:10201, 10204, 10206.
 */
public Collection createCollection(String URIprefix,String displayId,String version) throws SBOLValidationException {
  URIprefix=URIcompliance.checkURIprefix(URIprefix);
  Collection c=new Collection(createCompliantURI(URIprefix,TopLevel.COLLECTION,displayId,version,typesInURIs));
  c.setDisplayId(displayId);
  c.setPersistentIdentity(createCompliantURI(URIprefix,TopLevel.COLLECTION,displayId,"String_Node_Str",typesInURIs));
  c.setVersion(version);
  addCollection(c);
  return c;
}
Program: 12523
Project: 12523
Buggy source:
/** 
 * Removes all non-required namespaces from this SBOL document. <p> This method calls   {@link #removeNamespace(URI)} to iteratively remove each non-required namespace.
 */
public void clearNamespaces(){
  Object[] keySetArray=nameSpaces.keySet().toArray();
  for (  Object key : keySetArray) {
    if (isRequiredNamespaceBinding((URI)key))     continue;
    removeNamespace((URI)key);
  }
}

Fixed version (ground truth):
/** 
 * Removes all non-required namespaces from this SBOL document. <p> This method calls   {@link #removeNamespace(URI)} to iteratively remove each non-required namespace.
 */
public void clearNamespaces(){
  Object[] keySetArray=nameSpaces.keySet().toArray();
  for (  Object key : keySetArray) {
    if (isRequiredNamespaceBinding(URI.create((String)key)))     continue;
    removeNamespace(URI.create((String)key));
  }
}
Program: 12524
Project: 12524
Buggy source:
@Test public void test_namespaceMethods() throws URISyntaxException {
  List<QName> doc_namespaces=doc.getNamespaces();
  QName namespace=doc_namespaces.get(0);
  assertTrue(doc.getNamespaces().size() == 4);
  QName created_ns=new QName("String_Node_Str");
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.removeNamespace(new URI(created_ns.getNamespaceURI()));
  assertTrue(doc.getNamespace(new URI(created_ns.getNamespaceURI())).toString().length() == 0);
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
}

Fixed version (ground truth):
@Test public void test_namespaceMethods() throws URISyntaxException {
  List<QName> doc_namespaces=doc.getNamespaces();
  QName namespace=doc_namespaces.get(0);
  assertTrue(doc.getNamespaces().size() == 4);
  QName created_ns=new QName("String_Node_Str");
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.removeNamespace(new URI(created_ns.getNamespaceURI()));
  assertTrue(doc.getNamespace(new URI(created_ns.getNamespaceURI())).toString().length() == 0);
  doc.addNamespace(created_ns);
  assertTrue(doc.getNamespaces().size() == 5);
  doc.clearNamespaces();
}
Program: 12525
Project: 12525
Buggy source:
/** 
 * Sets the reference definition URI to this module. <p> This method creates a compliant local and a compliant remote URIs. They are created with this Module object's persistent ID, the given   {@code localId} or {@code remoteId}, and this Module object's version. It then calls   {@link #createMapsTo(String,RefinementType,URI,URI)} to createa MapsTo instance.
 * @param definitionURI The definition URI for this Module.
 * @throws SBOLValidationException if either of the following SBOL validation rule was violated: 11702, 11703.
 */
public void setDefinition(URI definitionURI) throws SBOLValidationException {
  if (definitionURI == null) {
    throw new SBOLValidationException("String_Node_Str",this);
  }
  if (sbolDocument != null && sbolDocument.isComplete()) {
    if (sbolDocument.getModuleDefinition(definitionURI) == null) {
      throw new SBOLValidationException("String_Node_Str",this);
    }
  }
  this.definition=definitionURI;
}

Fixed version (ground truth):
/** 
 * Sets the reference definition URI to this module. <p> This method creates a compliant local and a compliant remote URIs. They are created with this Module object's persistent ID, the given   {@code localId} or {@code remoteId}, and this Module object's version. It then calls   {@link #createMapsTo(String,RefinementType,URI,URI)} to createa MapsTo instance.
 * @param definitionURI The definition URI for this Module.
 * @throws SBOLValidationException if either of the following SBOL validation rule was violated: 11702, 11703, 11704, 11705.
 */
public void setDefinition(URI definitionURI) throws SBOLValidationException {
  if (definitionURI == null) {
    throw new SBOLValidationException("String_Node_Str",this);
  }
  if (sbolDocument != null) {
    if (sbolDocument.isComplete()) {
      if (sbolDocument.getModuleDefinition(definitionURI) == null) {
        throw new SBOLValidationException("String_Node_Str",this);
      }
    }
    if (moduleDefinition != null) {
      ModuleDefinition md=sbolDocument.getModuleDefinition(definitionURI);
      if (md != null && moduleDefinition.getIdentity().equals(md.getIdentity())) {
        throw new SBOLValidationException("String_Node_Str",this);
      }
      Set<URI> visited=new HashSet<>();
      visited.add(moduleDefinition.getIdentity());
      try {
        SBOLValidate.checkModuleDefinitionCycle(sbolDocument,md,visited);
      }
 catch (      SBOLValidationException e) {
        throw new SBOLValidationException("String_Node_Str",this);
      }
    }
  }
  this.definition=definitionURI;
}
Program: 12527
Project: 12527
Buggy source:
/** 
 * Returns a set of child ids that are descendants of a given parent URI. 
 * @param parentURI the URI of the parent term
 * @return a set of child ids that are descendants of a given parent URI. 
 */
public final Set<String> getDescendantsOf(URI parentURI){
  String parentId=getId(parentURI);
  return getDescendantsOf(parentId);
}

Fixed version (ground truth):
/** 
 * Returns a set of child ids that are descendants of a given parent URI. 
 * @param parentURI the URI of the parent term
 * @return a set of child ids that are descendants of a given parent URI. 
 */
public final Set<String> getDescendantsOf(URI parentURI){
  String parentId=getId(parentURI);
  if (parentId == null)   return new HashSet<String>();
  return getDescendantsOf(parentId);
}