Fix an eclipse nullness warning 39/77839/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 14 Nov 2018 21:14:43 +0000 (22:14 +0100)
committerRobert Varga <nite@hq.sk>
Wed, 21 Nov 2018 11:08:36 +0000 (11:08 +0000)
commitec59d2e57be2f28d1984409d5ab2c92e3e55dd89
tree6fcd123a2b5a288e41afc8b3670cb99348074c87
parentbf230b1e1cff25cc1f0ade1a13be8eddf6e1e0c6
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>
(cherry picked from commit 440ffab6b7f7f1e5148641c2202aff6eed827c93)
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/LocRibWriter.java