Program: 12693
Project: 12693
Buggy source:
private static NamedProperty<QName> getLocation(Location location){
  List<NamedProperty<QName>> property=new ArrayList<>();
  formatCommonIdentifiedData(property,location);
  if (location instanceof Range) {
    Range range=(Range)location;
    property.add(NamedProperty(Sbol2Terms.Range.start,range.getStart()));
    property.add(NamedProperty(Sbol2Terms.Range.end,range.getEnd()));
    if (range.isSetOrientation())     property.add(NamedProperty(Sbol2Terms.Range.orientation,OrientationType.convertToURI(range.getOrientation())));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Range.Range,range.getIdentity(),NamedProperties(property)));
  }
 else   if (location instanceof Cut) {
    Cut cut=(Cut)location;
    property.add(NamedProperty(Sbol2Terms.Cut.at,cut.getAt()));
    property.add(NamedProperty(Sbol2Terms.Cut.orientation,OrientationType.convertToURI(cut.getOrientation())));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Cut.Cut,cut.getIdentity(),NamedProperties(property)));
  }
 else   if (location instanceof GenericLocation) {
    GenericLocation genericLocation=(GenericLocation)location;
    property.add(NamedProperty(Sbol2Terms.GenericLocation.orientation,OrientationType.convertToURI(genericLocation.getOrientation())));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.GenericLocation.GenericLocation,genericLocation.getIdentity(),NamedProperties(property)));
  }
  return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Range.Range,location.getIdentity(),NamedProperties(property)));
}

Fixed version (ground truth):
private static NamedProperty<QName> getLocation(Location location){
  List<NamedProperty<QName>> property=new ArrayList<>();
  formatCommonIdentifiedData(property,location);
  if (location instanceof Range) {
    Range range=(Range)location;
    property.add(NamedProperty(Sbol2Terms.Range.start,range.getStart()));
    property.add(NamedProperty(Sbol2Terms.Range.end,range.getEnd()));
    if (range.isSetOrientation())     property.add(NamedProperty(Sbol2Terms.Range.orientation,OrientationType.convertToURI(range.getOrientation())));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Range.Range,range.getIdentity(),NamedProperties(property)));
  }
 else   if (location instanceof Cut) {
    Cut cut=(Cut)location;
    property.add(NamedProperty(Sbol2Terms.Cut.at,cut.getAt()));
    if (cut.isSetOrientation())     property.add(NamedProperty(Sbol2Terms.Cut.orientation,OrientationType.convertToURI(cut.getOrientation())));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Cut.Cut,cut.getIdentity(),NamedProperties(property)));
  }
 else   if (location instanceof GenericLocation) {
    GenericLocation genericLocation=(GenericLocation)location;
    if (genericLocation.isSetOrientation())     property.add(NamedProperty(Sbol2Terms.GenericLocation.orientation,OrientationType.convertToURI(genericLocation.getOrientation())));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.GenericLocation.GenericLocation,genericLocation.getIdentity(),NamedProperties(property)));
  }
  return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Range.Range,location.getIdentity(),NamedProperties(property)));
}