Program: 12739
Project: 12739
Buggy source:
private static GenericLocation parseGenericLocation(NestedDocument<QName> typeGenLoc){
  URI persistentIdentity=null;
  String displayId=null;
  URI orientation=null;
  String version=null;
  URI wasDerivedFrom=null;
  List<Annotation> annotations=new ArrayList<>();
  for (  NamedProperty<QName> namedProperty : typeGenLoc.getProperties()) {
    if (namedProperty.getName().equals(Sbol2Terms.GenericLocation.orientation)) {
      orientation=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Documented.displayId)) {
      displayId=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.persistentIdentity)) {
      persistentIdentity=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.version)) {
      version=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(ProvTerms.Prov.wasDerivedFrom)) {
      wasDerivedFrom=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else {
      annotations.add(new Annotation(namedProperty));
    }
  }
  GenericLocation gl=new GenericLocation(typeGenLoc.getIdentity());
  if (displayId != null)   gl.setDisplayId(displayId);
  if (orientation != null)   gl.setOrientation(orientation);
  if (persistentIdentity != null)   gl.setPersistentIdentity(persistentIdentity);
  if (version != null)   gl.setVersion(version);
  if (wasDerivedFrom != null)   gl.setWasDerivedFrom(wasDerivedFrom);
  if (!annotations.isEmpty())   gl.setAnnotations(annotations);
  return gl;
}

Fixed version (ground truth):
private static GenericLocation parseGenericLocation(NestedDocument<QName> typeGenLoc){
  URI persistentIdentity=null;
  String displayId=null;
  URI orientation=null;
  String version=null;
  URI wasDerivedFrom=null;
  List<Annotation> annotations=new ArrayList<>();
  for (  NamedProperty<QName> namedProperty : typeGenLoc.getProperties()) {
    if (namedProperty.getName().equals(Sbol2Terms.GenericLocation.orientation)) {
      orientation=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Documented.displayId)) {
      displayId=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.persistentIdentity)) {
      persistentIdentity=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.version)) {
      version=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.wasDerivedFrom)) {
      wasDerivedFrom=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else {
      annotations.add(new Annotation(namedProperty));
    }
  }
  GenericLocation gl=new GenericLocation(typeGenLoc.getIdentity());
  if (displayId != null)   gl.setDisplayId(displayId);
  if (orientation != null)   gl.setOrientation(orientation);
  if (persistentIdentity != null)   gl.setPersistentIdentity(persistentIdentity);
  if (version != null)   gl.setVersion(version);
  if (wasDerivedFrom != null)   gl.setWasDerivedFrom(wasDerivedFrom);
  if (!annotations.isEmpty())   gl.setAnnotations(annotations);
  return gl;
}