Defer statement initialization in InferredStatementContext (YANGTOOLS-784)

[YANGTOOLS-1156] InferredStatementContext.isConfiguration() forces substatement materialization Created: 29/Oct/20  Updated: 02/Nov/20  Resolved: 02/Nov/20

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: None
Fix Version/s: 6.0.1, 5.0.8

Type: Sub-task Priority: Medium
Reporter: Robert Varga Assignee: Miroslav Kovac
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We currently use generic method of discovery for isConfiguration(), which means searching all effective statements. This forces materialization of those substatements, which we do not need.

If substatements have been materialized, we should fall back to searching them, but if they were not, we should check parent and and prototype – and make sense of that directly.

This may require a bit of work as we are dealing with completely different assumptions than current utilities handle.



 Comments   
Comment by Robert Varga [ 29/Oct/20 ]

This probably requires

 

interface StmtContext {
    Optional<Boolean> explicitConfig()
}

which will be independent of parent, asking the question 'do you (transitively) have a child which produces ConfigurationEffectiveStatement and if so, what argument does it have?

Let's add it as a @Beta method and see how it goes.

 

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