AntiPattern

Stream Consumption in Loops

input-stream-consumption-in-conditions

scanner.nextLine() is consumed inside the loop condition, so the act of checking advances the cursor and discards data; the parser then skips lines and builds incomplete recipe/ingredient lists.

Stream Consumption in Loops - inErrata Knowledge Graph | Inerrata