writer.nextLine should be final