Buggy code:
public class CoordinatedBolt implements IRichBolt { public static Logger LOG = Logger . getLogger ( CoordinatedBolt . class ) ; public static interface FinishedCallback { void finishedId ( Object id ) { } } public static interface TimeoutCallback { void timeoutId ( Object id ) { } } public static class SourceArgs implements Serializable { public boolean singleCount ; protected SourceArgs ( boolean singleCount ) { } public static CoordinatedBolt . SourceArgs single ( ) { } public static CoordinatedBolt . SourceArgs all ( ) { } @ Override public String toString ( ) { } } public class CoordinatedOutputCollector implements IOutputCollector { IOutputCollector _delegate ; public CoordinatedOutputCollector ( IOutputCollector delegate ) { } public List < Integer > emit ( String stream , Collection < Tuple > anchors , List < Object > tuple ) { } public void emitDirect ( int task , String stream , Collection < Tuple > anchors , List < Object > tuple ) { } public void ack ( Tuple tuple ) { } public void fail ( Tuple tuple ) { } public void reportError ( Throwable error ) { } private void updateTaskCounts ( Object id , List < Integer > tasks ) { } } private Map < String , CoordinatedBolt . SourceArgs > _sourceArgs ; private CoordinatedBolt . IdStreamSpec _idStreamSpec ; private IRichBolt _delegate ; private Integer _numSourceReports ; private List < Integer > _countOutTasks = new ArrayList < Integer > ( ) ; private OutputCollector _collector ; private TimeCacheMap < Object , CoordinatedBolt . TrackingInfo > _tracked ; public static class TrackingInfo { int reportCount = 0 ; int expectedTupleCount = 0 ; int receivedTuples = 0 ; boolean failed = false ; Map < Integer , Integer > taskEmittedTuples = new HashMap < Integer , Integer > ( ) ; boolean receivedId = false ; boolean finished = false ; @ Override public String toString ( ) { } } public static class IdStreamSpec implements Serializable { GlobalStreamId _id ; public GlobalStreamId getGlobalStreamId ( ) { } public static CoordinatedBolt . IdStreamSpec makeDetectSpec ( String component , String stream ) { } protected IdStreamSpec ( String component , String stream ) { } } public CoordinatedBolt ( IRichBolt delegate ) { } public CoordinatedBolt ( IRichBolt delegate , String sourceComponent , CoordinatedBolt . SourceArgs sourceArgs , CoordinatedBolt . IdStreamSpec idStreamSpec ) { } public CoordinatedBolt ( IRichBolt delegate , Map < String , CoordinatedBolt . SourceArgs > sourceArgs , CoordinatedBolt . IdStreamSpec idStreamSpec ) { } public void prepare ( Map config , TopologyContext context , OutputCollector collector ) { ExpiredCallback < Object , CoordinatedBolt . TrackingInfo > callback = null ; if ( ( _delegate ) instanceof CoordinatedBolt . TimeoutCallback ) { callback = new CoordinatedBolt . TimeoutItems ( ) ; } <START_BUG> _tracked = new TimeCacheMap < Object , CoordinatedBolt . TrackingInfo > ( context . maxTopologyMessageTimeout ( config ) , callback ) ; <END_BUG> _collector = collector ; _delegate . prepare ( config , context , new OutputCollector ( new CoordinatedBolt . CoordinatedOutputCollector ( collector ) ) ) ; for ( String component : Utils . get ( context . getThisTargets ( ) , COORDINATED_STREAM_ID , new HashMap < String , backtype . storm . generated . Grouping > ( ) ) . keySet ( ) ) { for ( Integer task : context . getComponentTasks ( component ) ) { _countOutTasks . add ( task ) ; } } if ( ! ( _sourceArgs . isEmpty ( ) ) ) { _numSourceReports = 0 ; for ( Map . Entry < String , CoordinatedBolt . SourceArgs > entry : _sourceArgs . entrySet ( ) ) { if ( entry . getValue ( ) . singleCount ) { _numSourceReports += 1 ; } else { _numSourceReports += context . getComponentTasks ( entry . getKey ( ) ) . size ( ) ; } } } } private boolean checkFinishId ( Tuple tup ) { } public void execute ( Tuple tuple ) { } public void cleanup ( ) { } public void declareOutputFields ( OutputFieldsDeclarer declarer ) { } @ Override public Map < String , Object > getComponentConfiguration ( ) { } private static Map < String , CoordinatedBolt . SourceArgs > singleSourceArgs ( String sourceComponent , CoordinatedBolt . SourceArgs sourceArgs ) { } private class TimeoutItems implements ExpiredCallback < Object , CoordinatedBolt . TrackingInfo > { @ Override public void expire ( Object id , CoordinatedBolt . TrackingInfo val ) { } } }

Fix:
_tracked = new TimeCacheMap < Object , CoordinatedBolt . TrackingInfo > ( context . maxTopologyMessageTimeout ( ) , callback ) ;