I think you should return here, otherwise you will have problems with an empty cleanRecordList later (on sortedRecordList[0] calls in Line 49 and in the MessageGenerator).