nus-yam/ex-repair huggingface dataset:
Program: 12763
Project: 12763
Buggy source:
/** 
 * Assume this Participation object has compliant URI, and all given parameters have compliant forms. This method is called by   {@link Interaction#updateCompliantURI(String,String,String)}.
 */
void updateCompliantURI(String URIprefix,String grandparentDisplayId,String parentDisplayId,String version){
  String thisObjDisplayId=extractDisplayId(this.getIdentity(),2);
  URI newIdentity=URI.create(URIprefix + '/' + grandparentDisplayId+ '/'+ parentDisplayId+ '/'+ thisObjDisplayId+ '/'+ version);
  this.setWasDerivedFrom(this.getIdentity());
  this.setIdentity(newIdentity);
}

Fixed version (ground truth):
/** 
 * Assume this Participation object has compliant URI, and all given parameters have compliant forms. This method is called by   {@link Interaction#updateCompliantURI(String,String,String)}.
 */
void updateCompliantURI(String URIprefix,String grandparentDisplayId,String parentDisplayId,String version){
  String thisObjDisplayId=extractDisplayId(this.getIdentity());
  URI newIdentity=URI.create(URIprefix + '/' + grandparentDisplayId+ '/'+ parentDisplayId+ '/'+ thisObjDisplayId+ '/'+ version);
  this.setWasDerivedFrom(this.getIdentity());
  this.setIdentity(newIdentity);
}
Program: 12764
Project: 12764
Buggy source:
/** 
 * Assume this Range object has compliant URI, and all given parameters have compliant forms. This method is called by   {@link MultiRange#updateCompliantURI(String,String,String,String)}.
 */
void updateCompliantURI(String URIprefix,String greatGrandparentDisplayId,String grandparentDisplayId,String parentDisplayId,String version){
  String thisObjDisplayId=extractDisplayId(this.getIdentity(),3);
  URI newIdentity=URI.create(URIprefix + '/' + greatGrandparentDisplayId+ '/'+ grandparentDisplayId+ '/'+ parentDisplayId+ '/'+ thisObjDisplayId+ '/'+ version);
  this.setWasDerivedFrom(this.getIdentity());
  this.setIdentity(newIdentity);
}

Fixed version (ground truth):
/** 
 * Assume this Range object has compliant URI, and all given parameters have compliant forms. This method is called by   {@link MultiRange#updateCompliantURI(String,String,String,String)}.
 */
void updateCompliantURI(String URIprefix,String greatGrandparentDisplayId,String grandparentDisplayId,String parentDisplayId,String version){
  String thisObjDisplayId=extractDisplayId(this.getIdentity());
  URI newIdentity=URI.create(URIprefix + '/' + greatGrandparentDisplayId+ '/'+ grandparentDisplayId+ '/'+ parentDisplayId+ '/'+ thisObjDisplayId+ '/'+ version);
  this.setWasDerivedFrom(this.getIdentity());
  this.setIdentity(newIdentity);
}
Program: 12766
Project: 12766
Buggy source:
/** 
 * Assume this SequenceAnnotation object has compliant URI, and all given parameters have compliant forms. This method is called by   {@link ComponentDefinition#copy(String,String,String)}.
 * @param URIprefix
 * @param parentDisplayId
 * @param version
 */
void updateCompliantURI(String URIprefix,String parentDisplayId,String version){
  String thisObjDisplayId=extractDisplayId(this.getIdentity(),1);
  URI newIdentity=URI.create(URIprefix + '/' + parentDisplayId+ '/'+ thisObjDisplayId+ '/'+ version);
  Location location=this.getLocation();
  if (location instanceof Range) {
    ((Range)location).updateCompliantURI(URIprefix,parentDisplayId,thisObjDisplayId,version);
  }
  if (location instanceof Cut) {
    ((Cut)location).updateCompliantURI(URIprefix,parentDisplayId,thisObjDisplayId,version);
  }
  if (location instanceof GenericLocation) {
    ((GenericLocation)location).updateCompliantURI(URIprefix,parentDisplayId,thisObjDisplayId,version);
  }
  if (location instanceof MultiRange) {
    ((MultiRange)location).updateCompliantURI(URIprefix,parentDisplayId,thisObjDisplayId,version);
  }
  this.setWasDerivedFrom(this.getIdentity());
  this.setIdentity(newIdentity);
}

Fixed version (ground truth):
/** 
 * Assume this SequenceAnnotation object has compliant URI, and all given parameters have compliant forms. This method is called by   {@link ComponentDefinition#copy(String,String,String)}.
 * @param URIprefix
 * @param parentDisplayId
 * @param version
 */
void updateCompliantURI(String URIprefix,String parentDisplayId,String version){
  String thisObjDisplayId=extractDisplayId(this.getIdentity());
  URI newIdentity=URI.create(URIprefix + '/' + parentDisplayId+ '/'+ thisObjDisplayId+ '/'+ version);
  Location location=this.getLocation();
  if (location instanceof Range) {
    ((Range)location).updateCompliantURI(URIprefix,parentDisplayId,thisObjDisplayId,version);
  }
  if (location instanceof Cut) {
    ((Cut)location).updateCompliantURI(URIprefix,parentDisplayId,thisObjDisplayId,version);
  }
  if (location instanceof GenericLocation) {
    ((GenericLocation)location).updateCompliantURI(URIprefix,parentDisplayId,thisObjDisplayId,version);
  }
  if (location instanceof MultiRange) {
    ((MultiRange)location).updateCompliantURI(URIprefix,parentDisplayId,thisObjDisplayId,version);
  }
  this.setWasDerivedFrom(this.getIdentity());
  this.setIdentity(newIdentity);
}
Program: 12767
Project: 12767
Buggy source:
/** 
 * Assume this SequenceConstraint object has compliant URI, and all given parameters have compliant forms. This method is called by   {@link ComponentDefinition#copy(String,String,String)}.
 */
void updateCompliantURI(String URIprefix,String parentDisplayId,String version){
  String thisObjDisplayId=extractDisplayId(this.getIdentity(),1);
  URI newIdentity=URI.create(URIprefix + '/' + parentDisplayId+ '/'+ thisObjDisplayId+ '/'+ version);
  this.setWasDerivedFrom(this.getIdentity());
  this.setIdentity(newIdentity);
}

Fixed version (ground truth):
/** 
 * Assume this SequenceConstraint object has compliant URI, and all given parameters have compliant forms. This method is called by   {@link ComponentDefinition#copy(String,String,String)}.
 */
void updateCompliantURI(String URIprefix,String parentDisplayId,String version){
  String thisObjDisplayId=extractDisplayId(this.getIdentity());
  URI newIdentity=URI.create(URIprefix + '/' + parentDisplayId+ '/'+ thisObjDisplayId+ '/'+ version);
  this.setWasDerivedFrom(this.getIdentity());
  this.setIdentity(newIdentity);
}
Program: 12768
Project: 12768
Buggy source:
/** 
 * Extract the object's display ID from the given object's identity URI, according to the given index. The given URI is first checked for compliance. If the given index is 0, the extracted display ID is the top-level object's display ID; if the given index is 1, the extracted display ID is the child object's display ID; if the given index is 2, the extracted display ID is the grand child object's display ID; if the given index is 3, the extracted display ID is the great grand child object's display ID.
 * @return the extracted display ID.
 */
public static String extractDisplayId(URI objURI,int index){
  if (index < 0 || index > 3) {
    return null;
  }
  String URIstr=objURI.toString();
  Pattern r=Pattern.compile(genericURIpattern1);
  Matcher m=r.matcher(URIstr);
  if (m.matches()) {
    return m.group(4);
  }
 else   return null;
}

Fixed version (ground truth):
/** 
 * Extract the object's display ID from the given object's identity URI, according to the given index. The given URI is first checked for compliance. If the given index is 0, the extracted display ID is the top-level object's display ID; if the given index is 1, the extracted display ID is the child object's display ID; if the given index is 2, the extracted display ID is the grand child object's display ID; if the given index is 3, the extracted display ID is the great grand child object's display ID.
 * @return the extracted display ID.
 */
public static String extractDisplayId(URI objURI){
  String URIstr=objURI.toString();
  Pattern r=Pattern.compile(genericURIpattern1);
  Matcher m=r.matcher(URIstr);
  if (m.matches()) {
    return m.group(4);
  }
 else   return null;
}
Program: 12769
Project: 12769
Buggy source:
public static final boolean isChildURIcompliant(URI parentURI,URI childURI){
  String parentPersistentId=extractPersistentId(parentURI);
  if (parentPersistentId == null)   return false;
  String childDisplayId=extractDisplayId(childURI,0);
  if (childDisplayId == null)   return false;
  String parentVersion=extractVersion(parentURI);
  if (parentVersion == null) {
    return childURI.toString().equals(parentPersistentId + "String_Node_Str" + childDisplayId);
  }
 else {
    return childURI.toString().equals(parentPersistentId + "String_Node_Str" + childDisplayId+ "String_Node_Str"+ parentVersion);
  }
}

Fixed version (ground truth):
public static final boolean isChildURIcompliant(URI parentURI,URI childURI){
  String parentPersistentId=extractPersistentId(parentURI);
  if (parentPersistentId == null)   return false;
  String childDisplayId=extractDisplayId(childURI);
  if (childDisplayId == null)   return false;
  String parentVersion=extractVersion(parentURI);
  if (parentVersion == null) {
    return childURI.toString().equals(parentPersistentId + "String_Node_Str" + childDisplayId);
  }
 else {
    return childURI.toString().equals(parentPersistentId + "String_Node_Str" + childDisplayId+ "String_Node_Str"+ parentVersion);
  }
}
Program: 12770
Project: 12770
Buggy source:
/** 
 * Test <code>null<\code> for extractDisplayId for the compliant great grand child URI.
 */
@Test public void testExtractDisplayId13(){
  String extractedDisplayId=extractDisplayId(uri9,3);
  assertNull(extractedDisplayId);
}

Fixed version (ground truth):
/** 
 * Test <code>null<\code> for extractDisplayId for the compliant great grand child URI.
 */
@Test public void testExtractDisplayId13(){
  String extractedDisplayId=extractDisplayId(uri9);
  assertNull(extractedDisplayId);
}
Program: 12771
Project: 12771
Buggy source:
/** 
 * Test <code>null<\code> for extractDisplayId for the compliant grand child URI.
 */
@Test public void testExtractDisplayId12(){
  String extractedDisplayId=extractDisplayId(uri8,3);
  assertNull(extractedDisplayId);
}

Fixed version (ground truth):
/** 
 * Test <code>null<\code> for extractDisplayId for the compliant grand child URI.
 */
@Test public void testExtractDisplayId12(){
  String extractedDisplayId=extractDisplayId(uri8);
  assertNull(extractedDisplayId);
}
Program: 12772
Project: 12772
Buggy source:
/** 
 * Test <code>null<\code> for extractDisplayId for the compliant child URI.
 */
@Test public void testExtractDisplayId11(){
  String extractedDisplayId=extractDisplayId(uri6,3);
  assertNull(extractedDisplayId);
}

Fixed version (ground truth):
/** 
 * Test <code>null<\code> for extractDisplayId for the compliant child URI.
 */
@Test public void testExtractDisplayId11(){
  String extractedDisplayId=extractDisplayId(uri6);
  assertNull(extractedDisplayId);
}
Program: 12773
Project: 12773
Buggy source:
/** 
 * Test the extracted top-level display ID string for the compliant top-level URI.
 */
@Test public void testExtractDisplayId1(){
  String extractedDisplayId=extractDisplayId(uri1,0);
  assertEquals(uri1toplevelDisplayId,extractedDisplayId);
}

Fixed version (ground truth):
/** 
 * Test the extracted top-level display ID string for the compliant top-level URI.
 */
@Test public void testExtractDisplayId1(){
  String extractedDisplayId=extractDisplayId(uri1);
  assertEquals(uri1toplevelDisplayId,extractedDisplayId);
}
Program: 12774
Project: 12774
Buggy source:
/** 
 * Extract the object's display ID from the given object's identity URI, according to the given index. The given URI is first checked for compliance. If the given index is 0, the extracted display ID is the top-level object's display ID; if the given index is 1, the extracted display ID is the child object's display ID; if the given index is 2, the extracted display ID is the grand child object's display ID; if the given index is 3, the extracted display ID is the great grand child object's display ID.
 * @return the extracted display ID.
 */
public static String extractDisplayId(URI objURI,int index){
  if (index < 0 || index > 3) {
    return null;
  }
  String URIstr=objURI.toString();
  Pattern r=Pattern.compile(genericURIpattern2);
  Matcher m=r.matcher(URIstr);
  if (m.matches()) {
    String displayIds=m.group(1);
    String[] displayIdArray=displayIds.substring(0,displayIds.lastIndexOf('/')).split("String_Node_Str");
    return displayIdArray[index];
  }
 else   return null;
}

Fixed version (ground truth):
/** 
 * Extract the object's display ID from the given object's identity URI, according to the given index. The given URI is first checked for compliance. If the given index is 0, the extracted display ID is the top-level object's display ID; if the given index is 1, the extracted display ID is the child object's display ID; if the given index is 2, the extracted display ID is the grand child object's display ID; if the given index is 3, the extracted display ID is the great grand child object's display ID.
 * @return the extracted display ID.
 */
public static String extractDisplayId(URI objURI,int index){
  if (index < 0 || index > 3) {
    return null;
  }
  String URIstr=objURI.toString();
  Pattern r=Pattern.compile(genericURIpattern1);
  Matcher m=r.matcher(URIstr);
  if (m.matches()) {
    return m.group(4);
  }
 else   return null;
}
Program: 12775
Project: 12775
Buggy source:
/** 
 * Extract the persistent identity URI from the given URI. The persistent identity is simply the identity URI without the version.
 * @return the extracted persistent identity URI, <code>null</code> otherwise.
 */
public static String extractPersistentId(URI objURI){
  String URIstr=objURI.toString();
  Pattern r=Pattern.compile(genericURIpattern1);
  Matcher m=r.matcher(URIstr);
  if (m.matches()) {
    return m.group(1).substring(0,m.group(1).lastIndexOf('/'));
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Extract the persistent identity URI from the given URI. The persistent identity is simply the identity URI without the version.
 * @return the extracted persistent identity URI, <code>null</code> otherwise.
 */
public static String extractPersistentId(URI objURI){
  String URIstr=objURI.toString();
  Pattern r=Pattern.compile(genericURIpattern1);
  Matcher m=r.matcher(URIstr);
  if (m.matches()) {
    return m.group(1);
  }
 else {
    return null;
  }
}
Program: 12776
Project: 12776
Buggy source:
public static final boolean isChildURIcompliant(URI parentURI,URI childURI){
  String parentURIstr=parentURI.toString();
  Pattern URIpattern=Pattern.compile(genericURIpattern1);
  Matcher parentMatcher=URIpattern.matcher(parentURIstr);
  if (parentMatcher.matches()) {
    String childURIstr=childURI.toString();
    Matcher childMatcher=URIpattern.matcher(childURIstr);
    if (childMatcher.matches()) {
      String parentPersistentId=parentMatcher.group(1).substring(0,parentMatcher.group(1).lastIndexOf('/'));
      String childPersistentId=childMatcher.group(1).substring(0,childMatcher.group(1).lastIndexOf('/'));
      String parentPartOfChildPersistId=childPersistentId.substring(0,childPersistentId.lastIndexOf('/'));
      if (parentPartOfChildPersistId.equals(parentPersistentId)) {
        String parentVersion=parentMatcher.group(3);
        String childVersion=childMatcher.group(3);
        return parentVersion.equals(childVersion);
      }
 else {
        return false;
      }
    }
 else {
      return false;
    }
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
public static final boolean isChildURIcompliant(URI parentURI,URI childURI){
  String parentPersistentId=extractPersistentId(parentURI);
  if (parentPersistentId == null)   return false;
  String childDisplayId=extractDisplayId(childURI,0);
  if (childDisplayId == null)   return false;
  String parentVersion=extractVersion(parentURI);
  if (parentVersion == null) {
    return childURI.toString().equals(parentPersistentId + "String_Node_Str" + childDisplayId);
  }
 else {
    return childURI.toString().equals(parentPersistentId + "String_Node_Str" + childDisplayId+ "String_Node_Str"+ parentVersion);
  }
}
Program: 12777
Project: 12777
Buggy source:
/** 
 * Extract the version from this object's identity URI.
 * @return the version if the given URI is compliant, <code>null</code> otherwise.
 */
public static String extractVersion(URI objURI){
  String URIstr=objURI.toString();
  Pattern r=Pattern.compile(genericURIpattern1);
  Matcher m=r.matcher(URIstr);
  if (m.matches())   return m.group(3);
 else   return null;
}

Fixed version (ground truth):
/** 
 * Extract the version from this object's identity URI.
 * @return the version if the given URI is compliant, <code>null</code> otherwise.
 */
public static String extractVersion(URI objURI){
  String URIstr=objURI.toString();
  Pattern r=Pattern.compile(genericURIpattern1);
  Matcher m=r.matcher(URIstr);
  if (m.matches() && m.groupCount() >= 6)   return m.group(6);
 else   return null;
}
Program: 12778
Project: 12778
Buggy source:
/** 
 * Test if the given object's identity URI is compliant with the form   {@code} ⟨prefix⟩/(⟨displayId⟩/)1,4}⟨version⟩. The prefix is established by the owner of this object. The number of displayIds can range from 1 to 4, depending on the level of the given object. If the given index is 0, then  {@code objURI} is checked as a top-level URI for compliance;if the given index is 1, then  {@code objURI} is checked as a child of a top-level URI for compliance;if the given index is 2, then  {@code objURI} is checked as a grand child of a top-level URI for compliance; andif the given index is 3, then  {@code objURI} is checked as a great grand child of a top-level URI for compliance.
 * @param objURI
 * @param index
 * @return <code>true</code> if the identity URI is compliant, <code>false</code> otherwise.
 */
public static final boolean isURIcompliant(URI objURI,int index){
  if (index < 0 || index > 3) {
    return false;
  }
  Pattern r;
  String URIstr=objURI.toString();
  if (index == 0) {
    r=Pattern.compile(toplevelURIpattern);
  }
 else   if (index == 1) {
    r=Pattern.compile(childURIpattern);
  }
 else   if (index == 2) {
    r=Pattern.compile(grandchildURIpattern);
  }
 else {
    r=Pattern.compile(greatGrandchildURIpattern);
  }
  Matcher m=r.matcher(URIstr);
  return m.matches();
}

Fixed version (ground truth):
/** 
 * Test if the given object's identity URI is compliant with the form   {@code} ⟨prefix⟩/(⟨displayId⟩/)1,4}⟨version⟩. The prefix is established by the owner of this object. The number of displayIds can range from 1 to 4, depending on the level of the given object. If the given index is 0, then  {@code objURI} is checked as a top-level URI for compliance;if the given index is 1, then  {@code objURI} is checked as a child of a top-level URI for compliance;if the given index is 2, then  {@code objURI} is checked as a grand child of a top-level URI for compliance; andif the given index is 3, then  {@code objURI} is checked as a great grand child of a top-level URI for compliance.
 * @param objURI
 * @param index
 * @return <code>true</code> if the identity URI is compliant, <code>false</code> otherwise.
 */
public static final boolean isURIcompliant(URI objURI,int index){
  if (index < 0 || index > 3) {
    return false;
  }
  Pattern r;
  String URIstr=objURI.toString();
  if (index == 0) {
    r=Pattern.compile(toplevelURIpattern);
  }
 else   if (index == 1) {
    r=Pattern.compile(childURIpattern);
  }
 else   if (index == 2) {
    r=Pattern.compile(grandchildURIpattern);
  }
 else {
    r=Pattern.compile(greatGrandchildURIpattern);
  }
  Matcher m=r.matcher(URIstr);
  if (!m.matches()) {
    System.out.println(URIstr + "String_Node_Str");
  }
  return m.matches();
}
Program: 12779
Project: 12779
Buggy source:
public static void validateIdVersion(String displayId,String version){
  if (!isDisplayIdCompliant(displayId)) {
    throw new IllegalArgumentException("String_Node_Str" + displayId + "String_Node_Str");
  }
  if (!isVersionCompliant(version)) {
    throw new IllegalArgumentException("String_Node_Str" + version + "String_Node_Str");
  }
}

Fixed version (ground truth):
public static void validateIdVersion(String displayId,String version){
  if (!isDisplayIdCompliant(displayId)) {
    throw new IllegalArgumentException("String_Node_Str" + displayId + "String_Node_Str");
  }
  if (version != null && !version.equals("String_Node_Str") && !isVersionCompliant(version)) {
    throw new IllegalArgumentException("String_Node_Str" + version + "String_Node_Str");
  }
}
Program: 12780
Project: 12780
Buggy source:
/** 
 * Compare the given two versions based on the Maven version scheme.
 * @return <code>true</code> if the <code>version1</code> is newer than <code>version2</code>, <code>false</code> otherwise.
 */
public static final boolean isFirstVersionNewer(String version1,String version2){
  ComparableVersion v1=new ComparableVersion(version1);
  ComparableVersion v2=new ComparableVersion(version2);
  return v1.compareTo(v2) > 0;
}

Fixed version (ground truth):
/** 
 * Compare the given two versions based on the Maven version scheme.
 * @return <code>true</code> if the <code>version1</code> is newer than <code>version2</code>, <code>false</code> otherwise.
 */
public static final boolean isFirstVersionNewer(String version1,String version2){
  if (version1 == null)   return true;
  if (version2 == null)   return false;
  ComparableVersion v1=new ComparableVersion(version1);
  ComparableVersion v2=new ComparableVersion(version2);
  return v1.compareTo(v2) > 0;
}
Program: 12781
Project: 12781
Buggy source:
public void removeComponent(DnaComponent component);

Fixed version (ground truth):
void removeComponent(DnaComponent component);
Program: 12782
Project: 12782
Buggy source:
/** 
 * Elements that are intended as engineering components in synthetic biology. For example, standard biological parts, BioBricks, oligo components, vector plasmids, genomes, or any other DNA segment of interest as a building block of biological systems.
 * @return 0 or more <code>DnaComponent</code>[s] that are in this Collection
 */
public java.util.Collection<DnaComponent> getComponents();

Fixed version (ground truth):
/** 
 * Elements that are intended as engineering components in synthetic biology. For example, standard biological parts, BioBricks, oligo components, vector plasmids, genomes, or any other DNA segment of interest as a building block of biological systems.
 * @return 0 or more <code>DnaComponent</code>[s] that are in this Collection
 */
java.util.Collection<DnaComponent> getComponents();
Program: 12783
Project: 12783
Buggy source:
/** 
 * Defined DNA segment for engineering biological systems, which belongs to this Collection. Any one of the following, standard biological parts, BioBricks, oligo components, vector plasmids, genomes, or any other DNA segment of interest as a building block of biological systems.
 * @param component a <code>DnaComponent</code> that should be a member of this collection
 */
public void addComponent(DnaComponent component);

Fixed version (ground truth):
/** 
 * Defined DNA segment for engineering biological systems, which belongs to this Collection. Any one of the following, standard biological parts, BioBricks, oligo components, vector plasmids, genomes, or any other DNA segment of interest as a building block of biological systems.
 * @param component a <code>DnaComponent</code> that should be a member of this collection
 */
void addComponent(DnaComponent component);
Program: 12784
Project: 12784
Buggy source:
/** 
 * Common name of DNA component, confers meaning of what it is. (eg. pLac-O1) Often this name is the short meaningful string that is informally used to identify the DNA component. Sometimes it is an acronym which makes it likely to be short.
 * @param name its name, commonly used to refer to this DnaComponent (eg. pLac-O1)
 * @see #getName
 */
public void setName(String name);

Fixed version (ground truth):
/** 
 * Common name of DNA component, confers meaning of what it is. (eg. pLac-O1) Often this name is the short meaningful string that is informally used to identify the DNA component. Sometimes it is an acronym which makes it likely to be short.
 * @param name its name, commonly used to refer to this DnaComponent (eg. pLac-O1)
 * @see #getName
 */
void setName(String name);
Program: 12785
Project: 12785
Buggy source:
/** 
 * The name is the most recognizable known identifier, it is often ambiguous. (eg. pLac-O1) Useful for display to carry common meaning, see work on "shared understanding" in CSCW field for more.
 * @return its name, commonly used to refer to this DnaComponent
 */
public String getName();

Fixed version (ground truth):
/** 
 * The name is the most recognizable known identifier, it is often ambiguous. (eg. pLac-O1) Useful for display to carry common meaning, see work on "shared understanding" in CSCW field for more.
 * @return its name, commonly used to refer to this DnaComponent
 */
String getName();
Program: 12786
Project: 12786
Buggy source:
public void removeType(URI type);

Fixed version (ground truth):
void removeType(URI type);
Program: 12787
Project: 12787
Buggy source:
/** 
 * Identifier to display to users.
 * @return a human readable identifier
 */
public String getDisplayId();

Fixed version (ground truth):
/** 
 * Identifier to display to users.
 * @return a human readable identifier
 */
String getDisplayId();
Program: 12788
Project: 12788
Buggy source:
/** 
 * Text which is written for users to read and interpret.  It should describe what the component is used for and/or what it does. Suggestion: it should provide information that cannot yet be represented in the rest of the DNA components computable fields. Do not include <> tags such as HTML or XML inside as that may break the RDF. Don't include {} tags as that may break the Json.
 * @param description human readable text describing the component
 */
public void setDescription(String description);

Fixed version (ground truth):
/** 
 * Text which is written for users to read and interpret.  It should describe what the component is used for and/or what it does. Suggestion: it should provide information that cannot yet be represented in the rest of the DNA components computable fields. Do not include <> tags such as HTML or XML inside as that may break the RDF. Don't include {} tags as that may break the Json.
 * @param description human readable text describing the component
 */
void setDescription(String description);
Program: 12789
Project: 12789
Buggy source:
/** 
 * Positions and directions of <code>SequenceFeature</code>[s] that describe the DNA sequence.
 * @return 0 or more <code>SequenceAnnotation</code>[s] that describe the DNA composition
 * @see #addAnnotation
 */
public List<SequenceAnnotation> getAnnotations();

Fixed version (ground truth):
/** 
 * Positions and directions of <code>SequenceFeature</code>[s] that describe the DNA sequence.
 * @return 0 or more <code>SequenceAnnotation</code>[s] that describe the DNA composition
 * @see #addAnnotation
 */
List<SequenceAnnotation> getAnnotations();
Program: 12790
Project: 12790
Buggy source:
/** 
 * Text which is for users to read and interpret what this component is. (eg. engineered Lac promoter, repressible by LacI). Could be lengthy, so it is the responsibility of the user application to format and allow for arbitrary length.
 * @return Human readable text describing the component
 * @see #setDescription
 */
public String getDescription();

Fixed version (ground truth):
/** 
 * Text which is for users to read and interpret what this component is. (eg. engineered Lac promoter, repressible by LacI). Could be lengthy, so it is the responsibility of the user application to format and allow for arbitrary length.
 * @return Human readable text describing the component
 * @see #setDescription
 */
String getDescription();
Program: 12791
Project: 12791
Buggy source:
/** 
 * DNA sequence which this DnaComponent object represents.
 * @param dnaSequence specify the DnaSequence of this DnaComponent
 */
public void setDnaSequence(DnaSequence dnaSequence);

Fixed version (ground truth):
/** 
 * DNA sequence which this DnaComponent object represents.
 * @param dnaSequence specify the DnaSequence of this DnaComponent
 */
void setDnaSequence(DnaSequence dnaSequence);
Program: 12792
Project: 12792
Buggy source:
/** 
 * New position and direction of a <code>SequenceFeature</code> that describes the DNA sequence. The DnaComponent could be left un-annotated, but that condition is not a very useful to users.
 * @param annotation a <code>SequenceAnnotation</code> that describes the DNA composition
 */
public void addAnnotation(SequenceAnnotation annotation);

Fixed version (ground truth):
/** 
 * New position and direction of a <code>SequenceFeature</code> that describes the DNA sequence. The DnaComponent could be left un-annotated, but that condition is not a very useful to users.
 * @param annotation a <code>SequenceAnnotation</code> that describes the DNA composition
 */
void addAnnotation(SequenceAnnotation annotation);
Program: 12793
Project: 12793
Buggy source:
public void removeAnnotation(SequenceAnnotation annotation);

Fixed version (ground truth):
void removeAnnotation(SequenceAnnotation annotation);
Program: 12794
Project: 12794
Buggy source:
/** 
 * DNA sequence which this DnaComponent object represents.
 * @return 1 {@link DnaSequence} specifying the DNA sequence of this DnaComponent
 * @see DnaSequence
 */
public DnaSequence getDnaSequence();

Fixed version (ground truth):
/** 
 * DNA sequence which this DnaComponent object represents.
 * @return 1 {@link DnaSequence} specifying the DNA sequence of this DnaComponent
 * @see DnaSequence
 */
DnaSequence getDnaSequence();
Program: 12795
Project: 12795
Buggy source:
/** 
 * Sequence Ontology vocabulary provides a defined term for types of DNA components.
 * @param type Sequence Ontology URI specifying the type of the DnaComponent
 */
public void addType(URI type);

Fixed version (ground truth):
/** 
 * Sequence Ontology vocabulary provides a defined term for types of DNA components.
 * @param type Sequence Ontology URI specifying the type of the DnaComponent
 */
void addType(URI type);
Program: 12796
Project: 12796
Buggy source:
/** 
 * Identifier that users will see as reference to the DNA construct. It should be unambiguous and is likely imported from source data. Otherwise it should be generated. It should be restricted to alphanumeric/underscore and starting with a letter or underscore.
 * @param displayId a human readable identifier
 */
public void setDisplayId(String displayId);

Fixed version (ground truth):
/** 
 * Identifier that users will see as reference to the DNA construct. It should be unambiguous and is likely imported from source data. Otherwise it should be generated. It should be restricted to alphanumeric/underscore and starting with a letter or underscore.
 * @param displayId a human readable identifier
 */
void setDisplayId(String displayId);
Program: 12797
Project: 12797
Buggy source:
/** 
 * Sequence Ontology vocabulary provides a defined term for types of DNA components. TO DO: implement use of SO within libSBOLj.
 * @return a Sequence Ontology (SO) vocabulary term to describe the type of DnaComponent.
 */
public Collection<URI> getTypes();

Fixed version (ground truth):
/** 
 * Sequence Ontology vocabulary provides a defined term for types of DNA components. TO DO: implement use of SO within libSBOLj.
 * @return a Sequence Ontology (SO) vocabulary term to describe the type of DnaComponent.
 */
Collection<URI> getTypes();
Program: 12798
Project: 12798
Buggy source:
/** 
 * The sequence of DNA base pairs which are described.
 * @return a string representation of the DNA base-pair sequence
 */
public String getNucleotides();

Fixed version (ground truth):
/** 
 * The sequence of DNA base pairs which are described.
 * @return a string representation of the DNA base-pair sequence
 */
String getNucleotides();
Program: 12799
Project: 12799
Buggy source:
/** 
 * The sequence of DNA base pairs which are going to be described. a.The DNA sequence will use the IUPAC ambiguity recommendation. (See http://www.genomatix.de/online_help/help/sequence_formats.html) b.Blank lines, spaces, or other symbols must not be included in the sequence text. c.The sequence text must be in ASCII or UTF-8 encoding. For the alphabets used, the two are identical.
 * @param nucleotides a sequence of [a|c|t|g] letters
 */
public void setNucleotides(String nucleotides);

Fixed version (ground truth):
/** 
 * The sequence of DNA base pairs which are going to be described. a.The DNA sequence will use the IUPAC ambiguity recommendation. (See http://www.genomatix.de/online_help/help/sequence_formats.html) b.Blank lines, spaces, or other symbols must not be included in the sequence text. c.The sequence text must be in ASCII or UTF-8 encoding. For the alphabets used, the two are identical.
 * @param nucleotides a sequence of [a|c|t|g] letters
 */
void setNucleotides(String nucleotides);
Program: 12800
Project: 12800
Buggy source:
/** 
 * Resolve the ID or return null.
 * @param id    the identifier
 * @return      the resolution of the identifier, or null if it could not be resolved
 */
public E resolve(ID id) throws MergerException ;

Fixed version (ground truth):
/** 
 * Resolve the ID or return null.
 * @param id    the identifier
 * @return      the resolution of the identifier, or null if it could not be resolved
 */
E resolve(ID id) throws MergerException ;
Program: 12801
Project: 12801
Buggy source:
/** 
 * Returns the top-level objects contained in this document. Top level objects may contain other SBOL objects. For example, a   {@link DnaComponent} may contain a {@link DnaSequence} and multiple {@link SequenceAnnotation}s which will not be included in the results of this function. To get all the objects contained in a document you can use the   {@link SBOLObjectCollector} function.
 */
public List<SBOLRootObject> getContents();

Fixed version (ground truth):
/** 
 * Returns the top-level objects contained in this document. Top level objects may contain other SBOL objects. For example, a   {@link DnaComponent} may contain a {@link DnaSequence} and multiple {@link SequenceAnnotation}s which will not be included in the results of this function. To get all the objects contained in a document you can use the   {@link SBOLObjectCollector} function.
 */
List<SBOLRootObject> getContents();
Program: 12802
Project: 12802
Buggy source:
/** 
 * Adds a new top level object to the document. Only top-level objects need to be added explicitly to a document.
 */
public void addContent(SBOLRootObject obj);

Fixed version (ground truth):
/** 
 * Adds a new top level object to the document. Only top-level objects need to be added explicitly to a document.
 */
void addContent(SBOLRootObject obj);
Program: 12803
Project: 12803
Buggy source:
/** 
 * Removes a top level object from the document.
 */
public void removeContent(SBOLRootObject obj);

Fixed version (ground truth):
/** 
 * Removes a top level object from the document.
 */
void removeContent(SBOLRootObject obj);
Program: 12804
Project: 12804
Buggy source:
/** 
 * Sets the identifier for this object.
 */
public void setURI(URI uri);

Fixed version (ground truth):
/** 
 * Sets the identifier for this object.
 */
void setURI(URI uri);
Program: 12805
Project: 12805
Buggy source:
/** 
 * Returns the identifier for this object.
 */
public URI getURI();

Fixed version (ground truth):
/** 
 * Returns the identifier for this object.
 */
URI getURI();
Program: 12806
Project: 12806
Buggy source:
/** 
 * Reads the contents of an SBOL document from the given input stream into a newly created document instance.
 * @throws IOException if an IO error occurs while reading the contents of this document
 * @throws SBOLValidationException if a validation error occurs while reading the contents of the document
 */
public SBOLDocument read(InputStream in) throws IOException, SBOLValidationException ;

Fixed version (ground truth):
/** 
 * Reads the contents of an SBOL document from the given input stream into a newly created document instance.
 * @throws IOException if an IO error occurs while reading the contents of this document
 * @throws SBOLValidationException if a validation error occurs while reading the contents of the document
 */
SBOLDocument read(InputStream in) throws IOException, SBOLValidationException ;
Program: 12807
Project: 12807
Buggy source:
/** 
 * Validates the contents of the document and throws a   {@link SBOLValidationException} if validation fails. The function returns without an exception if the validation is successful.
 * @param doc
 * @throws SBOLValidationException
 */
public void validate(SBOLDocument doc) throws SBOLValidationException ;

Fixed version (ground truth):
/** 
 * Validates the contents of the document and throws a   {@link SBOLValidationException} if validation fails. The function returns without an exception if the validation is successful.
 * @param doc
 * @throws SBOLValidationException
 */
void validate(SBOLDocument doc) throws SBOLValidationException ;
Program: 12808
Project: 12808
Buggy source:
/** 
 * The default equals implementation which returns <code>true</code> only if the given object is <code>==</code> to this object.
 */
public boolean equals(Object obj);

Fixed version (ground truth):
/** 
 * The default equals implementation which returns <code>true</code> only if the given object is <code>==</code> to this object.
 */
boolean equals(Object obj);
Program: 12809
Project: 12809
Buggy source:
/** 
 * Calls the appropriate visit function from the   {@link SBOLVisitor} class.
 * @param visitor the visitor to accept
 * @throws T if the visitor throws T
 */
public <T extends Throwable>void accept(SBOLVisitor<T> visitor) throws T ;

Fixed version (ground truth):
/** 
 * Calls the appropriate visit function from the   {@link SBOLVisitor} class.
 * @param visitor the visitor to accept
 * @throws T if the visitor throws T
 */
<T extends Throwable>void accept(SBOLVisitor<T> visitor) throws T ;
Program: 12810
Project: 12810
Buggy source:
public void visit(SequenceAnnotation annotation) throws T ;

Fixed version (ground truth):
void visit(SequenceAnnotation annotation) throws T ;
Program: 12811
Project: 12811
Buggy source:
/** 
 * Writes the contents of the given SBOL document to the given output stream.
 * @throws IOException if an IO error occurs while writing the contents of this document
 * @throws SBOLValidationException if a validation error occurs while writing the contents of the document
 */
public void write(SBOLDocument doc,OutputStream out) throws IOException, SBOLValidationException ;

Fixed version (ground truth):
/** 
 * Writes the contents of the given SBOL document to the given output stream.
 * @throws IOException if an IO error occurs while writing the contents of this document
 * @throws SBOLValidationException if a validation error occurs while writing the contents of the document
 */
void write(SBOLDocument doc,OutputStream out) throws IOException, SBOLValidationException ;
Program: 12812
Project: 12812
Buggy source:
public UriResolver<DnaComponent> getComponentUriResolver();

Fixed version (ground truth):
UriResolver<DnaComponent> getComponentUriResolver();
Program: 12813
Project: 12813
Buggy source:
public UriResolver<SequenceAnnotation> getAnnotationUriResolver();

Fixed version (ground truth):
UriResolver<SequenceAnnotation> getAnnotationUriResolver();
Program: 12814
Project: 12814
Buggy source:
public UriResolver<Collection> getCollectionUriResolver();

Fixed version (ground truth):
UriResolver<Collection> getCollectionUriResolver();
Program: 12815
Project: 12815
Buggy source:
public DisplayIdResolver<DnaComponent> getComponentDisplayIdResolver();

Fixed version (ground truth):
DisplayIdResolver<DnaComponent> getComponentDisplayIdResolver();
Program: 12816
Project: 12816
Buggy source:
public DisplayIdResolver<Collection> getCollectionDisplayIdResolver();

Fixed version (ground truth):
DisplayIdResolver<Collection> getCollectionDisplayIdResolver();
Program: 12817
Project: 12817
Buggy source:
public UriResolver<DnaSequence> getSequenceUriResolver();

Fixed version (ground truth):
UriResolver<DnaSequence> getSequenceUriResolver();
Program: 12818
Project: 12818
Buggy source:
/** 
 * Orientation of feature is the + or - strand. Sequences used are by convention assumed 5' to 3', therefore the  <code>+</code> strand is 5' to 3' and the <code>-</code> strand  is 3' to 5'.
 * @return <code>+</code> if feature aligns in same direction as DnaComponent,<code>-</code> if feature aligns in opposite direction as DnaComponent.
 */
public StrandType getStrand();

Fixed version (ground truth):
/** 
 * Orientation of feature is the + or - strand. Sequences used are by convention assumed 5' to 3', therefore the  <code>+</code> strand is 5' to 3' and the <code>-</code> strand  is 3' to 5'.
 * @return <code>+</code> if feature aligns in same direction as DnaComponent,<code>-</code> if feature aligns in opposite direction as DnaComponent.
 */
StrandType getStrand();
Program: 12819
Project: 12819
Buggy source:
public void setSubComponent(DnaComponent subComponent);

Fixed version (ground truth):
void setSubComponent(DnaComponent subComponent);
Program: 12820
Project: 12820
Buggy source:
public List<SequenceAnnotation> getPrecedes();

Fixed version (ground truth):
List<SequenceAnnotation> getPrecedes();
Program: 12821
Project: 12821
Buggy source:
public void removePrecede(SequenceAnnotation precede);

Fixed version (ground truth):
void removePrecede(SequenceAnnotation precede);
Program: 12822
Project: 12822
Buggy source:
/** 
 * Last position of the Sequence Feature on the DnaComponent. Coordinate in terms of the DnaSequence of the DnaComponent annotated.
 * @return positive integer coordinate of last base of the SequenceFeature
 */
public Integer getBioEnd();

Fixed version (ground truth):
/** 
 * Last position of the Sequence Feature on the DnaComponent. Coordinate in terms of the DnaSequence of the DnaComponent annotated.
 * @return positive integer coordinate of last base of the SequenceFeature
 */
Integer getBioEnd();
Program: 12823
Project: 12823
Buggy source:
public DnaComponent getSubComponent();

Fixed version (ground truth):
DnaComponent getSubComponent();
Program: 12824
Project: 12824
Buggy source:
public void setBioEnd(Integer bioEnd);

Fixed version (ground truth):
void setBioEnd(Integer bioEnd);
Program: 12825
Project: 12825
Buggy source:
public void addPrecede(SequenceAnnotation precede);

Fixed version (ground truth):
void addPrecede(SequenceAnnotation precede);
Program: 12826
Project: 12826
Buggy source:
public void setBioStart(Integer bioStart);

Fixed version (ground truth):
void setBioStart(Integer bioStart);
Program: 12827
Project: 12827
Buggy source:
public void setStrand(StrandType strand);

Fixed version (ground truth):
void setStrand(StrandType strand);
Program: 12828
Project: 12828
Buggy source:
/** 
 * First position of the Sequence Feature being annotated. Start coordinate is in terms of the DnaSequence of the DnaComponent annotated.
 * @return positive integer coordinate of first base of the SequenceFeature.
 */
public Integer getBioStart();

Fixed version (ground truth):
/** 
 * First position of the Sequence Feature being annotated. Start coordinate is in terms of the DnaSequence of the DnaComponent annotated.
 * @return positive integer coordinate of first base of the SequenceFeature.
 */
Integer getBioStart();
Program: 12829
Project: 12829
Buggy source:
public List<Element> getAny(){
  if (any == null) {
    any=new ArrayList<Element>();
  }
  return this.any;
}

Fixed version (ground truth):
public List<Element> getAny(){
  if (any == null) {
    any=new ArrayList<>();
  }
  return this.any;
}
Program: 12830
Project: 12830
Buggy source:
/** 
 * Sets the value of this Annotation object to the specified argument.
 * @param value
 */
public void setValue(NamedProperty<QName> value){
  this.value=value;
}

Fixed version (ground truth):
/** 
 * Sets the value of this Annotation object to the specified argument.
 */
public void setValue(NamedProperty<QName> value){
  this.value=value;
}
Program: 12831
Project: 12831
Buggy source:
/** 
 * Makes a deep copy of this Annotation object. 
 * @return an Annotation object that is the exact copy of this object. 
 */
public Annotation copy(){
  Annotation cloned=this.deepCopy();
  return cloned;
}

Fixed version (ground truth):
/** 
 * Makes a deep copy of this Annotation object. 
 * @return an Annotation object that is the exact copy of this object. 
 */
public Annotation copy(){
  return this.deepCopy();
}
Program: 12832
Project: 12832
Buggy source:
/** 
 * Makes a deep copy of this Annotation object. 
 * @param displayId
 * @return an Annotation object that is the exact copy of this object. 
 */
private Annotation deepCopy(){
  return new Annotation(this);
}

Fixed version (ground truth):
/** 
 * Makes a deep copy of this Annotation object. 
 * @return an Annotation object that is the exact copy of this object.
 */
private Annotation deepCopy(){
  return new Annotation(this);
}
Program: 12833
Project: 12833
Buggy source:
/** 
 * Adds the specified member URI to the list of members.  
 * @param memberURI
 */
public void addMember(URI memberURI){
  if (sbolDocument != null && sbolDocument.isComplete()) {
    if (sbolDocument.getTopLevel(memberURI) == null) {
      throw new IllegalArgumentException("String_Node_Str" + memberURI + "String_Node_Str");
    }
  }
  members.add(memberURI);
}

Fixed version (ground truth):
/** 
 * Adds the specified member URI to the list of members.  
 */
public void addMember(URI memberURI){
  if (sbolDocument != null && sbolDocument.isComplete()) {
    if (sbolDocument.getTopLevel(memberURI) == null) {
      throw new IllegalArgumentException("String_Node_Str" + memberURI + "String_Node_Str");
    }
  }
  members.add(memberURI);
}
Program: 12834
Project: 12834
Buggy source:
/** 
 * Returns the set of member URIs referenced by this object.
 * @return the set of member URIs referenced by this object.
 */
public Set<URI> getMemberURIs(){
  Set<URI> result=new HashSet<URI>();
  result.addAll(members);
  return result;
}

Fixed version (ground truth):
/** 
 * Returns the set of member URIs referenced by this object.
 * @return the set of member URIs referenced by this object.
 */
public Set<URI> getMemberURIs(){
  Set<URI> result=new HashSet<>();
  result.addAll(members);
  return result;
}
Program: 12835
Project: 12835
Buggy source:
/** 
 * Removes the member matching the specified URI from the list of members if present.
 * @param memberURI
 * @return the matching instance if present, or <code>null</code> if not present.
 */
public boolean removeMember(URI memberURI){
  return members.remove(memberURI);
}

Fixed version (ground truth):
/** 
 * Removes the member matching the specified URI from the list of members if present.
 * @return the matching instance if present, or <code>null</code> if not present.
 */
public boolean removeMember(URI memberURI){
  return members.remove(memberURI);
}
Program: 12836
Project: 12836
Buggy source:
@Override protected boolean checkDescendantsURIcompliance(){
  if (!isURIcompliant(this.getIdentity(),0)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override protected boolean checkDescendantsURIcompliance(){
  return isURIcompliant(this.getIdentity(),0);
}
Program: 12837
Project: 12837
Buggy source:
private Collection(Collection collection){
  super(collection.getIdentity());
  Set<URI> newMembers=new HashSet<URI>();
  for (  URI member : collection.getMemberURIs()) {
    newMembers.add(member);
  }
}

Fixed version (ground truth):
private Collection(Collection collection){
  super(collection.getIdentity());
  Set<URI> newMembers=new HashSet<>();
  for (  URI member : collection.getMemberURIs()) {
    newMembers.add(member);
  }
}
Program: 12838
Project: 12838
Buggy source:
/** 
 * Clears the existing list of members, then set the members of this object to   the specified list of members.
 * @param members
 */
public void setMembers(Set<URI> members){
  clearMembers();
  for (  URI member : members) {
    addMember(member);
  }
}

Fixed version (ground truth):
/** 
 * Clears the existing list of members, then set the members of this object to   the specified list of members.
 */
public void setMembers(Set<URI> members){
  clearMembers();
  for (  URI member : members) {
    addMember(member);
  }
}