Program: 25611
Project: 25611
Buggy source:
private void setSliverTypes(Statement resource,NodeContents geniNode){
  StmtIterator canImplement=resource.getResource().listProperties(Omn_lifecycle.canImplement);
  if (resource.getResource().hasProperty(Omn_resource.hasSliverType)) {
    final List<Statement> hasSliverNames=resource.getResource().listProperties(Omn_resource.hasSliverType).toList();
    if (hasSliverNames.get(0).getObject().asResource().hasProperty(RDF.type,Omn_resource.SliverType)) {
      for (      final Statement hasSliverName : hasSliverNames) {
        SliverType sliverType=new ObjectFactory().createNodeContentsSliverType();
        Resource sliverTypeResource=hasSliverName.getObject().asResource();
        if (sliverTypeResource.hasProperty(Omn_lifecycle.hasSliverName)) {
          String sliverName=sliverTypeResource.getProperty(Omn_lifecycle.hasSliverName).getObject().asLiteral().getString();
          sliverType.setName(sliverName);
        }
        if (sliverTypeResource != null) {
          setDiskImage(sliverTypeResource,sliverType);
          JAXBElement<SliverType> sliver=new ObjectFactory().createNodeContentsSliverType(sliverType);
          geniNode.getAnyOrRelationOrLocation().add(sliver);
        }
      }
    }
  }
 else   if (canImplement.hasNext()) {
    while (canImplement.hasNext()) {
      SliverType sliver1;
      Statement omnSliver=canImplement.next();
      sliver1=of.createNodeContentsSliverType();
      sliver1.setName(omnSliver.getObject().asResource().getURI());
      JAXBElement<SliverType> sliverType=new ObjectFactory().createNodeContentsSliverType(sliver1);
      geniNode.getAnyOrRelationOrLocation().add(sliverType);
    }
  }
 else {
    SliverType sliverType=new ObjectFactory().createNodeContentsSliverType();
    final List<Statement> hasTypes=resource.getResource().listProperties(RDF.type).toList();
    boolean sliverTypeNameExists=false;
    for (    final Statement hasType : hasTypes) {
      Resource sliverResource=hasType.getObject().asResource();
      if (AbstractConverter.nonGeneric(sliverResource.getURI())) {
        sliverType.setName(sliverResource.getURI());
        sliverTypeNameExists=true;
      }
    }
    if (sliverTypeNameExists) {
      JAXBElement<SliverType> sliver=new ObjectFactory().createNodeContentsSliverType(sliverType);
      geniNode.getAnyOrRelationOrLocation().add(sliver);
    }
  }
}

Fixed version (ground truth):
private void setSliverTypes(Statement resource,NodeContents geniNode){
  StmtIterator canImplement=resource.getResource().listProperties(Omn_lifecycle.canImplement);
  if (resource.getResource().hasProperty(Omn_resource.hasSliverType)) {
    final List<Statement> hasSliverNames=resource.getResource().listProperties(Omn_resource.hasSliverType).toList();
    if (hasSliverNames.get(0).getObject().asResource().hasProperty(RDF.type,Omn_resource.SliverType)) {
      for (      final Statement hasSliverName : hasSliverNames) {
        SliverType sliverType=new ObjectFactory().createNodeContentsSliverType();
        Resource sliverTypeResource=hasSliverName.getObject().asResource();
        if (sliverTypeResource.hasProperty(Omn_lifecycle.hasSliverName)) {
          String sliverName=sliverTypeResource.getProperty(Omn_lifecycle.hasSliverName).getObject().asLiteral().getString();
          sliverType.setName(sliverName);
        }
        if (sliverTypeResource != null) {
          setDiskImage(sliverTypeResource,sliverType);
          JAXBElement<SliverType> sliver=new ObjectFactory().createNodeContentsSliverType(sliverType);
          geniNode.getAnyOrRelationOrLocation().add(sliver);
        }
      }
    }
  }
 else   if (canImplement.hasNext()) {
    while (canImplement.hasNext()) {
      SliverType sliver1;
      Statement omnSliver=canImplement.next();
      sliver1=of.createNodeContentsSliverType();
      sliver1.setName(omnSliver.getObject().asResource().getURI());
      setDiskImage(omnSliver.getResource(),sliver1);
      JAXBElement<SliverType> sliverType=new ObjectFactory().createNodeContentsSliverType(sliver1);
      geniNode.getAnyOrRelationOrLocation().add(sliverType);
    }
  }
 else {
    SliverType sliverType=new ObjectFactory().createNodeContentsSliverType();
    final List<Statement> hasTypes=resource.getResource().listProperties(RDF.type).toList();
    Resource sliverResource=null;
    boolean sliverTypeNameExists=false;
    for (    final Statement hasType : hasTypes) {
      sliverResource=hasType.getObject().asResource();
      if (AbstractConverter.nonGeneric(sliverResource.getURI())) {
        sliverType.setName(sliverResource.getURI());
        sliverTypeNameExists=true;
      }
    }
    if (sliverTypeNameExists) {
      setDiskImage(sliverResource,sliverType);
      JAXBElement<SliverType> sliver=new ObjectFactory().createNodeContentsSliverType(sliverType);
      geniNode.getAnyOrRelationOrLocation().add(sliver);
    }
  }
}