Program: 12752
Project: 12752
Buggy source:
private static NamedProperty<QName> getLocation(Location location){
  List<NamedProperty<QName>> property=new ArrayList<NamedProperty<QName>>();
  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,range.getOrientationURI()));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Range.Range,range.getIdentity(),NamedProperties(property)));
  }
 else   if (location instanceof MultiRange) {
    MultiRange multiRange=(MultiRange)location;
    for (    Range r : multiRange.getRanges())     property.add(NamedProperty(Sbol2Terms.MultiRange.hasRanges,r.getIdentity()));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.MultiRange.MultiRange,multiRange.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,cut.getOrientationURI()));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Cut.Cut,cut.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<NamedProperty<QName>>();
  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,range.getOrientationURI()));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.Range.Range,range.getIdentity(),NamedProperties(property)));
  }
 else   if (location instanceof MultiRange) {
    MultiRange multiRange=(MultiRange)location;
    for (    Range r : multiRange.getRanges())     property.add(NamedProperty(Sbol2Terms.MultiRange.hasRanges,r.getIdentity()));
    return NamedProperty(Sbol2Terms.Location.Location,NestedDocument(Sbol2Terms.MultiRange.MultiRange,multiRange.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,cut.getOrientationURI()));
    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,genericLocation.getOrientationURI()));
    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)));
}