Buggy code:
; public void updateLeaderIds ( PublicKey newLeaderPublicKey ) { } final Handler < UiSearchRequest > searchRequestHandler = new Handler < UiSearchRequest > ( ) { @ Override public void handle ( UiSearchRequest searchRequest ) { } } ; final Handler < se . sics . ms . events . paginateAware . UiSearchRequest > paginateSearchRequestHandler = new Handler < se . sics . ms . events . paginateAware . UiSearchRequest > ( ) { @ Override public void handle ( se . sics . ms . events . paginateAware . UiSearchRequest uiSearchRequest ) { } } ; final Handler < UiAddIndexEntryRequest > addIndexEntryRequestHandler = new Handler < UiAddIndexEntryRequest > ( ) { @ Override public void handle ( UiAddIndexEntryRequest addIndexEntryRequest ) { } } ; final Handler < NumberOfPartitions > handleNumberOfPartitions = new Handler < NumberOfPartitions > ( ) { @ Override public void handle ( NumberOfPartitions numberOfPartitions ) { } } ; private void startSearch ( SearchPattern pattern , Integer searchTimeout , Integer fanoutParameter ) { } private void closeIndex ( Directory index ) { } ClassMatchedHandler < SearchInfo . Request , BasicContentMsg < DecoratedAddress , DecoratedHeader < DecoratedAddress > , SearchInfo . Request > > handleSearchRequest = new ClassMatchedHandler < SearchInfo . Request , BasicContentMsg < DecoratedAddress , DecoratedHeader < DecoratedAddress > , SearchInfo . Request > > ( ) { @ Override public void handle ( SearchInfo . Request request , BasicContentMsg < DecoratedAddress , DecoratedHeader < DecoratedAddress > , SearchInfo . Request > event ) { } } ; private void initiateSearch ( SearchPattern pattern , Integer searchTimeout , Integer fanoutParameter ) { } private List < IdScorePair > getIdScoreCollection ( ApplicationLuceneAdaptor adaptor , SearchPattern pattern , int limit ) throws LuceneAdaptorException { } private ArrayList < ApplicationEntry > searchLocal ( ApplicationLuceneAdaptor adaptor , SearchPattern pattern , int limit ) throws LuceneAdaptorException { } ClassMatchedHandler < SearchInfo . ResponseUpdated , BasicContentMsg < DecoratedAddress , DecoratedHeader < DecoratedAddress > , SearchInfo . ResponseUpdated > > handleSearchResponse = new ClassMatchedHandler < SearchInfo . ResponseUpdated , BasicContentMsg < DecoratedAddress , DecoratedHeader < DecoratedAddress > , SearchInfo . ResponseUpdated > > ( ) { @ Override public void handle ( SearchInfo . ResponseUpdated response , BasicContentMsg < DecoratedAddress , DecoratedHeader < DecoratedAddress > , SearchInfo . ResponseUpdated > event ) { } } ; private void addSearchResponse ( Collection < ApplicationEntry > entries , int partition , UUID requestId ) { } private void logSearchTimeResults ( UUID requestId , long timeCompleted , Integer numOfPartitions ) { } private void removeEntriesNotFromYourShard ( ApplicationEntry . ApplicationEntryId middleId , boolean isPartition ) { } private void addEntries ( ApplicationLuceneAdaptor searchRequestLuceneAdaptor , Collection < ApplicationEntry > entries ) throws IOException { } private void answerSearchRequestBase ( ) { } private void addEntryToLucene ( ApplicationLuceneAdaptor adaptor , ApplicationEntry entry ) throws LuceneAdaptorException { } private void addEntry ( ApplicationLuceneAdaptor adaptor , ApplicationEntry entry ) throws IOException , LuceneAdaptorException { } private void commitAndUpdateUtility ( ApplicationEntry entry ) throws LuceneAdaptorException { } private void checkAndInitiateSharding ( ) throws LuceneAdaptorException { } Handler < TimeoutCollection . PreShardTimeout > preShardTimeoutHandler = new Handler < TimeoutCollection . PreShardTimeout > ( ) { @ Override public void handle ( TimeoutCollection . PreShardTimeout event ) { } } ; private void handleSharding ( UUID shardRoundID , LeaderUnit previousUnit , LeaderUnit shardUnit ) { } private void handleSharding ( ShardLeaderUnit shardUnit ) { } private List < LeaderUnit > generateLUSkipList ( LeaderUnit shardContainer , ApplicationEntry . ApplicationEntryId medianId , boolean partitionSubId ) throws IOException , LuceneAdaptorException { } public void applyShardingUpdate ( boolean partitionSubId , PartitionId selfPartitionId , ApplicationEntry . ApplicationEntryId medianId ) { } Handler < TimeoutCollection . ShardRoundTimeout > shardRoundTimeoutHandler = new Handler < TimeoutCollection . ShardRoundTimeout > ( ) { @ Override public void handle ( TimeoutCollection . ShardRoundTimeout event ) { } } ; private boolean isTimeToShard ( ) { } private ApplicationEntry findEntryByIdBase ( ApplicationEntry . ApplicationEntryId entryId , TopDocsCollector collector ) { } private ApplicationEntry findEntryById ( ApplicationEntry . ApplicationEntryId entryId ) { } private boolean shardToNextLevel ( boolean partitionSubId , PartitionId selfPartitionId ) { } private void informListeningComponentsAboutUpdates ( ApplicationSelf self ) { PeerDescriptor updatedDesc = self . getSelfDescriptor ( ) ; selfDescriptor = updatedDesc ; trigger ( new SelfChangedPort . SelfChangedEvent ( self ) , selfChangedPort ) ; <START_BUG> trigger ( new se . sics . p2ptoolbox . gradient . msg . GradientUpdate < PeerDescriptor > ( updatedDesc ) , gradientPort ) ; <END_BUG> trigger ( new ViewUpdate ( electionRound , updatedDesc ) , electionPort ) ; trigger ( selfDescriptor , selfViewUpdatePort ) ; SearchComponentInfo componentInfo = new SearchComponentInfo ( updatedDesc , 0 , leaderAddress ) ; ComponentInfoEvent event = new ComponentInfoEvent ( defaultComponentOverlayId , componentInfo ) ; trigger ( event , localAggregatorPort ) ; } Handler < GradientSample > gradientSampleHandler = new Handler < GradientSample > ( ) { @ Override public void handle ( GradientSample event ) { } } ; private void publishSample ( Set < PeerDescriptor > samples ) { } Handler < LeaderState . ElectedAsLeader > leaderElectionHandler = new Handler < LeaderState . ElectedAsLeader > ( ) { @ Override public void handle ( LeaderState . ElectedAsLeader event ) { } } ; Handler < ExtensionUpdate > extensionUpdateHandler = new Handler < ExtensionUpdate > ( ) { @ Override public void handle ( ExtensionUpdate event ) { } } ; private void cleanSelfAddress ( Collection < DecoratedAddress > collection ) { } private void addMarkerUnit ( ) throws LuceneAdaptorException { } private LeaderUnit closePreviousEpoch ( ) throws LuceneAdaptorException { } Handler < TimeoutCollection . LandingEntryAddTimeout > landingEntryAddTimeout = new Handler < TimeoutCollection . LandingEntryAddTimeout > ( ) { @ Override public void handle ( TimeoutCollection . LandingEntryAddTimeout event ) { } } ; Handler < LeaderState . TerminateBeingLeader > terminateBeingLeaderHandler = new Handler < LeaderState . TerminateBeingLeader > ( ) { @ Override public void handle ( LeaderState . TerminateBeingLeader event ) { } } ;

Fix:
trigger ( new se . sics . p2ptoolbox . gradient . msg . GradientUpdate < PeerDescriptor > ( updatedDesc ) , selfViewUpdatePort ) ;