Program: 14879
Project: 14879
Buggy source:
public void update(final Cluster cluster,final List<ClusterAddressInfo> ccList){
  if (!cluster.getState().isAddressingInitialized()) {
    Helper.loadStoredAddresses(cluster);
    cluster.getState().setAddressingInitialized(true);
  }
  for (  final ClusterAddressInfo addrInfo : ccList) {
    try {
      final Address address=Helper.lookupOrCreate(cluster,addrInfo);
      if (address.isAssigned() && !addrInfo.hasMapping() && !address.isPending()) {
        if (Principals.nobodyFullName().equals(address.getOwner())) {
          Helper.markAsAllocated(cluster,addrInfo,address);
        }
        try {
          final VmInstance vm=VmInstances.lookupByInstanceIp(addrInfo.getInstanceIp());
          clearOrphan(addrInfo);
        }
 catch (        final NoSuchElementException e) {
          try {
            final VmInstance vm=VmInstances.lookup(address.getInstanceId());
            clearOrphan(addrInfo);
          }
 catch (          final NoSuchElementException ex) {
            InetAddress addr=null;
            try {
              addr=Inet4Address.getByName(addrInfo.getInstanceIp());
            }
 catch (            final UnknownHostException e1) {
              LOG.debug(e1,e1);
            }
            if ((addr == null) || !addr.isLoopbackAddress()) {
              handleOrphan(cluster.getName(),addrInfo);
            }
          }
        }
      }
 else       if (address.isAllocated() && Principals.nobodyFullName().equals(address.getOwner()) && !address.isPending()) {
        Helper.markAsAllocated(cluster,addrInfo,address);
      }
    }
 catch (    final Exception e) {
      LOG.debug(e,e);
    }
  }
}

Fixed version (ground truth):
public void update(final Cluster cluster,final List<ClusterAddressInfo> ccList){
  if (!cluster.getState().isAddressingInitialized()) {
    Helper.loadStoredAddresses(cluster);
    cluster.getState().setAddressingInitialized(true);
  }
  for (  final ClusterAddressInfo addrInfo : ccList) {
    try {
      final Address address=Helper.lookupOrCreate(cluster,addrInfo);
      if (address.isAssigned() && !addrInfo.hasMapping() && !address.isPending()) {
        if (Principals.nobodyFullName().equals(address.getOwner())) {
          Helper.markAsAllocated(cluster,addrInfo,address);
        }
        try {
          final VmInstance vm=VmInstances.lookupByPrivateIp(addrInfo.getInstanceIp());
          clearOrphan(addrInfo);
        }
 catch (        final NoSuchElementException e) {
          try {
            final VmInstance vm=VmInstances.lookup(address.getInstanceId());
            clearOrphan(addrInfo);
          }
 catch (          final NoSuchElementException ex) {
            InetAddress addr=null;
            try {
              addr=Inet4Address.getByName(addrInfo.getInstanceIp());
            }
 catch (            final UnknownHostException e1) {
              LOG.debug(e1,e1);
            }
            if ((addr == null) || !addr.isLoopbackAddress()) {
              handleOrphan(cluster.getName(),addrInfo);
            }
          }
        }
      }
 else       if (address.isAllocated() && Principals.nobodyFullName().equals(address.getOwner()) && !address.isPending()) {
        Helper.markAsAllocated(cluster,addrInfo,address);
      }
    }
 catch (    final Exception e) {
      LOG.debug(e,e);
    }
  }
}