Program: 88745
Project: 88745
Buggy source:
private void applyInternal() throws Exception {
  for (  Node<String,MissionComponent> mc : tree.getAllNodes()) {
    NamedElement e=mc.getData().getElement();
    if (e == null) {
      e=ef.createClassInstance();
      if (IMCEPresent) {
        StereotypesHelper.addStereotypeByString(e,IMCECOMPONENT);
      }
 else {
        StereotypesHelper.addStereotypeByString(e,COMPONENT);
      }
      e.setOwner(mc.getParent().getData().getElement());
    }
    if (!e.getName().equals(mc.getData().getName()))     e.setName(mc.getData().getName());
    if (mc.getData().isPackage())     continue;
    for (    LibraryComponent lc : mc.getData().getAddedLib()) {
      addSpecialization((Classifier)e,(Classifier)lc.getElement());
    }
    for (    LibraryComponent lc : mc.getData().getRemovedLib()) {
      removeSpecialization((Classifier)e,(Classifier)lc.getElement());
    }
    for (    MissionCharacterization mmc : mc.getData().getAddedChar()) {
      Classifier c=(Classifier)mmc.getElement();
      if (existsProperty(e,c))       continue;
      if (c == null) {
        c=ef.createClassInstance();
        c.setName(mmc.getName());
        c.setOwner(e);
        if (IMCEPresent) {
          StereotypesHelper.addStereotypeByString(c,IMCECHAR);
        }
 else {
          StereotypesHelper.addStereotypeByString(c,CHAR);
        }
        Generalization g=ef.createGeneralizationInstance();
        g.setOwner(c);
        g.setSpecific(c);
        g.setGeneral((Classifier)mmc.getLibraryCharacterization());
        Utils.copyStereotypes((Classifier)mmc.getLibraryCharacterization(),c);
        bst((Class)c);
      }
      Association a=ef.createAssociationInstance();
      a.setOwner(e.getOwner());
      Property p1=a.getMemberEnd().get(0);
      Property p2=a.getMemberEnd().get(1);
      p1.setName(mmc.getName());
      p1.setType(c);
      p1.setOwner(e);
      p1.setAggregation(AggregationKindEnum.COMPOSITE);
      StereotypesHelper.addStereotypeByString(p1,"String_Node_Str");
      p2.setType((Type)e);
    }
    for (    MissionCharacterization mmc : mc.getData().getRemovedChar()) {
      for (      Property p : new HashSet<Property>(((Classifier)e).getAttribute())) {
        if (p.getType() == mmc.getElement()) {
          ModelElementsManager.getInstance().removeElement(p.getType());
          ModelElementsManager.getInstance().removeElement(p);
        }
      }
    }
  }
}

Fixed version (ground truth):
private void applyInternal() throws Exception {
  for (  Node<String,MissionComponent> mc : tree.getAllNodes()) {
    NamedElement e=mc.getData().getElement();
    if (e == null) {
      e=ef.createClassInstance();
      if (IMCEPresent) {
        StereotypesHelper.addStereotypeByString(e,IMCECOMPONENT);
      }
 else {
        StereotypesHelper.addStereotypeByString(e,COMPONENT);
      }
      e.setOwner(mc.getParent().getData().getElement());
    }
    if (!e.getName().equals(mc.getData().getName()))     e.setName(mc.getData().getName());
    if (mc.getData().isPackage())     continue;
    for (    LibraryComponent lc : mc.getData().getAddedLib()) {
      addSpecialization((Classifier)e,(Classifier)lc.getElement());
    }
    for (    LibraryComponent lc : mc.getData().getRemovedLib()) {
      removeSpecialization((Classifier)e,(Classifier)lc.getElement());
    }
    for (    MissionCharacterization mmc : mc.getData().getAddedChar()) {
      Classifier c=(Classifier)mmc.getElement();
      if (existsProperty(e,c))       continue;
      if (c == null) {
        if (IMCEPresent) {
          c=ef.createComponentInstance();
          c.setName(mmc.getName());
          c.setOwner(e);
          StereotypesHelper.addStereotypeByString(c,IMCECHAR);
        }
 else {
          c=ef.createClassInstance();
          c.setName(mmc.getName());
          c.setOwner(e);
          StereotypesHelper.addStereotypeByString(c,CHAR);
        }
        Generalization g=ef.createGeneralizationInstance();
        g.setOwner(c);
        g.setSpecific(c);
        g.setGeneral((Classifier)mmc.getLibraryCharacterization());
        Utils.copyStereotypes((Classifier)mmc.getLibraryCharacterization(),c);
        bst((Class)c);
      }
      Association a=ef.createAssociationInstance();
      a.setOwner(e.getOwner());
      Property p1=a.getMemberEnd().get(0);
      Property p2=a.getMemberEnd().get(1);
      p1.setName(mmc.getName());
      p1.setType(c);
      p1.setOwner(e);
      p1.setAggregation(AggregationKindEnum.COMPOSITE);
      StereotypesHelper.addStereotypeByString(p1,"String_Node_Str");
      p2.setType((Type)e);
    }
    for (    MissionCharacterization mmc : mc.getData().getRemovedChar()) {
      for (      Property p : new HashSet<Property>(((Classifier)e).getAttribute())) {
        if (p.getType() == mmc.getElement()) {
          ModelElementsManager.getInstance().removeElement(p.getType());
          ModelElementsManager.getInstance().removeElement(p);
        }
      }
    }
  }
}