Bug 7901: Prevent null Modification in BatchedModifications
Caused by: java.lang.NullPointerException
at org.opendaylight.controller.cluster.datastore.modification.
MutableCompositeModification.writeExternal(MutableCompositeModification.java:120)
Somehow a null Modification instance got added to the modifications List.
Looking at the callers of addModification, it is not clear which call site
might have been the culprit. So I added a guard in addModification against
a null input Modification and logged an error with stack trace. I also
modified getModifications to return an immutable List to prevent callers
from directly modifying the List (there was one).
Change-Id: Ic63aa9daada0548da05fe663a0d22cdcb3e7bceb
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>