Refactor checkTouchApplicable() 14/80314/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Feb 2019 11:52:14 +0000 (12:52 +0100)
committerRobert Varga <nite@hq.sk>
Wed, 13 Feb 2019 14:24:31 +0000 (14:24 +0000)
commit99bb34694d35803da6cc1ccbe112d3efa5b4e2fd
tree8d51e6e709856bf67ee27f2e8765e5c08d23774b
parentbd4d31b27b60e843e3e5373f6e416729171d671c
Refactor checkTouchApplicable()

We can remove direct overrides of checkTouchApplicable() by making
the method smarter in its checking of preconditions. Notably we
do not check TreeNode presence multiple times, but rather perform
a step-wise unpacking of state.

This has the benefit of having a clean place where we check if
automatic lifecycle is in effect and that happens only if the node
does not exist.

JIRA: YANGTOOLS-943
Change-Id: I72f4316c77d8f36efaf95209c36e898c9b4873cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AbstractNodeContainerModificationStrategy.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/AugmentationModificationStrategy.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/ChoiceModificationStrategy.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/MapModificationStrategy.java
yang/yang-data-impl/src/main/java/org/opendaylight/yangtools/yang/data/impl/schema/tree/StructuralContainerModificationStrategy.java