Buggy code:
public class Gossiper implements IFailureDetectionEventListener { private static final RetryingScheduledThreadPoolExecutor executor = new RetryingScheduledThreadPoolExecutor ( "GossipTasks" ) ; static final ApplicationState [ ] STATES = ApplicationState . values ( ) ; static final List < String > DEAD_STATES = Arrays . asList ( REMOVING_TOKEN , REMOVED_TOKEN , STATUS_LEFT ) ; private ScheduledFuture < ? > scheduledGossipTask ; public static final int intervalInMillis = 1000 ; public static final int QUARANTINE_DELAY = ( StorageService . RING_DELAY ) * 2 ; private static Logger logger = LoggerFactory . getLogger ( Gossiper . class ) ; public static final Gossiper instance = new Gossiper ( ) ; private long aVeryLongTime ; private long FatClientTimeout ; private Random random = new Random ( ) ; private Comparator < InetAddress > inetcomparator = new Comparator < InetAddress > ( ) { public int compare ( InetAddress addr1 , InetAddress addr2 ) { } } ; private List < IEndpointStateChangeSubscriber > subscribers = new CopyOnWriteArrayList < IEndpointStateChangeSubscriber > ( ) ; private Set < InetAddress > liveEndpoints = new ConcurrentSkipListSet < InetAddress > ( inetcomparator ) ; private Map < InetAddress , Long > unreachableEndpoints = new ConcurrentHashMap < InetAddress , Long > ( ) ; private Set < InetAddress > seeds = new ConcurrentSkipListSet < InetAddress > ( inetcomparator ) ; Map < InetAddress , EndpointState > endpointStateMap = new ConcurrentHashMap < InetAddress , EndpointState > ( ) ; private Map < InetAddress , Long > justRemovedEndpoints = new ConcurrentHashMap < InetAddress , Long > ( ) ; private final ConcurrentMap < InetAddress , Integer > versions = new org . cliffc . high_scale_lib . NonBlockingHashMap < InetAddress , Integer > ( ) ; private class GossipTask implements Runnable { public void run ( ) { } } private Gossiper ( ) { } public void register ( IEndpointStateChangeSubscriber subscriber ) { } public void unregister ( IEndpointStateChangeSubscriber subscriber ) { } public void setVersion ( InetAddress address , int version ) { } public void resetVersion ( InetAddress endpoint ) { } public Integer getVersion ( InetAddress address ) { } public Set < InetAddress > getLiveMembers ( ) { } public Set < InetAddress > getUnreachableMembers ( ) { } public long getEndpointDowntime ( InetAddress ep ) { } public void convict ( InetAddress endpoint , double phi ) { } int getMaxEndpointStateVersion ( EndpointState epState ) { } private void evictFromMembership ( InetAddress endpoint ) { } public void removeEndpoint ( InetAddress endpoint ) { } public void replacedEndpoint ( InetAddress endpoint ) { } private void makeRandomGossipDigest ( List < GossipDigest > gDigests ) { } public void advertiseRemoving ( InetAddress endpoint , Token token , Token mytoken ) { } public void advertiseTokenRemoved ( InetAddress endpoint , Token token ) { } public boolean isKnownEndpoint ( InetAddress endpoint ) { } public int getCurrentGenerationNumber ( InetAddress endpoint ) { } Message makeGossipDigestSynMessage ( List < GossipDigest > gDigests , int version ) throws IOException { } Message makeGossipDigestAckMessage ( GossipDigestAckMessage gDigestAckMessage , int version ) throws IOException { } Message makeGossipDigestAck2Message ( GossipDigestAck2Message gDigestAck2Message , int version ) throws IOException { } private boolean sendGossip ( MessageProducer prod , Set < InetAddress > epSet ) { } private boolean doGossipToLiveMember ( MessageProducer prod ) { } private void doGossipToUnreachableMember ( MessageProducer prod ) { } private void doGossipToSeed ( MessageProducer prod ) { } private void doStatusCheck ( ) { } public EndpointState getEndpointStateForEndpoint ( InetAddress ep ) { } public Set < Map . Entry < InetAddress , EndpointState > > getEndpointStates ( ) { } EndpointState getStateForVersionBiggerThan ( InetAddress forEndpoint , int version ) { } public int compareEndpointStartup ( InetAddress addr1 , InetAddress addr2 ) { } void notifyFailureDetector ( List < GossipDigest > gDigests ) { } void notifyFailureDetector ( Map < InetAddress , EndpointState > remoteEpStateMap ) { } void notifyFailureDetector ( InetAddress endpoint , EndpointState remoteEndpointState ) { } private void markAlive ( InetAddress addr , EndpointState localState ) { } private void markDead ( InetAddress addr , EndpointState localState ) { } private void handleMajorStateChange ( InetAddress ep , EndpointState epState ) { } private Boolean isDeadState ( EndpointState epState ) { } void applyStateLocally ( Map < InetAddress , EndpointState > epStateMap ) { } private void applyNewStates ( InetAddress addr , EndpointState localState , EndpointState remoteState ) { } private void doNotifications ( InetAddress addr , ApplicationState state , VersionedValue value ) { } private void requestAll ( GossipDigest gDigest , List < GossipDigest > deltaGossipDigestList , int remoteGeneration ) { } private void sendAll ( GossipDigest gDigest , Map < InetAddress , EndpointState > deltaEpStateMap , int maxRemoteVersion ) { } void examineGossiper ( List < GossipDigest > gDigestList , List < GossipDigest > deltaGossipDigestList , Map < InetAddress , EndpointState > deltaEpStateMap ) { } public void start ( int generationNbr ) { } public void maybeInitializeLocalState ( int generationNbr ) { } public void addSavedEndpoint ( InetAddress ep ) { <START_BUG> if ( ep == ( FBUtilities . getBroadcastAddress ( ) ) ) { <END_BUG> Gossiper . logger . debug ( "Attempt<seq2seq4repair_space>to<seq2seq4repair_space>add<seq2seq4repair_space>self<seq2seq4repair_space>as<seq2seq4repair_space>saved<seq2seq4repair_space>endpoint" ) ; return ; } EndpointState epState = new EndpointState ( new HeartBeatState ( 0 ) ) ; epState . markDead ( ) ; epState . setHasToken ( true ) ; endpointStateMap . put ( ep , epState ) ; unreachableEndpoints . put ( ep , System . currentTimeMillis ( ) ) ; if ( Gossiper . logger . isTraceEnabled ( ) ) Gossiper . logger . trace ( ( ( ( "Adding<seq2seq4repair_space>saved<seq2seq4repair_space>endpoint<seq2seq4repair_space>" + ep ) + "<seq2seq4repair_space>" ) + ( epState . getHeartBeatState ( ) . getGeneration ( ) ) ) ) ; } public void addLocalApplicationState ( ApplicationState state , VersionedValue value ) { } public void stop ( ) { } public boolean isEnabled ( ) { } public void initializeNodeUnsafe ( InetAddress addr , int generationNbr ) { } }

Fix:
if ( ep == ( FBUtilities . getLocalAddress ( ) ) ) {