Program: 72536
Project: 72536
Buggy source:
private void setUpHlaPublisher(RTIambassador rtia) throws NameNotFound, ObjectClassNotDefined, FederateNotExecutionMember, RTIinternalError, AttributeNotDefined, SaveInProgress, RestoreInProgress, ConcurrentAccessAttempted {
  Iterator<Entry<String,Object[]>> it=_hlaAttributesToPublish.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry<String,Object[]> elt=it.next();
    Object[] tObj=elt.getValue();
    int classHandle=rtia.getObjectClassHandle(_getClassNameFromTab(tObj));
    int objAttributeHandle=rtia.getAttributeHandle(_getPortFromTab(tObj).getContainer().getName(),classHandle);
    elt.setValue(new Object[]{_getPortFromTab(tObj),_getTypeFromTab(tObj),_getClassNameFromTab(tObj),classHandle,objAttributeHandle});
  }
  HashMap<String,LinkedList<String>> classHandleHlaPublisherTable=null;
  classHandleHlaPublisherTable=new HashMap<String,LinkedList<String>>();
  Iterator<Entry<String,Object[]>> it2=_hlaAttributesToPublish.entrySet().iterator();
  while (it2.hasNext()) {
    Map.Entry<String,Object[]> elt=it2.next();
    Object[] tObj=elt.getValue();
    String classHandleName=_getClassNameFromTab(tObj);
    if (classHandleHlaPublisherTable.containsKey(classHandleName)) {
      classHandleHlaPublisherTable.get(classHandleName).add(elt.getKey());
    }
 else {
      LinkedList<String> list=new LinkedList<String>();
      list.add(elt.getKey());
      classHandleHlaPublisherTable.put(classHandleName,list);
    }
  }
  Iterator<Entry<String,LinkedList<String>>> it3=classHandleHlaPublisherTable.entrySet().iterator();
  while (it3.hasNext()) {
    Map.Entry<String,LinkedList<String>> elt=it3.next();
    LinkedList<String> hlaPublishers=elt.getValue();
    int classHandle=rtia.getObjectClassHandle(elt.getKey());
    AttributeHandleSet _attributesLocal=RtiFactoryFactory.getRtiFactory().createAttributeHandleSet();
    for (    String s : hlaPublishers) {
      _attributesLocal.add(_getAttributeHandleFromTab(_hlaAttributesToPublish.get(s)));
    }
    try {
      rtia.publishObjectClass(classHandle,_attributesLocal);
    }
 catch (    OwnershipAcquisitionPending e) {
      e.printStackTrace();
    }
  }
  Iterator<Entry<String,Object[]>> it5=_hlaAttributesToPublish.entrySet().iterator();
  LinkedList<String> alreadyRegistered=new LinkedList<String>();
  while (it5.hasNext()) {
    Map.Entry<String,Object[]> elt=it5.next();
    Object[] tObj=elt.getValue();
    int classHandle=rtia.getObjectClassHandle(_getClassNameFromTab(tObj));
    TypedIOPort port=_getPortFromTab(tObj);
    List<IOPort> sender=port.sourcePortList();
    for (    IOPort s : sender) {
      String senderName=s.getContainer().getName();
      if (!alreadyRegistered.contains(senderName)) {
        alreadyRegistered.add(senderName);
        int myObjectInstId=-1;
        try {
          myObjectInstId=rtia.registerObjectInstance(classHandle,senderName);
          HlaPublisher pub=(HlaPublisher)port.getContainer();
          pub.register(senderName,myObjectInstId);
        }
 catch (        ObjectClassNotPublished e) {
          e.printStackTrace();
        }
catch (        ObjectAlreadyRegistered e) {
          e.printStackTrace();
        }
      }
    }
  }
}

Fixed version (ground truth):
private void setUpHlaPublisher(RTIambassador rtia) throws NameNotFound, ObjectClassNotDefined, FederateNotExecutionMember, RTIinternalError, AttributeNotDefined, SaveInProgress, RestoreInProgress, ConcurrentAccessAttempted {
  Iterator<Entry<String,Object[]>> it=_hlaAttributesToPublish.entrySet().iterator();
  while (it.hasNext()) {
    Map.Entry<String,Object[]> elt=it.next();
    Object[] tObj=elt.getValue();
    int classHandle=rtia.getObjectClassHandle(_getClassNameFromTab(tObj));
    int objAttributeHandle=rtia.getAttributeHandle(_getPortFromTab(tObj).getContainer().getName(),classHandle);
    elt.setValue(new Object[]{_getPortFromTab(tObj),_getTypeFromTab(tObj),_getClassNameFromTab(tObj),classHandle,objAttributeHandle});
  }
  HashMap<String,LinkedList<String>> classHandleHlaPublisherTable=null;
  classHandleHlaPublisherTable=new HashMap<String,LinkedList<String>>();
  Iterator<Entry<String,Object[]>> it2=_hlaAttributesToPublish.entrySet().iterator();
  while (it2.hasNext()) {
    Map.Entry<String,Object[]> elt=it2.next();
    Object[] tObj=elt.getValue();
    String classHandleName=_getClassNameFromTab(tObj);
    if (classHandleHlaPublisherTable.containsKey(classHandleName)) {
      classHandleHlaPublisherTable.get(classHandleName).add(elt.getKey());
    }
 else {
      LinkedList<String> list=new LinkedList<String>();
      list.add(elt.getKey());
      classHandleHlaPublisherTable.put(classHandleName,list);
    }
  }
  Iterator<Entry<String,LinkedList<String>>> it3=classHandleHlaPublisherTable.entrySet().iterator();
  while (it3.hasNext()) {
    Map.Entry<String,LinkedList<String>> elt=it3.next();
    LinkedList<String> hlaPublishers=elt.getValue();
    int classHandle=rtia.getObjectClassHandle(elt.getKey());
    AttributeHandleSet _attributesLocal=RtiFactoryFactory.getRtiFactory().createAttributeHandleSet();
    for (    String s : hlaPublishers) {
      _attributesLocal.add(_getAttributeHandleFromTab(_hlaAttributesToPublish.get(s)));
    }
    try {
      rtia.publishObjectClass(classHandle,_attributesLocal);
    }
 catch (    OwnershipAcquisitionPending e) {
      e.printStackTrace();
    }
  }
  Iterator<Entry<String,Object[]>> it5=_hlaAttributesToPublish.entrySet().iterator();
  LinkedList<String> alreadyRegistered=new LinkedList<String>();
  while (it5.hasNext()) {
    Map.Entry<String,Object[]> elt=it5.next();
    Object[] tObj=elt.getValue();
    int classHandle=rtia.getObjectClassHandle(_getClassNameFromTab(tObj));
    TypedIOPort port=_getPortFromTab(tObj);
    HlaPublisher pub=(HlaPublisher)port.getContainer();
    List<IOPort> senders=port.sourcePortList();
    for (    IOPort sender : senders) {
      String senderName=_federateName + "String_Node_Str" + sender.getContainer().getName();
      if (!alreadyRegistered.contains(senderName)) {
        alreadyRegistered.add(senderName);
        int myObjectInstId=-1;
        try {
          myObjectInstId=rtia.registerObjectInstance(classHandle,senderName);
          pub.register(senderName,myObjectInstId);
        }
 catch (        ObjectClassNotPublished e) {
          e.printStackTrace();
        }
catch (        ObjectAlreadyRegistered e) {
          e.printStackTrace();
        }
      }
    }
  }
}