Program: 12751
Project: 12751
Buggy source:
private static SequenceAnnotation parseSequenceAnnotationV1(SBOLDocument SBOLDoc,NestedDocument<QName> sequenceAnnotation,List<SBOLPair> precedePairs,URI parentURI,int sa_num){
  Integer start=null;
  Integer end=null;
  String strand=null;
  URI componentURI=null;
  URI identity=sequenceAnnotation.getIdentity();
  List<Annotation> annotations=new ArrayList<Annotation>();
  if (setURIPrefix != null) {
    identity=URI.create(getParentURI(parentURI) + "String_Node_Str" + sa_num+ "String_Node_Str");
  }
  for (  NamedProperty<QName> namedProperty : sequenceAnnotation.getProperties()) {
    if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.bioStart)) {
      String temp=((Literal<QName>)namedProperty.getValue()).getValue().toString();
      start=Integer.parseInt(temp);
    }
 else     if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.bioEnd)) {
      String temp2=((Literal<QName>)namedProperty.getValue()).getValue().toString();
      end=Integer.parseInt(temp2);
    }
 else     if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.strand)) {
      strand=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.subComponent)) {
      componentURI=parseDnaComponentV1(SBOLDoc,(NestedDocument<QName>)namedProperty.getValue()).getIdentity();
    }
 else     if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.precedes)) {
      URI left=sequenceAnnotation.getIdentity();
      URI right=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
      SBOLPair pair=new SBOLPair(left,right);
      precedePairs.add(pair);
    }
 else {
      annotations.add(new Annotation(namedProperty));
    }
  }
  Location location=null;
  if (start != null && end != null) {
    URI range_identity=URI.create(getParentURI(identity) + "String_Node_Str");
    Range r=new Range(range_identity,start,end);
    if (strand != null) {
      if (strand.equals("String_Node_Str")) {
        r.setOrientation(Sbol2Terms.Orientation.inline);
      }
 else       if (strand.equals("String_Node_Str")) {
        r.setOrientation(Sbol2Terms.Orientation.reverseComplement);
      }
      location=r;
    }
  }
 else {
    URI dummyGenericLoc_id=URI.create(getParentURI(identity) + "String_Node_Str");
    GenericLocation dummyGenericLoc=new GenericLocation(dummyGenericLoc_id);
    if (strand != null) {
      if (strand.equals("String_Node_Str")) {
        dummyGenericLoc.setOrientation(Sbol2Terms.Orientation.inline);
      }
 else       if (strand.equals("String_Node_Str")) {
        dummyGenericLoc.setOrientation(Sbol2Terms.Orientation.reverseComplement);
      }
      location=dummyGenericLoc;
    }
  }
  SequenceAnnotation s=new SequenceAnnotation(identity,location);
  if (identity != sequenceAnnotation.getIdentity())   s.setWasDerivedFrom(sequenceAnnotation.getIdentity());
  if (componentURI != null)   s.setComponent(componentURI);
  if (!annotations.isEmpty())   s.setAnnotations(annotations);
  return s;
}

Fixed version (ground truth):
private static SequenceAnnotation parseSequenceAnnotationV1(SBOLDocument SBOLDoc,NestedDocument<QName> sequenceAnnotation,List<SBOLPair> precedePairs,String parentURI,int sa_num){
  Integer start=null;
  Integer end=null;
  String strand=null;
  URI componentURI=null;
  URI identity=sequenceAnnotation.getIdentity();
  String persIdentity="String_Node_Str";
  List<Annotation> annotations=new ArrayList<Annotation>();
  if (setURIPrefix != null) {
    persIdentity=parentURI + "String_Node_Str" + sa_num;
    identity=URI.create(persIdentity + "String_Node_Str");
  }
  for (  NamedProperty<QName> namedProperty : sequenceAnnotation.getProperties()) {
    if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.bioStart)) {
      String temp=((Literal<QName>)namedProperty.getValue()).getValue().toString();
      start=Integer.parseInt(temp);
    }
 else     if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.bioEnd)) {
      String temp2=((Literal<QName>)namedProperty.getValue()).getValue().toString();
      end=Integer.parseInt(temp2);
    }
 else     if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.strand)) {
      strand=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.subComponent)) {
      componentURI=parseDnaComponentV1(SBOLDoc,(NestedDocument<QName>)namedProperty.getValue()).getIdentity();
    }
 else     if (namedProperty.getName().equals(Sbol1Terms.SequenceAnnotations.precedes)) {
      URI left=sequenceAnnotation.getIdentity();
      URI right=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
      SBOLPair pair=new SBOLPair(left,right);
      precedePairs.add(pair);
    }
 else {
      annotations.add(new Annotation(namedProperty));
    }
  }
  Location location=null;
  if (start != null && end != null) {
    URI range_identity=URI.create(persIdentity + "String_Node_Str");
    Range r=new Range(range_identity,start,end);
    if (strand != null) {
      if (strand.equals("String_Node_Str")) {
        r.setOrientation(Sbol2Terms.Orientation.inline);
      }
 else       if (strand.equals("String_Node_Str")) {
        r.setOrientation(Sbol2Terms.Orientation.reverseComplement);
      }
      location=r;
    }
  }
 else {
    URI dummyGenericLoc_id=URI.create(persIdentity + "String_Node_Str");
    GenericLocation dummyGenericLoc=new GenericLocation(dummyGenericLoc_id);
    if (strand != null) {
      if (strand.equals("String_Node_Str")) {
        dummyGenericLoc.setOrientation(Sbol2Terms.Orientation.inline);
      }
 else       if (strand.equals("String_Node_Str")) {
        dummyGenericLoc.setOrientation(Sbol2Terms.Orientation.reverseComplement);
      }
      location=dummyGenericLoc;
    }
  }
  SequenceAnnotation s=new SequenceAnnotation(identity,location);
  if (identity != sequenceAnnotation.getIdentity())   s.setWasDerivedFrom(sequenceAnnotation.getIdentity());
  if (componentURI != null)   s.setComponent(componentURI);
  if (!annotations.isEmpty())   s.setAnnotations(annotations);
  return s;
}