Improve ImmutableAugmentationNodeBuilder defensiveness 60/95860/1
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 19 Apr 2021 19:41:10 +0000 (21:41 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 20 Apr 2021 22:30:39 +0000 (00:30 +0200)
The check for nested augmentations is rather ugly and will trigger
a secondary UnsupportedOperationException -- simply because we are
accessing getNodeType() even for AugmentationNodes.

Fix the thinko by performing an explicit check first, which also makes
things a wee bit faster.

Change-Id: I001c8d3b7c4a53ddb2c45d7c9157f7b1081dc992
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 1e24596294bdc2a57a808b77a2d9862198e4f46e)


No differences found