[YANGTOOLS-945] Eliminate no-op MandatoryLeafEnforcer Created: 30/Jan/19  Updated: 30/Jan/19  Resolved: 30/Jan/19

Status: Resolved
Project: yangtools
Component/s: data-impl
Affects Version/s: None
Fix Version/s: 3.0.0, 2.0.17, 2.1.9

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Epic Link: unlabeled-YANGTOOLS-940

 Description   

We are currently always wrapping ContainerModificationStrategy with an enforcer, even when that enforcer does nothing. The same applies to ListEntryModificationStrategy.

Improve the situation by only wrapping when an enforcer is actually needed – hence we either use stock methods, or run an enforcer inbetween. This has the benefit of making MandatoryLeafEnforcer a singleton implementation, allowing it to be perfectly inlined.

It also means that most of the time we will not encounter an overridden SchemaAwareApplyOperation method, simply because mandatory leaves are not that prevalent.


Generated at Wed Feb 07 20:54:45 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.