Program: 116808
Project: 116808
Buggy source:
private Partition getPartition(final OMNode item,Collection<Partition> partitions){
  Partition partition=null;
  String id=null;
  String type=null;
  if (item.getType() == OMNode.ELEMENT_NODE) {
    OMElement iaasElt=(OMElement)item;
    Iterator<?> it=iaasElt.getChildrenWithName(new QName(CloudControllerConstants.ID_ELEMENT));
    if (it.hasNext()) {
      OMElement providerElt=(OMElement)it.next();
      id=providerElt.getText();
    }
    if (it.hasNext()) {
      log.warn(xmlSource + "String_Node_Str" + CloudControllerConstants.ID_ELEMENT+ "String_Node_Str"+ "String_Node_Str");
    }
    if (id == null) {
      String msg="String_Node_Str" + CloudControllerConstants.ID_ELEMENT + "String_Node_Str"+ "String_Node_Str"+ xmlSource;
      handleException(msg);
    }
    Iterator<?> it1=iaasElt.getChildrenWithName(new QName(CloudControllerConstants.SCOPE_ELEMENT));
    if (it1.hasNext()) {
      OMElement providerElt=(OMElement)it1.next();
      type=providerElt.getText();
    }
    if (it1.hasNext()) {
      log.warn(xmlSource + "String_Node_Str" + CloudControllerConstants.SCOPE_ELEMENT+ "String_Node_Str"+ "String_Node_Str");
    }
    if (type == null) {
      String msg="String_Node_Str" + CloudControllerConstants.SCOPE_ELEMENT + "String_Node_Str"+ "String_Node_Str"+ xmlSource;
      handleException(msg);
    }
    if (partitions != null) {
      for (      Partition partition1 : partitions) {
        if (partition1.getId().equals(id)) {
          partition=partition1;
          break;
        }
      }
    }
    if (partition == null) {
      partition=new Partition();
      partition.setId(id);
      partition.setScope(type);
      loadProperties(iaasElt,partition.getProperties());
    }
 else {
      Partition partition1=new Partition();
      partition1.setId(id);
      partition1.setScope(type);
      loadProperties(iaasElt,partition1.getProperties());
      Gson gson=new Gson();
      String partitionS=gson.toJson(partition);
      String partition1S=gson.toJson(partition1);
      if (!partitionS.endsWith(partition1S)) {
        partition.setId(id);
        partition.setScope(type);
        loadProperties(iaasElt,partition.getProperties());
      }
    }
  }
  return partition;
}

Fixed version (ground truth):
private Partition getPartition(final OMNode item){
  Partition partition=null;
  Partition oldPartition=null;
  String id=null;
  String type=null;
  if (item.getType() == OMNode.ELEMENT_NODE) {
    OMElement iaasElt=(OMElement)item;
    Iterator<?> it=iaasElt.getChildrenWithName(new QName(CloudControllerConstants.ID_ELEMENT));
    if (it.hasNext()) {
      OMElement providerElt=(OMElement)it.next();
      id=providerElt.getText();
    }
    if (it.hasNext()) {
      log.warn(xmlSource + "String_Node_Str" + CloudControllerConstants.ID_ELEMENT+ "String_Node_Str"+ "String_Node_Str");
    }
    if (id == null) {
      String msg="String_Node_Str" + CloudControllerConstants.ID_ELEMENT + "String_Node_Str"+ "String_Node_Str"+ xmlSource;
      handleException(msg);
    }
    oldPartition=TopologyManager.getInstance().getTopology().getPartition(id);
    Iterator<?> it1=iaasElt.getChildrenWithName(new QName(CloudControllerConstants.SCOPE_ELEMENT));
    if (it1.hasNext()) {
      OMElement providerElt=(OMElement)it1.next();
      type=providerElt.getText();
    }
    if (it1.hasNext()) {
      log.warn(xmlSource + "String_Node_Str" + CloudControllerConstants.SCOPE_ELEMENT+ "String_Node_Str"+ "String_Node_Str");
    }
    if (type == null) {
      String msg="String_Node_Str" + CloudControllerConstants.SCOPE_ELEMENT + "String_Node_Str"+ "String_Node_Str"+ xmlSource;
      handleException(msg);
    }
    if (oldPartition != null) {
      if (oldPartition.getId().equals(id)) {
        partition=oldPartition;
      }
    }
    if (partition == null) {
      partition=new Partition();
      partition.setId(id);
      partition.setScope(type);
      loadProperties(iaasElt,partition.getProperties());
      TopologyBuilder.handlePartitionCreated(partition);
    }
 else {
      Partition partition1=new Partition();
      partition1.setId(id);
      partition1.setScope(type);
      loadProperties(iaasElt,partition1.getProperties());
      Gson gson=new Gson();
      String partitionS=gson.toJson(partition);
      String partition1S=gson.toJson(partition1);
      if (!partitionS.endsWith(partition1S)) {
        partition.setId(id);
        partition.setScope(type);
        loadProperties(iaasElt,partition.getProperties());
        TopologyBuilder.handlePartitionUpdated(partition,oldPartition);
      }
    }
  }
  return partition;
}