Program: 9442
Project: 9442
Buggy source:
private void dematerialize(){
  long dematStartTime=System.currentTimeMillis();
  logger.debug("String_Node_Str");
  Set<NamedClass> classes=rc.getNamedClasses();
  int i=1;
  for (  NamedClass atomicConcept : classes) {
    SortedSet<Individual> pos=rc.getIndividuals(atomicConcept);
    classInstancesPos.put(atomicConcept,(TreeSet<Individual>)pos);
    if (isDefaultNegation()) {
      classInstancesNeg.put(atomicConcept,(TreeSet<Individual>)Helper.difference(individuals,pos));
    }
 else {
      Negation negatedAtomicConcept=new Negation(atomicConcept);
      classInstancesNeg.put(atomicConcept,(TreeSet<Individual>)rc.getIndividuals(negatedAtomicConcept));
    }
  }
  logger.debug("String_Node_Str");
  for (  ObjectProperty atomicRole : atomicRoles) {
    opPos.put(atomicRole,rc.getPropertyMembers(atomicRole));
  }
  logger.debug("String_Node_Str");
  for (  DatatypeProperty atomicRole : datatypeProperties) {
    dpPos.put(atomicRole,rc.getDatatypeMembers(atomicRole));
  }
  for (  DatatypeProperty dp : booleanDatatypeProperties) {
    bdPos.put(dp,(TreeSet<Individual>)rc.getTrueDatatypeMembers(dp));
    bdNeg.put(dp,(TreeSet<Individual>)rc.getFalseDatatypeMembers(dp));
  }
  for (  DatatypeProperty dp : intDatatypeProperties) {
    id.put(dp,rc.getIntDatatypeMembers(dp));
  }
  for (  DatatypeProperty dp : doubleDatatypeProperties) {
    dd.put(dp,rc.getDoubleDatatypeMembers(dp));
  }
  for (  DatatypeProperty dp : stringDatatypeProperties) {
    sd.put(dp,rc.getStringDatatypeMembers(dp));
  }
  List<OWLOntology> ontologies=rc.getOWLAPIOntologies();
  for (  OWLOntology ontology : ontologies) {
    Set<OWLClassAssertionAxiom> axioms=ontology.getAxioms(AxiomType.CLASS_ASSERTION);
    for (    OWLClassAssertionAxiom axiom : axioms) {
      OWLIndividual ind=axiom.getIndividual();
      OWLClassExpression ce=axiom.getClassExpression();
      if (ce instanceof OWLObjectSomeValuesFrom) {
        System.out.println(axiom);
        OWLObjectPropertyExpression propertyExpression=((OWLObjectSomeValuesFrom)ce).getProperty();
        OWLClassExpression filler=((OWLObjectSomeValuesFrom)ce).getFiller();
        if (!propertyExpression.isAnonymous()) {
          ObjectProperty prop=new ObjectProperty(propertyExpression.asOWLObjectProperty().toStringID());
          Map<Individual,SortedSet<Individual>> map=opPos.get(prop);
          if (map == null) {
            map=new HashMap<Individual,SortedSet<Individual>>();
            opPos.put(prop,map);
          }
          Individual individual=new Individual(ind.toStringID());
          SortedSet<Individual> values=map.get(individual);
          if (values == null) {
            values=new TreeSet<Individual>();
            map.put(individual,values);
          }
          if (values.isEmpty()) {
            Individual newIndividual=individualGenerator.newIndividual();
            values.add(newIndividual);
            if (!filler.isOWLThing()) {
              if (!filler.isAnonymous()) {
                NamedClass cls=new NamedClass(filler.asOWLClass().toStringID());
                System.out.println(cls);
                classInstancesPos.get(cls).add(newIndividual);
                Set<OWLClass> superClasses=rc.getReasoner().getSuperClasses(ce,false).getFlattened();
                System.out.println(superClasses);
                superClasses.remove(ontology.getOWLOntologyManager().getOWLDataFactory().getOWLThing());
                for (                OWLClass sup : superClasses) {
                  classInstancesPos.get(OWLAPIConverter.convertClass(sup)).add(newIndividual);
                }
              }
            }
          }
        }
 else {
        }
      }
    }
  }
  if (materializeExistentialRestrictions) {
    logger.debug("String_Node_Str");
    ExistentialRestrictionMaterialization materialization=new ExistentialRestrictionMaterialization(rc.getReasoner().getRootOntology());
    int cnt=1;
    for (    NamedClass cls : atomicConcepts) {
      System.out.println(cnt++ + "String_Node_Str" + atomicConcepts.size());
      TreeSet<Individual> individuals=classInstancesPos.get(cls);
      Set<OWLClassExpression> superClass=materialization.materialize(cls.getName());
      for (      OWLClassExpression sup : superClass) {
        fill(individuals,DLLearnerDescriptionConvertVisitor.getDLLearnerDescription(sup));
      }
    }
    logger.debug("String_Node_Str");
  }
  if (handlePunning) {
    OWLOntology ontology=rc.getReasoner().getRootOntology();
    Individual genericIndividual=new Individual("String_Node_Str");
    Map<Individual,SortedSet<Individual>> map=new HashMap<Individual,SortedSet<Individual>>();
    for (    Individual individual : individuals) {
      SortedSet<Individual> objects=new TreeSet<Individual>();
      objects.add(genericIndividual);
      map.put(individual,objects);
    }
    for (    NamedClass cls : atomicConcepts) {
      classInstancesNeg.get(cls).add(genericIndividual);
      if (OWLPunningDetector.hasPunning(ontology,cls)) {
        Individual clsAsInd=new Individual(cls.getName());
        SortedSet<Individual> individuals=classInstancesPos.get(cls);
        for (        Individual individual : individuals) {
          SortedSet<Individual> objects=map.get(individual);
          if (objects == null) {
            objects=new TreeSet<Individual>();
            map.put(individual,objects);
          }
          objects.add(clsAsInd);
        }
      }
    }
    opPos.put(OWLPunningDetector.punningProperty,map);
    atomicRoles=new TreeSet<ObjectProperty>(atomicRoles);
    atomicRoles.add(OWLPunningDetector.punningProperty);
    atomicRoles=Collections.unmodifiableSet(atomicRoles);
  }
  long dematDuration=System.currentTimeMillis() - dematStartTime;
  logger.debug("String_Node_Str" + dematDuration + "String_Node_Str");
}

Fixed version (ground truth):
private void dematerialize(){
  long dematStartTime=System.currentTimeMillis();
  logger.debug("String_Node_Str");
  Set<NamedClass> classes=rc.getNamedClasses();
  int i=1;
  for (  NamedClass atomicConcept : classes) {
    SortedSet<Individual> pos=rc.getIndividuals(atomicConcept);
    classInstancesPos.put(atomicConcept,(TreeSet<Individual>)pos);
    if (isDefaultNegation()) {
      classInstancesNeg.put(atomicConcept,(TreeSet<Individual>)Helper.difference(individuals,pos));
    }
 else {
      Negation negatedAtomicConcept=new Negation(atomicConcept);
      classInstancesNeg.put(atomicConcept,(TreeSet<Individual>)rc.getIndividuals(negatedAtomicConcept));
    }
  }
  logger.debug("String_Node_Str");
  for (  ObjectProperty atomicRole : atomicRoles) {
    opPos.put(atomicRole,rc.getPropertyMembers(atomicRole));
  }
  logger.debug("String_Node_Str");
  for (  DatatypeProperty atomicRole : datatypeProperties) {
    dpPos.put(atomicRole,rc.getDatatypeMembers(atomicRole));
  }
  for (  DatatypeProperty dp : booleanDatatypeProperties) {
    bdPos.put(dp,(TreeSet<Individual>)rc.getTrueDatatypeMembers(dp));
    bdNeg.put(dp,(TreeSet<Individual>)rc.getFalseDatatypeMembers(dp));
  }
  for (  DatatypeProperty dp : intDatatypeProperties) {
    id.put(dp,rc.getIntDatatypeMembers(dp));
  }
  for (  DatatypeProperty dp : doubleDatatypeProperties) {
    dd.put(dp,rc.getDoubleDatatypeMembers(dp));
  }
  for (  DatatypeProperty dp : stringDatatypeProperties) {
    sd.put(dp,rc.getStringDatatypeMembers(dp));
  }
  List<OWLOntology> ontologies=rc.getOWLAPIOntologies();
  for (  OWLOntology ontology : ontologies) {
    Set<OWLClassAssertionAxiom> axioms=ontology.getAxioms(AxiomType.CLASS_ASSERTION);
    for (    OWLClassAssertionAxiom axiom : axioms) {
      OWLIndividual ind=axiom.getIndividual();
      OWLClassExpression ce=axiom.getClassExpression();
      if (ce instanceof OWLObjectSomeValuesFrom) {
        OWLObjectPropertyExpression propertyExpression=((OWLObjectSomeValuesFrom)ce).getProperty();
        OWLClassExpression filler=((OWLObjectSomeValuesFrom)ce).getFiller();
        if (!propertyExpression.isAnonymous()) {
          ObjectProperty prop=new ObjectProperty(propertyExpression.asOWLObjectProperty().toStringID());
          Map<Individual,SortedSet<Individual>> map=opPos.get(prop);
          if (map == null) {
            map=new HashMap<Individual,SortedSet<Individual>>();
            opPos.put(prop,map);
          }
          Individual individual=new Individual(ind.toStringID());
          SortedSet<Individual> values=map.get(individual);
          if (values == null) {
            values=new TreeSet<Individual>();
            map.put(individual,values);
          }
          if (values.isEmpty()) {
            Individual newIndividual=individualGenerator.newIndividual();
            values.add(newIndividual);
            if (!filler.isOWLThing()) {
              if (!filler.isAnonymous()) {
                NamedClass cls=new NamedClass(filler.asOWLClass().toStringID());
                classInstancesPos.get(cls).add(newIndividual);
                Set<OWLClass> superClasses=rc.getReasoner().getSuperClasses(filler,false).getFlattened();
                superClasses.remove(ontology.getOWLOntologyManager().getOWLDataFactory().getOWLThing());
                for (                OWLClass sup : superClasses) {
                  classInstancesPos.get(OWLAPIConverter.convertClass(sup)).add(newIndividual);
                }
              }
            }
          }
        }
 else {
        }
      }
    }
  }
  if (materializeExistentialRestrictions) {
    logger.debug("String_Node_Str");
    ExistentialRestrictionMaterialization materialization=new ExistentialRestrictionMaterialization(rc.getReasoner().getRootOntology());
    int cnt=1;
    for (    NamedClass cls : atomicConcepts) {
      System.out.println(cnt++ + "String_Node_Str" + atomicConcepts.size());
      TreeSet<Individual> individuals=classInstancesPos.get(cls);
      Set<OWLClassExpression> superClass=materialization.materialize(cls.getName());
      for (      OWLClassExpression sup : superClass) {
        fill(individuals,DLLearnerDescriptionConvertVisitor.getDLLearnerDescription(sup));
      }
    }
    logger.debug("String_Node_Str");
  }
  if (handlePunning) {
    OWLOntology ontology=rc.getReasoner().getRootOntology();
    Individual genericIndividual=new Individual("String_Node_Str");
    Map<Individual,SortedSet<Individual>> map=new HashMap<Individual,SortedSet<Individual>>();
    for (    Individual individual : individuals) {
      SortedSet<Individual> objects=new TreeSet<Individual>();
      objects.add(genericIndividual);
      map.put(individual,objects);
    }
    for (    NamedClass cls : atomicConcepts) {
      classInstancesNeg.get(cls).add(genericIndividual);
      if (OWLPunningDetector.hasPunning(ontology,cls)) {
        Individual clsAsInd=new Individual(cls.getName());
        SortedSet<Individual> individuals=classInstancesPos.get(cls);
        for (        Individual individual : individuals) {
          SortedSet<Individual> objects=map.get(individual);
          if (objects == null) {
            objects=new TreeSet<Individual>();
            map.put(individual,objects);
          }
          objects.add(clsAsInd);
        }
      }
    }
    opPos.put(OWLPunningDetector.punningProperty,map);
    atomicRoles=new TreeSet<ObjectProperty>(atomicRoles);
    atomicRoles.add(OWLPunningDetector.punningProperty);
    atomicRoles=Collections.unmodifiableSet(atomicRoles);
  }
  long dematDuration=System.currentTimeMillis() - dematStartTime;
  logger.debug("String_Node_Str" + dematDuration + "String_Node_Str");
}