Builder should acquire augmentations only once 65/76965/2
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 13 Oct 2018 08:28:34 +0000 (10:28 +0200)
committerRobert Varga <nite@hq.sk>
Sat, 13 Oct 2018 09:59:13 +0000 (09:59 +0000)
commitcd55e852848b6b5a21d54f153dbfa00e4974d3bc
tree0f9cb423c5b7204645ceea5c16fa8ec64e653f91
parentced9879f6b69bb9052dc5f4b951ec173e09f61ad
Builder should acquire augmentations only once

While generated DataObjects have this method simple, LazyDataObject
constructs the map lazily and caches it -- hence additional access
is forcing an additional volatile read.

Therefore instead of invoking augmentations() twice, store its
result in a local variable and reuse that.

Change-Id: Ifbe2002bb7edbd253d65b5bdc1e53c4d687bed32
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/BuilderTemplate.xtend