Program: 12414
Project: 12414
Buggy source:
/** 
 * @param SBOLDoc
 * @param topLevel
 * @param nested
 * @return
 */
private static CombinatorialDerivation parseCombinatorialDerivation(SBOLDocument SBOLDoc,IdentifiableDocument<QName> topLevel,Map<URI,NestedDocument<QName>> nested) throws SBOLValidationException {
  String displayId=null;
  String name=null;
  String description=null;
  URI persistentIdentity=null;
  URI template=null;
  StrategyType strategy=null;
  String version=null;
  Set<URI> wasDerivedFroms=new HashSet<>();
  Set<VariableComponent> variableComponents=new HashSet<>();
  List<Annotation> annotations=new ArrayList<>();
  for (  NamedProperty<QName> namedProperty : topLevel.getProperties()) {
    if (namedProperty.getName().equals(Sbol2Terms.Identified.version)) {
      if (!(namedProperty.getValue() instanceof Literal) || version != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof String))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      version=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.persistentIdentity)) {
      if (!(namedProperty.getValue() instanceof Literal) || persistentIdentity != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof URI))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      persistentIdentity=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.CombinatorialDerivation.template)) {
      if (!(namedProperty.getValue() instanceof Literal) || template != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof URI))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      template=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.CombinatorialDerivation.strategy)) {
      if (!(namedProperty.getValue() instanceof Literal) || strategy != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof URI))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      String strategyTypeStr=((Literal<QName>)namedProperty.getValue()).getValue().toString();
      if (strategyTypeStr.startsWith("String_Node_Str")) {
        System.out.println("String_Node_Str");
        strategyTypeStr=strategyTypeStr.replace("String_Node_Str","String_Node_Str");
      }
      try {
        strategy=StrategyType.convertToStrategyType(URI.create(strategyTypeStr));
      }
 catch (      SBOLValidationException e) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.displayId)) {
      if (!(namedProperty.getValue() instanceof Literal) || displayId != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof String))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      displayId=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.CombinatorialDerivation.variableComponents)) {
      if (namedProperty.getValue() instanceof NestedDocument) {
        NestedDocument<QName> nestedDocument=((NestedDocument<QName>)namedProperty.getValue());
        if (nestedDocument.getType() == null || !nestedDocument.getType().equals(Sbol2Terms.VariableComponent.VariableComponent)) {
          throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
        }
        variableComponents.add(parseVariableComponent(SBOLDoc,((NestedDocument<QName>)namedProperty.getValue()),nested));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        NestedDocument<QName> nestedDocument=nested.get(uri);
        if (nestedDocument == null || nestedDocument.getType() == null || !nestedDocument.getType().equals(Sbol2Terms.VariableComponent.VariableComponent)) {
          throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
        }
        variableComponents.add(parseVariableComponent(SBOLDoc,nested.get(uri),nested));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.title)) {
      if (!(namedProperty.getValue() instanceof Literal) || name != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof String))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      name=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.description)) {
      if (!(namedProperty.getValue() instanceof Literal) || description != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof String))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      description=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.wasDerivedFrom)) {
      if (!(namedProperty.getValue() instanceof Literal) || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof URI))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      wasDerivedFroms.add(URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString()));
    }
 else {
      annotations.add(new Annotation(namedProperty));
    }
  }
  CombinatorialDerivation c=new CombinatorialDerivation(topLevel.getIdentity(),template,strategy);
  if (displayId != null)   c.setDisplayId(displayId);
  if (persistentIdentity != null)   c.setPersistentIdentity(persistentIdentity);
  if (name != null)   c.setName(name);
  if (!variableComponents.isEmpty())   c.setVariableComponents(variableComponents);
  if (description != null)   c.setDescription(description);
  if (!annotations.isEmpty())   c.setAnnotations(annotations);
  if (version != null)   c.setVersion(version);
  c.setWasDerivedFroms(wasDerivedFroms);
  CombinatorialDerivation oldC=SBOLDoc.getCombinatorialDerivation(topLevel.getIdentity());
  if (oldC == null) {
    SBOLDoc.addCombinatorialDerivation(c);
  }
 else {
    if (!c.equals(oldC)) {
      throw new SBOLValidationException("String_Node_Str",c);
    }
  }
  return c;
}

Fixed version (ground truth):
/** 
 * @param SBOLDoc
 * @param topLevel
 * @param nested
 * @return
 */
private static CombinatorialDerivation parseCombinatorialDerivation(SBOLDocument SBOLDoc,IdentifiableDocument<QName> topLevel,Map<URI,NestedDocument<QName>> nested) throws SBOLValidationException {
  String displayId=null;
  String name=null;
  String description=null;
  URI persistentIdentity=null;
  URI template=null;
  StrategyType strategy=null;
  String version=null;
  Set<URI> wasDerivedFroms=new HashSet<>();
  Set<VariableComponent> variableComponents=new HashSet<>();
  List<Annotation> annotations=new ArrayList<>();
  for (  NamedProperty<QName> namedProperty : topLevel.getProperties()) {
    if (namedProperty.getName().equals(Sbol2Terms.Identified.version)) {
      if (!(namedProperty.getValue() instanceof Literal) || version != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof String))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      version=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.persistentIdentity)) {
      if (!(namedProperty.getValue() instanceof Literal) || persistentIdentity != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof URI))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      persistentIdentity=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.CombinatorialDerivation.template)) {
      if (!(namedProperty.getValue() instanceof Literal) || template != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof URI))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      template=URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString());
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.CombinatorialDerivation.strategy)) {
      if (!(namedProperty.getValue() instanceof Literal) || strategy != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof URI))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      String strategyTypeStr=((Literal<QName>)namedProperty.getValue()).getValue().toString();
      if (strategyTypeStr.startsWith("String_Node_Str")) {
        System.out.println("String_Node_Str");
        strategyTypeStr=strategyTypeStr.replace("String_Node_Str","String_Node_Str");
      }
      try {
        strategy=StrategyType.convertToStrategyType(URI.create(strategyTypeStr));
      }
 catch (      SBOLValidationException e) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.displayId)) {
      if (!(namedProperty.getValue() instanceof Literal) || displayId != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof String))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      displayId=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.CombinatorialDerivation.variableComponents)) {
      if (namedProperty.getValue() instanceof NestedDocument) {
        NestedDocument<QName> nestedDocument=((NestedDocument<QName>)namedProperty.getValue());
        if (nestedDocument.getType() == null || !nestedDocument.getType().equals(Sbol2Terms.VariableComponent.VariableComponent)) {
          throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
        }
        variableComponents.add(parseVariableComponent(SBOLDoc,((NestedDocument<QName>)namedProperty.getValue()),nested));
      }
 else {
        URI uri=(URI)((Literal<QName>)namedProperty.getValue()).getValue();
        NestedDocument<QName> nestedDocument=nested.get(uri);
        if (nestedDocument == null || nestedDocument.getType() == null || !nestedDocument.getType().equals(Sbol2Terms.VariableComponent.VariableComponent)) {
          throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
        }
        variableComponents.add(parseVariableComponent(SBOLDoc,nested.get(uri),nested));
      }
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.title)) {
      if (!(namedProperty.getValue() instanceof Literal) || name != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof String))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      name=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.description)) {
      if (!(namedProperty.getValue() instanceof Literal) || description != null || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof String))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      description=((Literal<QName>)namedProperty.getValue()).getValue().toString();
    }
 else     if (namedProperty.getName().equals(Sbol2Terms.Identified.wasDerivedFrom)) {
      if (!(namedProperty.getValue() instanceof Literal) || (!(((Literal<QName>)namedProperty.getValue()).getValue() instanceof URI))) {
        throw new SBOLValidationException("String_Node_Str",topLevel.getIdentity());
      }
      wasDerivedFroms.add(URI.create(((Literal<QName>)namedProperty.getValue()).getValue().toString()));
    }
 else {
      annotations.add(new Annotation(namedProperty));
    }
  }
  CombinatorialDerivation c=new CombinatorialDerivation(topLevel.getIdentity(),strategy,template);
  if (displayId != null)   c.setDisplayId(displayId);
  if (persistentIdentity != null)   c.setPersistentIdentity(persistentIdentity);
  if (name != null)   c.setName(name);
  if (!variableComponents.isEmpty())   c.setVariableComponents(variableComponents);
  if (description != null)   c.setDescription(description);
  if (!annotations.isEmpty())   c.setAnnotations(annotations);
  if (version != null)   c.setVersion(version);
  c.setWasDerivedFroms(wasDerivedFroms);
  CombinatorialDerivation oldC=SBOLDoc.getCombinatorialDerivation(topLevel.getIdentity());
  if (oldC == null) {
    SBOLDoc.addCombinatorialDerivation(c);
  }
 else {
    if (!c.equals(oldC)) {
      throw new SBOLValidationException("String_Node_Str",c);
    }
  }
  return c;
}