Program: 49477
Project: 49477
Buggy source:
public ClusterManager(final Node node){
  super(node);
  securityLogger=node.loggingService.getLogger("String_Node_Str");
  WAIT_MILLIS_BEFORE_JOIN=node.groupProperties.WAIT_SECONDS_BEFORE_JOIN.getInteger() * 1000L;
  MAX_WAIT_SECONDS_BEFORE_JOIN=node.groupProperties.MAX_WAIT_SECONDS_BEFORE_JOIN.getInteger();
  MAX_NO_HEARTBEAT_MILLIS=node.groupProperties.MAX_NO_HEARTBEAT_SECONDS.getInteger() * 1000L;
  HEARTBEAT_INTERVAL_MILLIS=node.groupProperties.HEARTBEAT_INTERVAL_SECONDS.getInteger() * 1000L;
  ICMP_ENABLED=node.groupProperties.ICMP_ENABLED.getBoolean();
  ICMP_TTL=node.groupProperties.ICMP_TTL.getInteger();
  ICMP_TIMEOUT=node.groupProperties.ICMP_TIMEOUT.getInteger();
  node.clusterService.registerPeriodicRunnable(new SplitBrainHandler(node));
  node.clusterService.registerPeriodicRunnable(new Runnable(){
    public void run(){
      long now=Clock.currentTimeMillis();
      if (now - lastHeartbeat >= HEARTBEAT_INTERVAL_MILLIS) {
        heartBeater();
        lastHeartbeat=now;
      }
    }
  }
);
  node.clusterService.registerPeriodicRunnable(new Runnable(){
    public void run(){
      checkScheduledActions();
    }
  }
);
  node.connectionManager.addConnectionListener(this);
  registerPacketProcessor(ClusterOperation.RESPONSE,new PacketProcessor(){
    public void process(    Packet packet){
      handleResponse(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.HEARTBEAT,new PacketProcessor(){
    public void process(    Packet packet){
      releasePacket(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.LOG,new PacketProcessor(){
    public void process(    Packet packet){
      logger.log(Level.parse(packet.name),toObject(packet.getValueData()).toString());
      releasePacket(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.JOIN_CHECK,new PacketProcessor(){
    public void process(    Packet packet){
      Connection conn=packet.conn;
      Request request=Request.copyFromPacket(packet);
      JoinInfo joinInfo=(JoinInfo)toObject(request.value);
      request.clearForResponse();
      if (joinInfo != null && node.joined() && node.isActive()) {
        try {
          node.validateJoinRequest(joinInfo);
          request.response=toData(node.createJoinInfo());
        }
 catch (        Exception e) {
          request.response=toData(e);
        }
      }
      returnResponse(request,conn);
      releasePacket(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.REMOTELY_PROCESS_AND_RESPOND,new PacketProcessor(){
    public void process(    Packet packet){
      Data data=packet.getValueData();
      RemotelyProcessable rp=(RemotelyProcessable)toObject(data);
      rp.setConnection(packet.conn);
      rp.setNode(node);
      rp.process();
      sendResponse(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.REMOTELY_PROCESS,new PacketProcessor(){
    public void process(    Packet packet){
      Data data=packet.getValueData();
      RemotelyProcessable rp=(RemotelyProcessable)toObject(data);
      rp.setConnection(packet.conn);
      rp.setNode(node);
      rp.process();
      releasePacket(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.REMOTELY_CALLABLE_BOOLEAN,new PacketProcessor(){
    public void process(    Packet packet){
      Boolean result;
      AbstractRemotelyCallable<Boolean> callable=null;
      try {
        Data data=packet.getValueData();
        callable=(AbstractRemotelyCallable<Boolean>)toObject(data);
        callable.setConnection(packet.conn);
        callable.setNode(node);
        result=callable.call();
      }
 catch (      Exception e) {
        logger.log(Level.SEVERE,"String_Node_Str" + callable,e);
        result=Boolean.FALSE;
      }
      if (result == Boolean.TRUE) {
        sendResponse(packet);
      }
 else {
        sendResponseFailure(packet);
      }
    }
  }
);
  registerPacketProcessor(ClusterOperation.REMOTELY_CALLABLE_OBJECT,new PacketProcessor(){
    public void process(    Packet packet){
      Object result;
      AbstractRemotelyCallable<Boolean> callable=null;
      try {
        Data data=packet.getValueData();
        callable=(AbstractRemotelyCallable)toObject(data);
        callable.setConnection(packet.conn);
        callable.setNode(node);
        result=callable.call();
      }
 catch (      Exception e) {
        logger.log(Level.SEVERE,"String_Node_Str" + callable,e);
        result=null;
      }
      if (result != null) {
        Data value;
        if (result instanceof Data) {
          value=(Data)result;
        }
 else {
          value=toData(result);
        }
        packet.setValue(value);
      }
      sendResponse(packet);
    }
  }
);
}

Fixed version (ground truth):
public ClusterManager(final Node node){
  super(node);
  securityLogger=node.loggingService.getLogger("String_Node_Str");
  WAIT_MILLIS_BEFORE_JOIN=node.groupProperties.WAIT_SECONDS_BEFORE_JOIN.getInteger() * 1000L;
  MAX_WAIT_SECONDS_BEFORE_JOIN=node.groupProperties.MAX_WAIT_SECONDS_BEFORE_JOIN.getInteger();
  MAX_NO_HEARTBEAT_MILLIS=node.groupProperties.MAX_NO_HEARTBEAT_SECONDS.getInteger() * 1000L;
  HEARTBEAT_INTERVAL_MILLIS=node.groupProperties.HEARTBEAT_INTERVAL_SECONDS.getInteger() * 1000L;
  ICMP_ENABLED=node.groupProperties.ICMP_ENABLED.getBoolean();
  ICMP_TTL=node.groupProperties.ICMP_TTL.getInteger();
  ICMP_TIMEOUT=node.groupProperties.ICMP_TIMEOUT.getInteger();
  node.clusterService.registerPeriodicRunnable(new SplitBrainHandler(node));
  node.clusterService.registerPeriodicRunnable(new Runnable(){
    public void run(){
      long now=Clock.currentTimeMillis();
      if (now - lastHeartbeat >= HEARTBEAT_INTERVAL_MILLIS) {
        heartBeater();
        lastHeartbeat=now;
      }
    }
  }
);
  node.clusterService.registerPeriodicRunnable(new Runnable(){
    public void run(){
      checkScheduledActions();
    }
  }
);
  node.connectionManager.addConnectionListener(this);
  registerPacketProcessor(ClusterOperation.RESPONSE,new PacketProcessor(){
    public void process(    Packet packet){
      handleResponse(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.HEARTBEAT,new PacketProcessor(){
    public void process(    Packet packet){
      releasePacket(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.LOG,new PacketProcessor(){
    public void process(    Packet packet){
      logger.log(Level.parse(packet.name),toObject(packet.getValueData()).toString());
      releasePacket(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.JOIN_CHECK,new PacketProcessor(){
    public void process(    Packet packet){
      Connection conn=packet.conn;
      Request request=Request.copyFromPacket(packet);
      Data value=request.value;
      request.clearForResponse();
      if (node.isMaster() && node.joined() && node.isActive()) {
        JoinInfo joinInfo=(JoinInfo)toObject(value);
        if (joinInfo != null) {
          try {
            node.validateJoinRequest(joinInfo);
            request.response=toData(node.createJoinInfo());
          }
 catch (          Exception e) {
            request.response=toData(e);
          }
        }
      }
      returnResponse(request,conn);
      releasePacket(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.REMOTELY_PROCESS_AND_RESPOND,new PacketProcessor(){
    public void process(    Packet packet){
      Data data=packet.getValueData();
      RemotelyProcessable rp=(RemotelyProcessable)toObject(data);
      rp.setConnection(packet.conn);
      rp.setNode(node);
      rp.process();
      sendResponse(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.REMOTELY_PROCESS,new PacketProcessor(){
    public void process(    Packet packet){
      Data data=packet.getValueData();
      RemotelyProcessable rp=(RemotelyProcessable)toObject(data);
      rp.setConnection(packet.conn);
      rp.setNode(node);
      rp.process();
      releasePacket(packet);
    }
  }
);
  registerPacketProcessor(ClusterOperation.REMOTELY_CALLABLE_BOOLEAN,new PacketProcessor(){
    public void process(    Packet packet){
      Boolean result;
      AbstractRemotelyCallable<Boolean> callable=null;
      try {
        Data data=packet.getValueData();
        callable=(AbstractRemotelyCallable<Boolean>)toObject(data);
        callable.setConnection(packet.conn);
        callable.setNode(node);
        result=callable.call();
      }
 catch (      Exception e) {
        logger.log(Level.SEVERE,"String_Node_Str" + callable,e);
        result=Boolean.FALSE;
      }
      if (result == Boolean.TRUE) {
        sendResponse(packet);
      }
 else {
        sendResponseFailure(packet);
      }
    }
  }
);
  registerPacketProcessor(ClusterOperation.REMOTELY_CALLABLE_OBJECT,new PacketProcessor(){
    public void process(    Packet packet){
      Object result;
      AbstractRemotelyCallable<Boolean> callable=null;
      try {
        Data data=packet.getValueData();
        callable=(AbstractRemotelyCallable)toObject(data);
        callable.setConnection(packet.conn);
        callable.setNode(node);
        result=callable.call();
      }
 catch (      Exception e) {
        logger.log(Level.SEVERE,"String_Node_Str" + callable,e);
        result=null;
      }
      if (result != null) {
        Data value;
        if (result instanceof Data) {
          value=(Data)result;
        }
 else {
          value=toData(result);
        }
        packet.setValue(value);
      }
      sendResponse(packet);
    }
  }
);
}