Buggy code:
public class frameDisplay extends BaseRichBolt { OutputCollector collector ; RedisStreamProducer producer ; private HashMap < Integer , IplImage > rawFrameMap ; private HashMap < Integer , List < TraceRecord > > traceData ; private String host ; private int port ; private String queueName ; private int accumulateFrameSize ; static int scale_num = 1 ; static float scale_stride = ( ( float ) ( Math . sqrt ( 2.0 ) ) ) ; static float [ ] fscales ; static int ixyScale = 0 ; @ Override public void prepare ( Map map , TopologyContext topologyContext , OutputCollector outputCollector ) { } @ Override public void execute ( Tuple tuple ) { String streamId = tuple . getSourceStreamId ( ) ; int frameId = tuple . getIntegerByField ( FIELD_FRAME_ID ) ; System . out . println ( ( ( ( "receive<seq2seq4repair_space>tuple,<seq2seq4repair_space>frameID:<seq2seq4repair_space>" + frameId ) + ",<seq2seq4repair_space>streamID:<seq2seq4repair_space>" ) + streamId ) ) ; if ( streamId . equals ( STREAM_FRAME_OUTPUT ) ) { IplImage fake = new IplImage ( ) ; Serializable . Mat sMat = ( ( Serializable . Mat ) ( tuple . getValueByField ( FIELD_FRAME_MAT ) ) ) ; IplImage frame = sMat . toJavaCVMat ( ) . asIplImage ( ) ; rawFrameMap . computeIfAbsent ( frameId , ( k ) -> frame ) ; } else <START_BUG> if ( streamId . equals ( FIELD_TRACE_RECORD ) ) { <END_BUG> List < TraceRecord > traceRecords = ( ( List < TraceRecord > ) ( tuple . getValueByField ( FIELD_TRACE_RECORD ) ) ) ; traceData . computeIfAbsent ( frameId , ( k ) -> traceRecords ) ; } if ( ( rawFrameMap . containsKey ( frameId ) ) && ( traceData . containsKey ( frameId ) ) ) { IplImage frame = rawFrameMap . get ( frameId ) ; List < TraceRecord > traceRecords = traceData . get ( frameId ) ; for ( int i = 0 ; i < ( traceRecords . size ( ) ) ; i ++ ) { TraceRecord trace = traceRecords . get ( i ) ; float length = trace . pointDescs . size ( ) ; float point0_x = ( frameDisplay . fscales [ frameDisplay . ixyScale ] ) * ( trace . pointDescs . get ( 0 ) . sPoint . x ( ) ) ; float point0_y = ( frameDisplay . fscales [ frameDisplay . ixyScale ] ) * ( trace . pointDescs . get ( 0 ) . sPoint . y ( ) ) ; CvPoint2D32f point0 = new CvPoint2D32f ( ) ; point0 . x ( point0_x ) ; point0 . y ( point0_y ) ; float jIndex = 0 ; for ( int jj = 1 ; jj < length ; jj ++ , jIndex ++ ) { float point1_x = ( frameDisplay . fscales [ frameDisplay . ixyScale ] ) * ( trace . pointDescs . get ( jj ) . sPoint . x ( ) ) ; float point1_y = ( frameDisplay . fscales [ frameDisplay . ixyScale ] ) * ( trace . pointDescs . get ( jj ) . sPoint . y ( ) ) ; CvPoint2D32f point1 = new CvPoint2D32f ( ) ; point1 . x ( point1_x ) ; point1 . y ( point1_y ) ; cvLine ( frame , cvPointFrom32f ( point0 ) , cvPointFrom32f ( point1 ) , CV_RGB ( 0 , cvFloor ( ( ( 255.0 * ( jIndex + 1.0 ) ) // length ) ) , 0 ) , 1 , 8 , 0 ) ; point0 = point1 ; } } opencv_core . Mat mat = new opencv_core . Mat ( frame ) ; producer . addFrame ( new topology . StreamFrame ( frameId , mat ) ) ; System . out . println ( ( ( ( "finishedAdd:<seq2seq4repair_space>" + ( System . currentTimeMillis ( ) ) ) + ":" ) + frameId ) ) ; rawFrameMap . remove ( frameId ) ; traceData . remove ( frameId ) ; } System . out . println ( ( ( ( ( ( ( ( "finished:<seq2seq4repair_space>" + ( System . currentTimeMillis ( ) ) ) + ":" ) + frameId ) + ",rawFrameMap:<seq2seq4repair_space>" ) + ( rawFrameMap . containsKey ( frameId ) ) ) + ",traceData:<seq2seq4repair_space>" ) + ( traceData . containsKey ( frameId ) ) ) ) ; collector . ack ( tuple ) ; } @ Override public void declareOutputFields ( OutputFieldsDeclarer outputFieldsDeclarer ) { } }

Fix:
if ( streamId . equals ( STREAM_PLOT_TRACE ) ) {