Program: 12631
Project: 12631
Buggy source:
private static ComponentDefinition parseComponentDefinitions(SBOLDocument SBOLDoc,TopLevelDocument<QName> topLevel,Map<URI,NestedDocument<QName>> nested){
  String displayId=null;
  String name=null;
  String description=null;
  URI persistentIdentity=null;
  URI structure=null;
  String version=null;
  URI wasDerivedFrom=null;
  Set<URI> type=new HashSet<>();
  Set<URI> roles=new HashSet<>();
  List<Component> components=new ArrayList<>();
  List<Annotation> annotations=new ArrayList<>();
  List<SequenceAnnotation> sequenceAnnotations=new ArrayList<>();
  List<SequenceConstraint> sequenceConstraints=new ArrayList<>();
  for (  NamedProperty<QName> namedProperty : topLevel.getProperties()) {
    if (namedProperty.getName().equals(Sbol2Terms.Identified.version)) {
      version=((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.displayId)) {
      displayId=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.type)) {
      type.add(URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString()));
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Model.roles)) {
      roles.add(URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString()));
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasComponent)) {
      if (namedProperty.getValue() instanceof NestedDocument) {
        components.add(parseComponent(((NestedDocument<QName>)namedProperty.getValue()),nested));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        components.add(parseComponent(nested.get(uri),nested));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasSubComponent)) {
      System.out.println("String_Node_Str");
      if (namedProperty.getValue() instanceof NestedDocument) {
        components.add(parseComponent(((NestedDocument<QName>)namedProperty.getValue()),nested));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        components.add(parseComponent(nested.get(uri),nested));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasSequence)) {
      structure=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasSequenceAnnotations)) {
      if (namedProperty.getValue() instanceof NestedDocument) {
        sequenceAnnotations.add(parseSequenceAnnotation(((NestedDocument<QName>)namedProperty.getValue()),nested));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        sequenceAnnotations.add(parseSequenceAnnotation(nested.get(uri),nested));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasSequenceConstraints)) {
      if (namedProperty.getValue() instanceof NestedDocument) {
        sequenceConstraints.add(parseSequenceConstraint(((NestedDocument<QName>)namedProperty.getValue())));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        sequenceConstraints.add(parseSequenceConstraint(nested.get(uri)));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.title)) {
      name=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.description)) {
      description=((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));
    }
  }
  ComponentDefinition c=new ComponentDefinition(topLevel.getIdentity(),type);
  if (roles != null)   c.setRoles(roles);
  if (displayId != null)   c.setDisplayId(displayId);
  if (persistentIdentity != null)   c.setPersistentIdentity(persistentIdentity);
  if (structure != null)   c.addSequence(structure);
  if (!components.isEmpty())   c.setComponents(components);
  if (!sequenceAnnotations.isEmpty())   c.setSequenceAnnotations(sequenceAnnotations);
  if (!sequenceConstraints.isEmpty())   c.setSequenceConstraints(sequenceConstraints);
  if (name != null)   c.setName(name);
  if (description != null)   c.setDescription(description);
  if (!annotations.isEmpty())   c.setAnnotations(annotations);
  if (version != null)   c.setVersion(version);
  if (wasDerivedFrom != null)   c.setWasDerivedFrom(wasDerivedFrom);
  ComponentDefinition oldC=SBOLDoc.getComponentDefinition(topLevel.getIdentity());
  if (oldC == null) {
    SBOLDoc.addComponentDefinition(c);
  }
 else {
    if (!c.equals(oldC)) {
      throw new SBOLValidationException("String_Node_Str" + topLevel.getIdentity());
    }
  }
  return c;
}

Fixed version (ground truth):
private static ComponentDefinition parseComponentDefinitions(SBOLDocument SBOLDoc,TopLevelDocument<QName> topLevel,Map<URI,NestedDocument<QName>> nested){
  String displayId=null;
  String name=null;
  String description=null;
  URI persistentIdentity=null;
  String version=null;
  URI wasDerivedFrom=null;
  Set<URI> type=new HashSet<>();
  Set<URI> roles=new HashSet<>();
  Set<URI> structures=new HashSet<>();
  List<Component> components=new ArrayList<>();
  List<Annotation> annotations=new ArrayList<>();
  List<SequenceAnnotation> sequenceAnnotations=new ArrayList<>();
  List<SequenceConstraint> sequenceConstraints=new ArrayList<>();
  for (  NamedProperty<QName> namedProperty : topLevel.getProperties()) {
    if (namedProperty.getName().equals(Sbol2Terms.Identified.version)) {
      version=((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.displayId)) {
      displayId=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.type)) {
      type.add(URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString()));
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Model.roles)) {
      roles.add(URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString()));
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasComponent)) {
      if (namedProperty.getValue() instanceof NestedDocument) {
        components.add(parseComponent(((NestedDocument<QName>)namedProperty.getValue()),nested));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        components.add(parseComponent(nested.get(uri),nested));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasSubComponent)) {
      System.out.println("String_Node_Str");
      if (namedProperty.getValue() instanceof NestedDocument) {
        components.add(parseComponent(((NestedDocument<QName>)namedProperty.getValue()),nested));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        components.add(parseComponent(nested.get(uri),nested));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasSequence)) {
      structures.add(URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString()));
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasSequenceAnnotations)) {
      if (namedProperty.getValue() instanceof NestedDocument) {
        sequenceAnnotations.add(parseSequenceAnnotation(((NestedDocument<QName>)namedProperty.getValue()),nested));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        sequenceAnnotations.add(parseSequenceAnnotation(nested.get(uri),nested));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.ComponentDefinition.hasSequenceConstraints)) {
      if (namedProperty.getValue() instanceof NestedDocument) {
        sequenceConstraints.add(parseSequenceConstraint(((NestedDocument<QName>)namedProperty.getValue())));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        sequenceConstraints.add(parseSequenceConstraint(nested.get(uri)));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.title)) {
      name=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.description)) {
      description=((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));
    }
  }
  ComponentDefinition c=new ComponentDefinition(topLevel.getIdentity(),type);
  if (roles != null)   c.setRoles(roles);
  if (displayId != null)   c.setDisplayId(displayId);
  if (persistentIdentity != null)   c.setPersistentIdentity(persistentIdentity);
  if (!structures.isEmpty())   c.setSequences(structures);
  if (!components.isEmpty())   c.setComponents(components);
  if (!sequenceAnnotations.isEmpty())   c.setSequenceAnnotations(sequenceAnnotations);
  if (!sequenceConstraints.isEmpty())   c.setSequenceConstraints(sequenceConstraints);
  if (name != null)   c.setName(name);
  if (description != null)   c.setDescription(description);
  if (!annotations.isEmpty())   c.setAnnotations(annotations);
  if (version != null)   c.setVersion(version);
  if (wasDerivedFrom != null)   c.setWasDerivedFrom(wasDerivedFrom);
  ComponentDefinition oldC=SBOLDoc.getComponentDefinition(topLevel.getIdentity());
  if (oldC == null) {
    SBOLDoc.addComponentDefinition(c);
  }
 else {
    if (!c.equals(oldC)) {
      throw new SBOLValidationException("String_Node_Str" + topLevel.getIdentity());
    }
  }
  return c;
}