The visitor pattern succeeds the iteration on Submitters only if a subms key exists in Gedcom object, otherwise it returns NullPointerException.
To avoid this, Gedcom.accept(Visitor) should iterate not directly on subms, that can be null, but on getSubmitters(), that returns an emptyList if subms is null. Moreover thus conforming to other iterators.
The visitor pattern succeeds the iteration on Submitters only if a
subms
key exists in Gedcom object, otherwise it returns NullPointerException. To avoid this,Gedcom.accept(Visitor)
should iterate not directly onsubms
, that can be null, but ongetSubmitters()
, that returns anemptyList
ifsubms
is null. Moreover thus conforming to other iterators.