Program: 6767
Project: 6767
Buggy source:
/** 
 * Gets the data from a resource node, decode it to   {@link ResourceRequirement} and performs resource assignmentif the requirement changed.
 */
private void fetchAndProcessRequirement(final String path,Watcher watcher){
  Futures.addCallback(zkClient.getData(path,watcher),wrapCallback(new FutureCallback<NodeData>(){
    @Override public void onSuccess(    NodeData result){
      byte[] nodeData=result.getData();
      if (nodeData == null) {
        LOG.warn("String_Node_Str",zkClient.getConnectString(),path);
        return;
      }
      try {
        ResourceRequirement requirement=CoordinationConstants.RESOURCE_REQUIREMENT_CODEC.decode(nodeData);
        LOG.info("String_Node_Str",requirement);
        ResourceRequirement oldRequirement=requirements.get(requirement.getName());
        if (requirement.equals(oldRequirement)) {
          LOG.info("String_Node_Str",requirement.getName(),oldRequirement,requirement);
          return;
        }
        requirements.put(requirement.getName(),requirement);
        CancellableServiceDiscovered discovered=serviceDiscovered.get(requirement.getName());
        if (discovered == null) {
          discovered=new CancellableServiceDiscovered(discoveryService.discover(requirement.getName()),discoverableListener,executor);
          serviceDiscovered.put(requirement.getName(),discovered);
        }
 else {
          performAssignment(requirement,ImmutableSortedSet.copyOf(DiscoverableComparator.COMPARATOR,discovered));
        }
      }
 catch (      Exception e) {
        LOG.warn("String_Node_Str",zkClient.getConnectString(),path,Bytes.toStringBinary(nodeData),e);
      }
    }
    @Override public void onFailure(    Throwable t){
      LOG.error("String_Node_Str",zkClient.getConnectString(),path,t);
    }
  }
),executor);
}

Fixed version (ground truth):
/** 
 * Gets the data from a resource node, decode it to   {@link ResourceRequirement} and performs resource assignmentif the requirement changed.
 */
private void fetchAndProcessRequirement(final String path,Watcher watcher){
  Futures.addCallback(zkClient.getData(path,watcher),wrapCallback(new FutureCallback<NodeData>(){
    @Override public void onSuccess(    NodeData result){
      byte[] nodeData=result.getData();
      if (nodeData == null) {
        LOG.warn("String_Node_Str",zkClient.getConnectString(),path);
        return;
      }
      try {
        ResourceRequirement requirement=CoordinationConstants.RESOURCE_REQUIREMENT_CODEC.decode(nodeData);
        LOG.info("String_Node_Str",requirement);
        ResourceRequirement oldRequirement=requirements.get(requirement.getName());
        if (requirement.equals(oldRequirement)) {
          LOG.info("String_Node_Str",requirement.getName(),oldRequirement,requirement);
          return;
        }
        requirements.put(requirement.getName(),requirement);
        CancellableServiceDiscovered discovered=serviceDiscovered.get(requirement.getName());
        if (discovered == null) {
          discovered=new CancellableServiceDiscovered(discoveryService.discover(requirement.getName()),discoverableListener,executor);
          serviceDiscovered.put(requirement.getName(),discovered);
        }
 else {
          performAssignment(requirement,discovered.serviceDiscovered);
        }
      }
 catch (      Exception e) {
        LOG.warn("String_Node_Str",zkClient.getConnectString(),path,Bytes.toStringBinary(nodeData),e);
      }
    }
    @Override public void onFailure(    Throwable t){
      LOG.error("String_Node_Str",zkClient.getConnectString(),path,t);
    }
  }
),executor);
}