Program: 12737
Project: 12737
Buggy source:
private static FunctionalComponent parseFunctionalComponents(NestedDocument<QName> functionalComponent){
  URI persistentIdentity=null;
  String version=null;
  String displayId=null;
  String name=null;
  String description=null;
  AccessType access=null;
  DirectionType direction=null;
  URI functionalComponentURI=null;
  URI wasDerivedFrom=null;
  List<Annotation> annotations=new ArrayList<>();
  List<MapsTo> mappings=new ArrayList<>();
  for (  NamedProperty<QName> f : functionalComponent.getProperties()) {
    if (f.getName().equals(Sbol2Terms.Identified.persistentIdentity)) {
      persistentIdentity=URI.create(((Literal<QName>)f.getValue()).getValue().toString());
    }
 else     if (f.getName().equals(Sbol2Terms.Identified.version)) {
      version=((Literal<QName>)f.getValue()).getValue().toString();
    }
 else     if (f.getName().equals(Sbol2Terms.Documented.displayId)) {
      displayId=((Literal<QName>)f.getValue()).getValue().toString();
    }
 else     if (f.getName().equals(Sbol2Terms.ComponentInstance.access)) {
      access=ComponentInstance.AccessType.convertToAccessType(URI.create(((Literal<QName>)f.getValue()).getValue().toString()));
    }
 else     if (f.getName().equals(Sbol2Terms.FunctionalComponent.direction)) {
      direction=FunctionalComponent.DirectionType.convertToDirectionType(URI.create(((Literal<QName>)f.getValue()).getValue().toString()));
    }
 else     if (f.getName().equals(Sbol2Terms.ComponentInstance.hasMapsTo)) {
      mappings.add(parseMapsTo((NestedDocument<QName>)f.getValue()));
    }
 else     if (f.getName().equals(Sbol2Terms.ComponentInstance.hasComponentDefinition)) {
      functionalComponentURI=URI.create(((Literal<QName>)f.getValue()).getValue().toString());
    }
 else     if (f.getName().equals(Sbol2Terms.Documented.title)) {
      name=((Literal<QName>)f.getValue()).getValue().toString();
    }
 else     if (f.getName().equals(Sbol2Terms.Documented.description)) {
      description=((Literal<QName>)f.getValue()).getValue().toString();
    }
 else     if (f.getName().equals(ProvTerms.Prov.wasDerivedFrom)) {
      wasDerivedFrom=URI.create(((Literal<QName>)f.getValue()).getValue().toString());
    }
 else {
      annotations.add(new Annotation(f));
    }
  }
  FunctionalComponent fc=new FunctionalComponent(functionalComponent.getIdentity(),access,functionalComponentURI,direction);
  if (persistentIdentity != null)   fc.setPersistentIdentity(persistentIdentity);
  if (version != null)   fc.setVersion(version);
  if (displayId != null)   fc.setDisplayId(displayId);
  if (!mappings.isEmpty())   fc.setMapsTo(mappings);
  if (name != null)   fc.setName(name);
  if (description != null)   fc.setDescription(description);
  if (wasDerivedFrom != null)   fc.setWasDerivedFrom(wasDerivedFrom);
  if (!annotations.isEmpty())   fc.setAnnotations(annotations);
  return fc;
}

Fixed version (ground truth):
private static FunctionalComponent parseFunctionalComponents(NestedDocument<QName> functionalComponent){
  URI persistentIdentity=null;
  String version=null;
  String displayId=null;
  String name=null;
  String description=null;
  AccessType access=null;
  DirectionType direction=null;
  URI functionalComponentURI=null;
  URI wasDerivedFrom=null;
  List<Annotation> annotations=new ArrayList<>();
  List<MapsTo> mappings=new ArrayList<>();
  for (  NamedProperty<QName> f : functionalComponent.getProperties()) {
    if (f.getName().equals(Sbol2Terms.Identified.persistentIdentity)) {
      persistentIdentity=URI.create(((Literal<QName>)f.getValue()).getValue().toString());
    }
 else     if (f.getName().equals(Sbol2Terms.Identified.version)) {
      version=((Literal<QName>)f.getValue()).getValue().toString();
    }
 else     if (f.getName().equals(Sbol2Terms.Documented.displayId)) {
      displayId=((Literal<QName>)f.getValue()).getValue().toString();
    }
 else     if (f.getName().equals(Sbol2Terms.ComponentInstance.access)) {
      access=ComponentInstance.AccessType.convertToAccessType(URI.create(((Literal<QName>)f.getValue()).getValue().toString()));
    }
 else     if (f.getName().equals(Sbol2Terms.FunctionalComponent.direction)) {
      direction=FunctionalComponent.DirectionType.convertToDirectionType(URI.create(((Literal<QName>)f.getValue()).getValue().toString()));
    }
 else     if (f.getName().equals(Sbol2Terms.ComponentInstance.hasMapsTo)) {
      mappings.add(parseMapsTo((NestedDocument<QName>)f.getValue()));
    }
 else     if (f.getName().equals(Sbol2Terms.ComponentInstance.hasComponentDefinition)) {
      functionalComponentURI=URI.create(((Literal<QName>)f.getValue()).getValue().toString());
    }
 else     if (f.getName().equals(Sbol2Terms.Documented.title)) {
      name=((Literal<QName>)f.getValue()).getValue().toString();
    }
 else     if (f.getName().equals(Sbol2Terms.Documented.description)) {
      description=((Literal<QName>)f.getValue()).getValue().toString();
    }
 else     if (f.getName().equals(Sbol2Terms.Identified.wasDerivedFrom)) {
      wasDerivedFrom=URI.create(((Literal<QName>)f.getValue()).getValue().toString());
    }
 else {
      annotations.add(new Annotation(f));
    }
  }
  FunctionalComponent fc=new FunctionalComponent(functionalComponent.getIdentity(),access,functionalComponentURI,direction);
  if (persistentIdentity != null)   fc.setPersistentIdentity(persistentIdentity);
  if (version != null)   fc.setVersion(version);
  if (displayId != null)   fc.setDisplayId(displayId);
  if (!mappings.isEmpty())   fc.setMapsTo(mappings);
  if (name != null)   fc.setName(name);
  if (description != null)   fc.setDescription(description);
  if (wasDerivedFrom != null)   fc.setWasDerivedFrom(wasDerivedFrom);
  if (!annotations.isEmpty())   fc.setAnnotations(annotations);
  return fc;
}