Fix an eclipse nullness warning 24/77824/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 14 Nov 2018 21:14:43 +0000 (22:14 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 14 Nov 2018 21:14:43 +0000 (22:14 +0100)
commit440ffab6b7f7f1e5148641c2202aff6eed827c93
tree4764271c85c3d03a03a705d7d693b5146649fd76
parent99daf02ad6b9f722e581cadaf101e1bff31366f1
Fix an eclipse nullness warning

Eclipse (rightfully) flags this access as potentiall null. Since
we are invoking an interface getter, it is not statically known that
the two invocations will return the same value.

Cache the second field access in a local variable, which ensures
we access the property exactly once, which keeps eclipse happy.

In case the implementation LazyDataObjectModification, this has
the benefit of not deserializing twice.

Change-Id: Idfb8c631bc0267a63710c2cb650e6bda1c227df3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/LocRibWriter.java