public Card getCard()throws IOException{ Card c = null; String cardInfo = null; assert readStream != null: cardInfo = readStream.readLine(); assert cardInfo != null: c = CreateCard(cardInfo); return c; } I'm a little outta practice and I am trying to improve my code quality by using the assert statement to test for nulls. The way it seems to work I end up having to daisy chain my assertions because if the first thing I test for is null, then the next one is gonna be a null as well....
readStreamis null, them the next part never gets executed, so you don't have to worry aboutcardInfo. But where are you gettingreadStreamfrom? What is the purpose of this method?-eafor assertions to be enabled