Refactor checkTouchApplicable() 08/80308/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Feb 2019 11:52:14 +0000 (12:52 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 13 Feb 2019 13:48:59 +0000 (14:48 +0100)
commit537fb78fff63d751f72bd5cc1d4b3ae129118ca0
tree57f611ccb92dd2c678c9eef6d73f2d321843f1b5
parent098079dd4e4f335ae9648a668b852ac638818bd8
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