Correct AbstractDataObjectModification memoization 16/106216/3
authorRobert Varga <robert.varga@pantheon.tech>
Sun, 28 May 2023 20:24:49 +0000 (22:24 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 29 May 2023 08:06:24 +0000 (10:06 +0200)
commitbcd8ee2d680bfb8d01eb4191ce35803fdcec9931
treea291aa60136fd7f0c2be06f95b0963db1e4fe41e
parentbc8cd94d3d317d783963524e63842310bc206ab1
Correct AbstractDataObjectModification memoization

Memoization here is not nice where nulls are concerned: if the result is
null, we end up round-tripping to the codec. Fix that by explicitly
masking null values with a sentinel object.

While we are at it, also relax access: instead of volatile read/writes,
use getAcquire()/setRelease() mechanics. Since the resulting DataObjects
are presumably previous, the set side is actually a CAS, reusing any
results of concurrent computation.

Change-Id: I77285e0842588b1882ef2eb09677d96395911a85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-dom-adapter/src/main/java/org/opendaylight/mdsal/binding/dom/adapter/AbstractDataObjectModification.java