Buggy code:
public class ClientConnection implements Connection , Closeable { private static final int WAIT_TIME_FOR_PACKETS_TO_BE_CONSUMED = 10 ; private volatile boolean live = true ; private final ILogger logger = Logger . getLogger ( ClientConnection . class ) ; private final ClientWriteHandler writeHandler ; private final ClientReadHandler readHandler ; private final ClientConnectionManager connectionManager ; private final int connectionId ; private final SocketChannelWrapper socketChannelWrapper ; private volatile Address remoteEndpoint ; private final ConcurrentMap < Integer , ClientCallFuture > callIdMap = new ConcurrentHashMap < Integer , ClientCallFuture > ( ) ; private final ConcurrentMap < Integer , ClientCallFuture > eventHandlerMap = new ConcurrentHashMap < Integer , ClientCallFuture > ( ) ; private final ByteBuffer readBuffer ; private final SerializationService serializationService ; private final ClientExecutionService executionService ; private final ClientInvocationServiceImpl invocationService ; private boolean readFromSocket = true ; private final AtomicInteger packetCount = new AtomicInteger ( 0 ) ; private volatile boolean heartBeating = true ; public ClientConnection ( ClientConnectionManager connectionManager , IOSelector in , IOSelector out , int connectionId , SocketChannelWrapper socketChannelWrapper , ClientExecutionService executionService , ClientInvocationServiceImpl invocationService , SerializationService serializationService ) throws IOException { } public void incrementPacketCount ( ) { } public void decrementPacketCount ( ) { } public void registerCallId ( ClientCallFuture future ) { } public ClientCallFuture deRegisterCallId ( int callId ) { } public ClientCallFuture deRegisterEventHandler ( int callId ) { } public EventHandler getEventHandler ( int callId ) { } public SerializationService getSerializationService ( ) { } @ Override public boolean write ( SocketWritable packet ) { } public void init ( ) throws IOException { } public void write ( Data data ) throws IOException { } public Data read ( ) throws IOException { } @ Override public Address getEndPoint ( ) { } @ Override public boolean isAlive ( ) { } @ Override public long lastReadTime ( ) { } @ Override public long lastWriteTime ( ) { } @ Override public void close ( ) { } @ Override public ConnectionType getType ( ) { } @ Override public boolean isClient ( ) { } @ Override public InetAddress getInetAddress ( ) { } @ Override public InetSocketAddress getRemoteSocketAddress ( ) { } @ Override public int getPort ( ) { } public SocketChannelWrapper getSocketChannelWrapper ( ) { } public ClientConnectionManager getConnectionManager ( ) { } public ClientReadHandler getReadHandler ( ) { } public void setRemoteEndpoint ( Address remoteEndpoint ) { } public Address getRemoteEndpoint ( ) { } public InetSocketAddress getLocalSocketAddress ( ) { } private void innerClose ( ) throws IOException { } private class CleanResourcesTask implements Runnable { @ Override public void run ( ) { } private void waitForPacketsProcessed ( ) { } } private void cleanResources ( ConstructorFunction < Object , Throwable > responseCtor ) { } public void close ( Throwable t ) { } @ SuppressWarnings ( "VO_VOLATILE_INCREMENT" ) void heartBeatingFailed ( ) { } void heartBeatingSucceed ( ) { } public boolean isHeartBeating ( ) { <START_BUG> return heartBeating ; <END_BUG> } @ Override public boolean equals ( Object o ) { } @ Override public int hashCode ( ) { } @ Override public String toString ( ) { } }

Fix:
return ( live ) && ( heartBeating ) ;