Program: 15493
Project: 15493
Buggy source:
/** 
 * @see com.eucalyptus.util.async.MessageCallback#fire(edu.ucsb.eucalyptus.msgs.BaseMessage)
 * @param reply
 */
@Override public void fire(DescribeNetworksResponseType reply){
  for (  Network net : Networks.getInstance().listValues()) {
    net.trim(reply.getAddrsPerNet());
  }
  this.getSubject().getState().setAddressCapacity(reply.getAddrsPerNet());
  this.getSubject().getState().setMode(reply.getUseVlans());
  for (  NetworkInfoType netInfo : reply.getActiveNetworks()) {
    Network net=null;
    try {
      net=Networks.getInstance().lookup(netInfo.getAccountId() + "String_Node_Str" + netInfo.getNetworkName());
      if (net.getVlan().equals(Integer.valueOf(0)) && net.initVlan(netInfo.getVlan())) {
        NetworkToken netToken=new NetworkToken(this.getSubject().getName(),netInfo.getAccountId(),netInfo.getNetworkName(),netInfo.getUuid(),netInfo.getVlan());
        netToken=net.addTokenIfAbsent(netToken);
      }
    }
 catch (    NoSuchElementException e1) {
      AccountFullName accountFn=Accounts.lookupAccountFullNameById(netInfo.getAccountId());
      if (accountFn != null) {
        net=new Network(accountFn,netInfo.getNetworkName(),netInfo.getUuid());
        if (net.getVlan().equals(Integer.valueOf(0)) && net.initVlan(netInfo.getVlan())) {
          NetworkToken netToken=new NetworkToken(this.getSubject().getName(),netInfo.getAccountId(),netInfo.getNetworkName(),netInfo.getUuid(),netInfo.getVlan());
          netToken=net.addTokenIfAbsent(netToken);
        }
      }
    }
  }
  for (  Network net : Networks.getInstance().listValues(Networks.State.ACTIVE)) {
    net.trim(reply.getAddrsPerNet());
  }
  List<Cluster> ccList=Clusters.getInstance().listValues();
  int ccNum=ccList.size();
  for (  Cluster c : ccList) {
    ccNum-=c.getState().getMode();
  }
}

Fixed version (ground truth):
/** 
 * @see com.eucalyptus.util.async.MessageCallback#fire(edu.ucsb.eucalyptus.msgs.BaseMessage)
 * @param reply
 */
@Override public void fire(DescribeNetworksResponseType reply){
  for (  Network net : Networks.getInstance().listValues()) {
    net.trim(reply.getAddrsPerNet());
  }
  this.getSubject().getState().setAddressCapacity(reply.getAddrsPerNet());
  this.getSubject().getState().setMode(reply.getUseVlans());
  for (  NetworkInfoType netInfo : reply.getActiveNetworks()) {
    Network net=null;
    try {
      net=Networks.getInstance().lookup(netInfo.getAccountId() + "String_Node_Str" + netInfo.getNetworkName());
      if (net.getVlan().equals(Integer.valueOf(0)) && net.initVlan(netInfo.getVlan())) {
        NetworkToken netToken=new NetworkToken(this.getSubject().getName(),netInfo.getAccountId(),netInfo.getNetworkName(),netInfo.getUuid(),netInfo.getVlan());
        netToken=net.addTokenIfAbsent(netToken);
      }
    }
 catch (    NoSuchElementException e1) {
      try {
        AccountFullName accountFn=Accounts.lookupAccountFullNameById(netInfo.getAccountId());
        if (accountFn != null) {
          net=new Network(accountFn,netInfo.getNetworkName(),netInfo.getUuid());
          if (net.getVlan().equals(Integer.valueOf(0)) && net.initVlan(netInfo.getVlan())) {
            NetworkToken netToken=new NetworkToken(this.getSubject().getName(),netInfo.getAccountId(),netInfo.getNetworkName(),netInfo.getUuid(),netInfo.getVlan());
            netToken=net.addTokenIfAbsent(netToken);
          }
        }
      }
 catch (      Exception ex) {
        LOG.error(ex);
      }
    }
  }
  for (  Network net : Networks.getInstance().listValues(Networks.State.ACTIVE)) {
    net.trim(reply.getAddrsPerNet());
  }
  List<Cluster> ccList=Clusters.getInstance().listValues();
  int ccNum=ccList.size();
  for (  Cluster c : ccList) {
    ccNum-=c.getState().getMode();
  }
}