Program: 50565
Project: 50565
Buggy source:
public final void heartBeater(){
  if (!node.joined())   return;
  long now=System.currentTimeMillis();
  if (isMaster()) {
    List<Address> lsDeadAddresses=null;
    for (    MemberImpl memberImpl : lsMembers) {
      final Address address=memberImpl.getAddress();
      if (!thisAddress.equals(address)) {
        try {
          Connection conn=node.connectionManager.getConnection(address);
          if (conn != null && conn.live()) {
            if ((now - memberImpl.getLastRead()) >= (MAX_NO_HEARTBEAT_SECONDS * 1000L)) {
              conn=null;
              if (lsDeadAddresses == null) {
                lsDeadAddresses=new ArrayList<Address>();
              }
              lsDeadAddresses.add(address);
            }
          }
          if (conn != null && conn.live()) {
            if ((now - memberImpl.getLastWrite()) > 500) {
              Packet packet=obtainPacket("String_Node_Str",null,null,ClusterOperation.HEARTBEAT,0);
              sendOrReleasePacket(packet,conn);
            }
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
    if (lsDeadAddresses != null) {
      for (      Address address : lsDeadAddresses) {
        logger.log(Level.FINEST,"String_Node_Str" + address);
        doRemoveAddress(address);
        sendRemoveMemberToOthers(address);
      }
    }
  }
 else {
    if (getMasterAddress() != null) {
      MemberImpl masterMember=getMember(getMasterAddress());
      boolean removed=false;
      if (masterMember != null) {
        if ((now - masterMember.getLastRead()) >= (MAX_NO_HEARTBEAT_SECONDS * 1000L)) {
          doRemoveAddress(getMasterAddress());
          removed=true;
        }
      }
      if (!removed) {
        Packet packet=obtainPacket("String_Node_Str",null,null,ClusterOperation.HEARTBEAT,0);
        Connection connMaster=node.connectionManager.getOrConnect(getMasterAddress());
        sendOrReleasePacket(packet,connMaster);
      }
    }
    for (    MemberImpl member : lsMembers) {
      if (!member.localMember()) {
        Address address=member.getAddress();
        if (shouldConnectTo(address)) {
          Connection conn=node.connectionManager.getOrConnect(address);
          if (conn != null) {
            Packet packet=obtainPacket("String_Node_Str",null,null,ClusterOperation.HEARTBEAT,0);
            sendOrReleasePacket(packet,conn);
          }
        }
 else {
          Connection conn=node.connectionManager.getConnection(address);
          if (conn != null && conn.live()) {
            if ((now - member.getLastWrite()) > 1000) {
              Packet packet=obtainPacket("String_Node_Str",null,null,ClusterOperation.HEARTBEAT,0);
              sendOrReleasePacket(packet,conn);
            }
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public final void heartBeater(){
  if (!node.joined())   return;
  long now=System.currentTimeMillis();
  if (isMaster()) {
    List<Address> lsDeadAddresses=null;
    for (    MemberImpl memberImpl : lsMembers) {
      final Address address=memberImpl.getAddress();
      if (!thisAddress.equals(address)) {
        try {
          Connection conn=node.connectionManager.getConnection(address);
          if (conn != null && conn.live()) {
            if ((now - memberImpl.getLastRead()) >= (MAX_NO_HEARTBEAT_MILLIS)) {
              conn=null;
              if (lsDeadAddresses == null) {
                lsDeadAddresses=new ArrayList<Address>();
              }
              lsDeadAddresses.add(address);
            }
          }
          if (conn != null && conn.live()) {
            if ((now - memberImpl.getLastWrite()) > 500) {
              Packet packet=obtainPacket("String_Node_Str",null,null,ClusterOperation.HEARTBEAT,0);
              sendOrReleasePacket(packet,conn);
            }
          }
        }
 catch (        Exception e) {
          e.printStackTrace();
        }
      }
    }
    if (lsDeadAddresses != null) {
      for (      Address address : lsDeadAddresses) {
        logger.log(Level.FINEST,"String_Node_Str" + address);
        doRemoveAddress(address);
        sendRemoveMemberToOthers(address);
      }
    }
  }
 else {
    if (getMasterAddress() != null) {
      MemberImpl masterMember=getMember(getMasterAddress());
      boolean removed=false;
      if (masterMember != null) {
        if ((now - masterMember.getLastRead()) >= (MAX_NO_HEARTBEAT_MILLIS)) {
          doRemoveAddress(getMasterAddress());
          removed=true;
        }
      }
      if (!removed) {
        Packet packet=obtainPacket("String_Node_Str",null,null,ClusterOperation.HEARTBEAT,0);
        Connection connMaster=node.connectionManager.getOrConnect(getMasterAddress());
        sendOrReleasePacket(packet,connMaster);
      }
    }
    for (    MemberImpl member : lsMembers) {
      if (!member.localMember()) {
        Address address=member.getAddress();
        if (shouldConnectTo(address)) {
          Connection conn=node.connectionManager.getOrConnect(address);
          if (conn != null) {
            Packet packet=obtainPacket("String_Node_Str",null,null,ClusterOperation.HEARTBEAT,0);
            sendOrReleasePacket(packet,conn);
          }
        }
 else {
          Connection conn=node.connectionManager.getConnection(address);
          if (conn != null && conn.live()) {
            if ((now - member.getLastWrite()) > 1000) {
              Packet packet=obtainPacket("String_Node_Str",null,null,ClusterOperation.HEARTBEAT,0);
              sendOrReleasePacket(packet,conn);
            }
          }
        }
      }
    }
  }
}